Monday, June 3, 2013

Instructions for use mkimage

mkimage image file in the production time, the original image file before the increase of the head of a 0x40 byte length, the increase in head structure is described below
/ *
 Image * Legacy format header,
 * All Data in Network byte Order (aka Natural aka bigendian).
 * /
typedef struct image_header {
    uint32_t ih_magic; / * Header Image Magic Number * /
    uint32_t ih_hcrc; / * Image Header CRC Checksum * /
    uint32_t ih_time; / * Image Creation Timestamp * /
    uint32_t ih_size; / * Image Data Size * /
    uint32_t ih_load; / * Data Load Address * /
    uint32_t ih_ep; / * Entry Point Address * /
    uint32_t ih_dcrc; / * Image Data CRC Checksum * /
    uint8_t ih_os; / * Operating System * /
    uint8_t ih_arch; / * CPU architecture * /
    uint8_t ih_type; / * Image Type * /
    uint8_t ih_comp; / * Compression Type * /
    uint8_t ih_name [IH_NMLEN]; / * Image Name * /
} image_header_t;
Image Name takes up 32 bytes, the other takes up 32 bytes of information
mkimage Usage:
Usage:. / Mkimage-L Image
          -L ==> List Image header information
       . / mkimage [-x]-A Arch-O OS-T type-C COMP-a addr-e EP-N name-d data_file [: data_file ...] Image
          -A ==> set architecture to 'Arch'
          -O ==> Operating system set to 'OS'
          -T ==> set Image type to 'type'
          -C ==> set compression type ' COMP '
          -a ==> set Load address to 'addr' (hex)
          -e ==> set entry Point to 'EP' (hex)
          -N ==> set Image name to 'name'
          -d ==> Use Image Data from 'datafile'
          -x ==> set XIP (execute in place)
       . / mkimage [-D dtc_options]-f-image.its FIT FIT-Image
-A set architecture types, values ​​refer uboot / common / image.c
-O set the type of operating system, you can refer to the value uboot / common / image.c
-T image types, values ​​refer uboot / common / image.c
-A Specifies the image in memory load address
-E Specifies the address of the entry point to run image
-C specifies compression, compression reference uboot / common / image.c
-D data_file [: data_file ...] making image source files

Example
 $ MKIMAGE_TOOL-A arm-O linux-T kernel-C none-a 0x90008000-e 0x90008000-n "Android Linux Kernel"-d./ZImage./UImage

No comments:

Post a Comment