Question about the loading address and entry address during Uboot kernel boot

Source: Internet
Author: User

Question about the loading address and entry address during Uboot kernel boot

If you use mkimage to generate a kernel image file, a 64 bytes header will be added before the kernel for tag creation. The bootm command first checks whether the specified address xxx of bootm xxx is the same as the loading address specified by-.

If they are different, the 64 bytes header will be extracted from this address, analyzed, and then the kernel with the header removed will be copied to the load address specified by-a for running;
If they are the same, place them separately, but the entry address specified by-e will be pushed back to 64 bytes to skip the 64 bytes header.
Let's take a look at the two different situations:
1) mkimage-A arm-O linux-T kernel-C none-a 0x30008000-e 0x30008040-n linux-3.0.2-d zImage uImage

In this case, you can only download the uImage to the position of 0x30008000. Otherwise, it cannot be started from 0x30008040.

Cause: If you download a uImage (an image file with a header added) to a location different from the specified loading address, the above operations will be performed, copy the kernel with the header removed to the specified loading address. The loading address and the entry address must be the same because there is no image header, therefore, the entry address should also be 0x30008000, instead of adding 64 bytes. Therefore, you must consider the download address when creating the loading address and entry address in the image header. Otherwise, the startup will fail.
2) mkimage-A arm-O linux-T kernel-C none-a 30008000-e 30008000-n linux-3.0.2-d zImage uImage

In this case, the download address is random. As mentioned above, because the loading address and entry address are set to the same address. When downloading to any address, copy the kernel image without the header to the specified loading address, it can be started directly from the load address. But what if it is the same as the specified load address? That is, the following:

If the value of tftp is 0x30008000, it will not be moved because it is the same as the specified loading address. The kernel directly decompress it from the specified loading address, but because the specified entry address is also 0x30008000, in this case, the kernel will not start normally, so you have to push the entry address back to 64 bytes and start from 0x30008040.

Therefore, the configuration and entry address have the following two situations:
1) mkimage-n 'linux '-A arm-O linux-T kernel-C none-a 0x30008000-e 0x30008000-d zImage uImage

The load address and entry address are the same.

Tftp 0x31000000 uImage

Bootm 0x31000000

Can be arbitrarily put (except in the case of the same loading address ).

2) mkimage-n 'linux '-A arm-O linux-T kernel-C none-a 0x30008000-e 0x30008040-d zImage uImage

The entry address is 64 bytes after the loading address

Tftp 0x30008000 uImage

Bootm 0x30008000

Must be on the specified load address.

Analyze the make xxx_config process in uboot

U-Boot source code

This article permanently updates link: https://www.bkjia.com/Linux/2018-02/151108.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.