Concepts and functions of Boot Loader

Source: Internet
Author: User
1. structure and distribution of Embedded Linux software


In general, the software in the embedded Linux system is mainly divided into the following parts:
(1) Boot Loader:
It includes the fixed Boot Code and boot loader in the internal ROM.
While
This Internal Curing Rom is fixed by the manufacturer during chip production. Its function is basically to guide boot.
Loader. Some chips are complicated. For example, omap3 has many startup methods when there is no code in Flash: USB, UART, or Ethernet. While s3c24x0 is very
Simple: Only norboot and nandboot.
(2) Linux kernel and drivers.
(3) file system.

Including the root file system and the file system (ext4, ubi, cramfs, etc.) built on the flash memory device ). It is a carrier that provides various configuration files of the management system and a good running environment for the system to execute user applications.
(4) applications.
Custom applications are stored in the file system.
In flash memory, their general distribution is as follows: But the above is only the distribution in most cases. There are also some possibilities that the root file system is initramfs and is compressed to the kernel image together, or there is no bootloader parameter zone, and so on. 2. Why does bootloader exist in Embedded Linux?


In addition to the proper location of the primary storage, the Linux kernel startup and running of the kernel image must meet certain requirements:


1. CPU register settings: R0 = 0;
R1 = machine ID (that is, machine type number, defined in Linux/ARCH/ARM/tools/Mach-types );
R2 = start base address of the kernel startup parameter in Ram;
2. CPU mode: Interruption must be prohibited (irqs and fiqs );
The CPU must be in SVC mode;
3. cache and MMU settings: MMU must be disabled;
Command cache can be enabled or disabled;
Data Cache must be disabled;
However, when the CPU is just powered on and started, it is generally not even configured in the memory controller, and the program cannot be run in the memory, or even in the Linux Kernel startup environment. For initial
CPU and other peripherals, so that the Linux kernel can run in the main memory of the system, and make the system meet the necessary conditions for Linux kernel startup, there must be a program running before the kernel, he is
The boot loader ).
While boot
Loader is not required by Linux, and is available to almost all devices running the operating system. The Bois of our PC is boot.
Part of Loader (only early boot, followed by various boot loaders in External Storage). For Linux PC, Boot Loader =
BiOS + grub/Lilo. 3. Functions and selection of Boot Loader



As described above, we can know: boot
Loader is a small program that runs before the operating system kernel runs. Through this small program, we can initialize the hardware device, so as to bring the system's hardware and software environment to a suitable state, in order
Finally, call the operating system kernel to prepare the correct environment, and load the kernel image from other places (flash, Ethernet, UART) and jump to the entry address.
Because bootloader runs directly
As hardware, she relies heavily on hardware, and has different options for the embedded world, depending on the operating system. For s3c24x0, if it is a boot
Linux: Generally, Vivi or U-boot of the denx Software Engineering Center designed by mizi in South Korea is used.
Ce, select eboot. If you are developing lart under the strongarm architecture, you can use
The Blob (Boot Loader object) released by mouw ). If you want to guide the ECOS system, you can use Redboot developed by RedHat.

Therefore, it is almost impossible to establish a general bootloader in the embedded world, but it is possible to make a boot
The loader Code supports a variety of architectures and operating systems and makes it easy for her to port. U-boot is an outstanding representative that supports multiple operating systems on multiple platforms. That's why I like to use U-
The reason for boot is that if you are familiar with U-boot during the development of S3C2440, you can quickly complete the U-Boot porting on this platform when you switch to another platform, and U-boot-
The code structure of boot becomes more and more reasonable, and it is very easy to add new functions. It is worth mentioning that G-BIOS in maxwit, an open-source project in China, is also a good open-source Bootloader and supports multiple platforms.

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.