kernel image 与 kernel u-boot 可识别的image

u-boot 加载kernel, 需要将kernel image 变换为uboot img

uimg 只是在原来img 基础上加了一个64byte 头部。如下:

0000000: 2705 1956 5e24 0227 55bb 30d2 001e 56b0  '..V^$.'U.0...V.
0000010: 0001 0000 0001 0000 44c1 8989 0502 0200  ........D.......
0000020: 7a49 6d61 6765 2d68 6a6a 0000 0000 0000  zImage-hjj......
0000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000040: 0000 a0e1 0000 a0e1 0000 a0e1 0000 a0e1  ................
0x40 往后是原内核数据, 头部解释如下:
gdb$ p hdr
$4 = (const image_header_t *) 0x7ffff782f000
gdb$ p *hdr
$5 = {
  ih_magic = 0x56190527,
  ih_hcrc = 0x2702245e,
  ih_time = 0xd230bb55,
  ih_size = 0xb0561e00,
  ih_load = 0x100,
  ih_ep = 0x100,
  ih_dcrc = 0x8989c144,
  ih_os = 0x5,
  ih_arch = 0x2,
  ih_type = 0x2,
  ih_comp = 0x0,
  ih_name = "zImage-hjj", '\000' <repeats 21 times>
}

检查是否是一个合法uimg, 需检查
ih_magic(可以支持好几种类型,本例为default),
ih_hcrc(image hearder crc check),
ih_dcrc(image data crc check)
均通过为校验合格。

其它域为信息域。
~                                                                                                                                         
~                                                                                                                                         
~                                                       
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值