Linux Boot Process Analysis

Source: Internet
Author: User

1, the BIOS power-on self-test:

power-on self-test, testing hardware equipment. Then follow the CMOS sequence to search for a bootable device in the active state. It can be CD-ROM, floppy disk, USB, etc.

2. Load the master boot loader (MBR):

The Master Bootstrapper is a 512-byte image. Contains a bit of machine code and a small partition.

the task of the master bootstrapper is to find and load the secondary boot program on the hard disk partition. Finds the active partition through a partitioned table and reads the secondary boot loader that is in the active partition into memory to run .

3. Loading sub-boot Record program (GRUB)

The secondary boot loader loads the Linux kernel as long as it is loaded.

The boot loader runs in memory after the end of the previous phase. The Grub graphical interface will appear, allowing the user to choose what kernel to load.

4. Linux kernel Image:

after the user chooses which kernel to load, the secondary boot loader (GRUB) reads the Linux kernel image from the partition on which the/boot/resides, and then loads the kernel image into memory based on the information set in the/boot/grub.conf configuration file and give control over to the Linux kernel.

the Linux kernel gets control and starts doing its job.

(1), testing hardware

(2), unzip yourself and install the necessary drivers

(3) Initialization of file system-related virtual devices, LVM or RAID

(4, mount the root file system, hang under the root directory

(5), after completion, Linux in the process space to load the INIT program, the following turn to init work

5. Init process

Init is the initiator and controller of all processes, and all processes are derived from this.

after the init process gains control, it executes the/etc/rc.d/rc.sysinit script, setting the environment variables, the network, starting swap, checking and mounting the file system, and performing other initialization tasks based on the code inside.

at this point, Linux boot is complete.

Let's summarize a little bit:

The first is the BIOS power-on self-test, then load the main boot loader, the secondary boot loader, and finally the Linux kernel image, finished the control to the INIT process, to complete the initialization of the work.

What is a swap partition?

similar to virtual memory in Windows systems, use memory in swap when physical memory is not enough.

Linux Boot Process 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.