linux0.11 Core Fork Implementation analysis (not see, see very simple)

Source: Internet
Author: User
Tags spl

PCDUINO3 Support MMC boot, the official uboot is implemented with the SPL framework, because the internal SRAM space of 32K, we can write in this 32K space a complete and compact bootloader to complete the boot Linux The purpose of kernel.

We first introduce the next SPL framework, you can first look at the GNU Arm Assembly-(18) u-boot-using the NAND_SPL approach and the GNU Arm Assembly-(19) U-BOOT-NAND-SPL Start-up process analysis, nand_ SPL is also considered a pattern under the SPL framework.

When using NAND flash or MMC as the boot mode, we need to use the ROM inside the chip or other mechanism to load the firmware into the SRAM.

SPL is required at this time because SPL is short and suitable for 4K or even smaller SRAM environments. This time the boot process becomes, SPL directs the Uboot, and the system core is booted by Uboot.

In fact, as PcDuino3 SPL, it is possible to complete the direct boot kernel function if you do not need to use the additional powerful features provided by Uboot.

Here is the idea of writing bootloader:



Using the Read driver function of MMC to read the kernel image of the specified location into memory, and then follow the Linux requirements to complete the parameter list transfer, MMU and cache configuration, etc., you can complete the jump rotation.

The code for the last step is as follows:

void Boot_linux (void) {uart_printf ("boot linux\n"); void (*kernel_entry) (int zero, int arch, uint params); unsigned long R2 ; unsigned long Machid;setup_linux_param (0x40000000 + 0x100); Cleanup_before_linux (); kernel_entry = (void (*) (int, int, UINT)) 0x48000000;machid = 4283;r2= 0x40000100;kernel_entry (0, Machid, r2);}
This function completes the description of the kernel document documentation/arm/booting to booting arm Linux.

In this way, a bootloader of only 18K size can be used to guide the kernel.



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.