您的位置:首页 > 其它

制作uboot

2016-07-27 16:36 246 查看
mkimage工具位于 Uboot tools目录下

mkimage是在制作镜像文件时候, 在原来的image文件前增加一个0x40字节长度的头,增加的头结构描述如下

/*

* Legacy format image header,

* all data in network byte order (aka natural aka bigendian).

*/

typedef struct image_header {

uint32_t ih_magic; /* Image Header 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占用了32字节,其他信息占用了32字节

mkimage用法:

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 ==> set operating system 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 fit-image.its fit-image

-A 设定架构类型,可取值参照uboot/common/image.c

-O 设定操作系统类型,可取值参照uboot/common/image.c

-T image类型,可取值参照uboot/common/image.c

-a 指定image在内存中的加载地址

-e 指定image运行的入口点地址

-C 指定压缩方式,压缩方式参考uboot/common/image.c

-d data_file[:data_file...] 制作image的源文件

示例

./mkimage -A arm -O linux -T kernel -C none -a 30008000 -e 30008000 -n linux-2.6.26 -d zImage uImage
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  uboot制作 制作uboot