Specifies the kernel boot address

Source: Internet
Author: User

Bootloaderand Kernel decompression
Bootloaderload the kernel into memory, set some registers, and then turn control over to the kernel, which shuts down the MMU function during the process . Typically, the kernel is stored in a compressed manner, such as Zimage, where two methods of decompression are available:
Use the kernel self-extracting program.
Arch/arm/boot/compressed/head. S or arch/arm/boot/compressed/head-xxxxx. S
Arch/arm/boot/compressed/misc.c
Add the decompression function to the bootloader.
With This method, the kernel does not need to have a self-extracting function and uses the decompression program in Bootloader instead of the kernel self-extracting program. Its working process is similar to the kernel self-extracting process:Bootloader compresses the kernel into memory and jumps to the kernel entrance to start execution.

2.Introduction to several kernel boot methods
XIP (EXECUTE in place)is to start a run directly from the location where the code is stored.
2.1 Non-compressed, non- XIP
non- XIP means that the code needs to be relocated before it is run. This type of kernel is stored in Flash in a non-compressed manner , and is run by Bootloader when it is loaded into memory at startup.
2.2non-compressed,XIP
This type of kernel is stored in non-compressed format in Rom/flash , does not need to be loaded into memory to run,Bootloader directly to its storage address execution. The work of Data segment replication and BSS Chingqing Zero is done by the kernel itself. This startup method is often used in systems with limited memory space, and the program is relatively slow to run in Rom/flash.
2.3 RAMself-extracting
The compressed kernel consists of the first self-extracting code and the compressed kernel data, and the kernel can only run in a non-XIP manner due to its compressed format . The RAM self-extracting process is as follows: The compression kernel is stored in Rom/flash, the Bootloader is loaded into the in-memory temporary space after startup, and then jumps to the compressed kernel entry address Ztextaddrexecute self-extracting code, the kernel is extracted to the final destination addressZreladdrand then run. The temporary space occupied by the compressed kernel is then recycled by Linux. The kernel in this way is more common in embedded products.
2.4 ROM self-extracting
decompression code can also be xiprom/flashrom The self-extracting process is as follows: The compression core is stored in rom/flash bootloader jump directly to its storage address ztextaddr execute its self-extracting code to extract the compressed kernel to the final destination address zreladdrrom The self-extracting kernel is slow to decompress and does not save memory space.

3.  kernel boot address OK Span lang= "en-us" >
head.s/head-xxx.s Get the kernel decompression after the first address zrealaddrzrealaddrzrealaddr address, Start the real kernel boot.

arch/armnommu/boot/makefile, definition Zreladdr and  ztextaddr. ztextaddr is the starting address of the self-extracting code, if you boot the kernel from memory, set to 0, if you start from rom/flash, Then set  ztextaddr to the corresponding value. zreladdr
arch/armnommu/boot/compressed/ Vmlinux.ld, load_addr and text_ START.
arch/armnommu/boot/compressed /makefile, 
sedflags = s/text_start/$ (ztextaddr)/;s/load_addr/$ (zreladdr)/;
so text_start = Ztextaddr, LOAD_ADDR = zreladdr.


decompress_kernel function head. S/head-xxx.s kernel start address after decompression is next to  kernel Image If it is ,beq Call_kernel, perform the decompression kernel. If the kernel start address after decompression is not immediately next to kernel image, then relocate is executed, Copy it to the place immediately following kernel image

Bootloader Decompression Method
Bootloader Place the extracted kernel in the textaddr position of the memory , then jump to the textaddr position and start the kernel boot.
Arch/armnommu/makefile , the general settings textaddr for page_off+0x8000, such as defined as 0x00008000, 0xc0008000 and so on.
Arch/armnommu/vmlinux.lds , citing textaddr .

Specify the kernel boot address (GO)

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.