Understanding the several address parameters involved in uBoot and Linux kernel
*************** **********************************
arch/arm/Makefile
//The kernel runs the virtual address TEXTADDR = 0xC0008000
********************************** ***************
arch/arm/boot/Makefile
//The kernel load address ZRELADDR = 0x20008000
** ***********************************************
arch/arm/boot/compressed/Makefile
//Self-extracting program address ZTEXTADDR = 0x00000000
(linux-2.4.19-rmk7 kernel self-extracting function gunzip is located in
/lib/inflate.c, which is the gzip-1.0.3 version, and the files compressed by the gzip
function on the PC cannot be recognized by the gzip-1.0.3 version of gunzip, so Linux-2.4.19-rmk7
The kernel self-extracting function can not be used. The default value ZTEXTADDR= 0x00000000
means not used. (Can only be loaded by uBoot's gunzip decompression)
)
**************************************** *******
//uImage storage address = 0x21000000
********* **************************************
mkimage -A arm -O Linux -C gzip -a 0x20008000 -e 0x20008000 -d linux.bin.gz uImage
-A:CPU type
-O:OS
-C: compression method used
-a: kernel load address
-e: kernel entry address
*********** ************************************
uBoot's do_bootm(cmd_tbl_t *cmdtp, Int flag, int argc, char *argv[]);
The function will check the header of the mkimage formatted uImage data stored at address 0x21000000
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_t Ype; /* Image Type */
uint8_t ih_comp; /* Compression Type */
uint8_t ih_name[IH_NMLEN]; /* Image Name */
}image_header_t;
(ih_ep value is 0x20008000, ih_load value is 0x20008000)
If the header fields and crc are legal, then do_bootm will call the following gunzip decompression function pair
0x21000000 + The compressed kernel at the addressof(image_header_t) address is decompressed:
gunzip((void*)ntohl(hdr->ih_load),0x400000,data,(int*)&len);
1. Hdr->ih_load is the output data address 0x20008000
2.0x400000 for the gunzip decompressed output data upper limit -4M
3. Data is the input data address data=0x21000000 +sizeof(image_header_t);
4. Len is the input data length len = ntohl(hdr->ih_size);
The actual size of the decompressed data will be stored after decompression is completed
The compressed Linux kernel file uImage is decompressed via gunzip After the function, pass
do_bootm_linux (cmdtp, flag, argc, argv, addr, len_ptr, verify);
function to pass the five parameters required for kernel operation to the Linux kernel
kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))hdr->ih_ep ;
1. Hdr->ih_ep is 0x20008000
/*
* Linux Kernel Parameters:
* r3: ptr to board info data
* r4: initrd_start Or 0 if no initrd
* r5: initrd_end - unused if r4 is 0
* r6: Start of command line string
* r7: End of command line string< Br>
*/
(*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
This completes the transfer of 5 parameters required for Linux system startup. The work of uBoot is over, and Linux will be officially running at address 0x20008000.
#ls -l | Wc -l Note: The total usage also takes 1 row, so the statistics are 14 instead of 13 Other
1. In STM32, there are five clock sources, HSI, HSE, LSI, LSE, PLL. 1, HSI is a high-speed internal
Under Linux, the IDE device is named after hd. Generally, there are two IDE interf
view mysql default encoding format show variables like “character%”; If the reality-bash
Basic tutorial on the installation and use of SNMP under centos
Open vpn installation diagram detailed tutorial
Xwindow language selection under the Linux operating system
Libsasl2.so.2 can not be found, apache can not start
Linux operating system sound card driver installation and configuration
Centos view port usage and enable port command
Fedora install virtualbox kernel error
Install the unmount file system
Nginx self-starting file running error
Windows8.1/10 upgrade patch causes Windows Explorer to stop responding
Solve the problem that Microsoft Pinyin 2007 can't input under XP
Win7 system can not open the event viewer how to deal with?
Win8 Start Menu Start Menu X 5.25
Win7 takes up too much space. Simple for C-slimming
Modify window background and font color in Vista and XP
How to let the computer of win7 system record its last open time
How to receive the TMP and CSD files open
How to check the password saved automatically in the webpage of win7 system browser
What should I do if the Win7 computer has an unrecognized network?