其他分享
首页 > 其他分享> > zImage uImage 区别

zImage uImage 区别

作者:互联网

zImage uImage 区别

uImage 在 zImage 前面加了 0x40 字节的 head 。

在这里插入图片描述

head 结构体如下

// u-boot-2017.11.git\include\image.h
/*
 * Legacy format image header,
 * all data in network byte order (aka natural aka bigendian).
 */
typedef struct image_header {
	__be32		ih_magic;	/* Image Header Magic Number	*/
	__be32		ih_hcrc;	/* Image Header CRC Checksum	*/
	__be32		ih_time;	/* Image Creation Timestamp	*/
	__be32		ih_size;	/* Image Data Size		*/
	__be32		ih_load;	/* Data	 Load  Address		*/
	__be32		ih_ep;		/* Entry Point Address		*/
	__be32		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;
#define IH_MAGIC	0x27051956	/* Image Magic Number		*/
#define IH_NMLEN		32	/* Image Name Length		*/

iminfo 用于查看 image head

=> iminfo                                                

## Checking Image at 42000000 ...
   Legacy image found
   Image Name:   ARM OpenWrt Linux-5.4.150
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2997510 Bytes = 2.9 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
=> 

uImage 在 zImage 只是前面加了 0x40 字节的 head

因此:

=> tftp uImage
=> bootm 42000000
等效于
=> bootz 42000040

标签:__,区别,uImage,ih,image,zImage,be32,Image
来源: https://blog.csdn.net/agave7/article/details/121035781