打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Mkimage参数意义解析

通过mkimage这个tool可以给zImage添加一个header:

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;

 

此header是如何生成的?利用u-boot里面的mkimage工具来生成uImage   (u-boot源码包/tools/mkimage.c )

这里解释一下参数的意义:

-A ==> set architecture to 'arch'

-O ==> set operating system to 'os'

-T ==> set image type to 'type' “kernel或是ramdisk”

-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,即不进行文件的拷贝,在当前位置执行)

 

对于ARM linux内核映象用法:

-A arm     -------- 架构是arm
-O linux    -------- 操作系统是
linux
-T kernel  -------- 类型是
kernel
-C none/bzip/gzip    -------- 压缩类型

-a 20008000 ---- image的载入地址(hex),通常为0xX00008000
-e 200080XX---- 内核的入口地址(hex),XX为0x40或者
0x00
-n linux-XXX --- image的名字,任意

-d nameXXX             ---- 无头信息的image文件名,你的源内核文件
uImageXXX    ---- 加了头信息之后的image文件名,任意取

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Image?uImage与zImage的区别【转】
Unpacking and repacking U-Boot uImage
用uboot 烧写uboot linux内核 文件系统到nandflash的 过程以及bo...
【嵌入式Linux学习七步曲之第三篇 Linux系统bootlaoder移植】U-BOOT全线移植分析系列之四--U-boot如何引导Linux内核启动? - Sailor
bootm命令中地址参数,内核加载地址以及内核入口地址
第1阶段——uboot分析之启动函数bootm命令 (9)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服