Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1688561
  • 博文数量: 206
  • 博客积分: 1450
  • 博客等级: 上尉
  • 技术积分: 2285
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-11 11:38
个人简介

学习永无止境!!

文章分类

全部博文(206)

文章存档

2022年(5)

2019年(3)

2018年(8)

2017年(32)

2016年(7)

2015年(13)

2014年(44)

2013年(24)

2011年(6)

2010年(17)

2009年(46)

2008年(1)

分类: 嵌入式

2014-10-24 10:48:09

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_TOOL -A arm -O linux -T kernel -C none -a 0x90008000 -e 0x90008000 -n "Android Linux Kernel" -d ./zImage  ./uImage

阅读(1203) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~