Article Title: how to create an image uImage in linux uboot. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
In fact, the uboot boot image mainly adds a tag 0x40 before the original zImage to tell uboot about Kernel startup.
There are commands and rules in line 62 of arch/arm/boot/Makefile:
Quiet_pai_uimage = UIMAGE $ @
Export _uimage = $ (CONFIG_SHELL) $ (MKIMAGE)-A arm-O linux-T kernel \
-C none-a $ (ZRELADDR)-e $ (ZRELADDR )\
-N'linux-$ (KERNELRELEASE) '-d $
$ (Obj)/uImage: $ (obj)/zImage FORCE
$ (Call if_changed, uimage)
@ Echo 'image $ @ is ready'
In fact, the uboot boot image mainly adds a tag 0x40 before the original zImage to tell uboot about Kernel startup. The command for this rule is the definition of lines 63 to 65
-A: Specify the cpu architecture
-O specifies the Operating System
-T specifies the image type, such as standalone, kernel, ramdisk, multi, firmware, script, and filesystem.
-C specifies the image compression method, such as none (not compressed), gzip, and bzip2. UImage compression is not performed here
-A specifies the image loading address in the memory. When the image is downloaded to the memory, the image must be downloaded according to the address value specified by this parameter when the image is created using MKIMAGE.
-E specifies the image running entry point address, which is the value specified by-a plus 0x40 (because there is a MKIMAGE header with 0x40 bytes added)
-N indicates the image name.
-D specifies the source file for image creation.
In the preceding command, ZRELADDR is defined in 24 rows.
ZRELADDR: = $ (zreladdr-y) in row 17th has
Include $ (srctree)/$ (MACHINE)/Makefile. boot
In Makefile. boot
Zreladdr-y: = 0x30008000
So ZRELADDR: = 0x30008000