Bootloader Startup Process

Source: Internet
Author: User

Bootloader startup process:

The Bootloader startup process is generally divided into two phases: stage1 and stage2. The following describes the two phases respectively.

Booloader in stage1 mainly completes the following tasks:

* Basic hardware initialization includes shielding all interrupts and setting the CPU speed and clock frequency. RAM initialization, LED initialization, and CPU Internal commands and data cache are disabled.

* Prepare a RAM space for loading stage2. Generally, Stage2 is loaded to the RAM space for execution at a faster execution speed. Therefore, an available RAM space range must be prepared for the stage2 loaded with Bootloader.

* Copy Stage2 to RAM. Here, we need to determine two points: the starting address and ending address of the executable image of 1 stage2 stored on the solid state storage device, and the starting address of 2 RAM space.

* Set the stack pointer SP to prepare the C language code for stage2 execution.

Stage2 mainly completes the following tasks:

* Use the assembly language to jump to the main entry function:

* Initialize the hardware devices to be used in this phase, including the initialization serial port and initialization timer. You can output some print information before initializing these devices.

* Checks the system's memory ing. The so-called memory address ing refers to specifying the address ranges allocated in the 4 GB address space for addressing the system's RAM unit.

* Load the kernel image and the root file system image, including the layout of the planned memory usage and copying data from Flash.

* Set the memory startup parameters.

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.