uboot的header结构

    如果要编译uboot的kernel的话需要执行make uImage,根据make help说明:
                uImage        - U-Boot wrapped zImage
是在生成的Image中加入了一些信息供uboot读取,使用的工具是mkimage。所以如果执行make uImage而没有指定mkimage的路径的话会报错。但是mkimage到底对Image加入了一些什么信息呢?
这是测试的一个uImge文件
Image Name:   Linux-2.6.35.7+
Created:      Thu Mar 14 17:28:42 2013
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3646944 Bytes = 3561.47 kB = 3.48 MB
Load Address: 00008000
Entry Point:  00008000
这是测试的一个Image或者zImage文件:
Image is like this:Bad Magic Number
zImage is like this:Bad Magic Number

 

使用命令od -A n -h -j 0 -N 64 uImage 得到如下信息:
 0527 5619 a3d9 90e8 4151 4a98 3700 e0a5
 0000 0080 0000 0080 5663 3ca7 0205 0002
 694c 756e 2d78 2e32 2e36 3533 372e 002b
 0000 0000 0000 0000 0000 0000 0000 0000
 这就是uboot的头,具体表示什么意思呢?查看image.h文件,它在uboot源码的include目录下,可以在这个地址查看:

https://github.com/EmcraftSystems/u-boot/blob/master/include/image.h

得到如下信息:
 #define IH_NMLEN                32
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;

至此,uboot的结构以及它们的含义已经搞清楚了。

转载于:https://www.cnblogs.com/CyclingQQ/p/3527532.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值