Linux Kernel loading process __linux

Source: Internet
Author: User

The Linux kernel load process is approximate:


The first step-loading the BIOS

People with a slight computer base should have heard the BIOS (basic Input/output System), which can be viewed as software that is recorded in ROM. It is also clear how the system will perform the program in the BIOS, how this function is achieved. Look at the picture below:



This is the early DOS system memory space allocation, you can borrow to understand. In the location of the 0xf0000 (64k high memory), there is a ROM BIOS area where we can understand that the BIOS data in ROM is mapped to the RAM address space (actually the operating system's storage space is not just the usual memory, but also IO space, memory, etc.). When power is added, the system points the IP to the BIOS data area, completes the BIOS power self-test, enumerates and initializes the local device.

Start the second step-read the No. 0 cylinder 0 track on the MBR hard drive the first sector is called the MBR, which is the master boot record, which is 512 bytes, but not small, but it holds the pre-boot information and the partition table information. After the system finds the MBR of the hard disk through the BIOS program, it copies it to the physical memory of the 0X7C00 address and jumps to it to continue execution. Actually copied to the physical memory content is the boot Loader, and specifically to your computer, that is LILO or grub.

Start step three--boot Loader
The Boot Loader is a small program that runs before the operating system kernel runs. Through this small program, we can initialize the hardware device, set up a map of memory space, so that the system's hardware and software environment to a suitable state, so as to finally call the operating system kernel to do everything ready.
There are several types of Boot loader, of which grub, Lilo, and spfdisk are common loader.
We take grub for example, the system reads the GRUB configuration information in memory (typically menu.lst or grub.lst) and starts a different operating system according to this configuration information.

Starting step fourth-loading the kernel
Based on the path of the kernel image that is set by grub, the system reads the memory image and does a decompression operation. At this point, the screen will generally output the "uncompressing Linux" prompts. When the decompression kernel is complete, the screen output "OK, booting the kernel".
The system will load the extracted kernel into memory and call the Start_kernel () function to start a series of initialization functions and initialize various devices to complete the Linux core environment. At this point, the Linux kernel has been established, Linux based programs should be able to run properly.

Start Step Fifth-perform init and other work.

When the kernel is loaded, the first running program is/sbin/init, which reads the/etc/inittab file and initializes it based on this file.

After a series of operations, the system entered the login interface.


The above is the Linux system kernel load, the general process, and then do a specific analysis.

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.