Linux Boot basic process

Source: Internet
Author: User

Linux Boot Sequence

1. CPU Initialization
The CPU itself initializes, takes instructions from a fixed location (0XFFFFFFF0) and executes, which is a jump instruction and jumps to the header of the BIOS code.

2. Load the BIOS
The BIOS is cured in a ROM on the motherboard, which first carries out a self-test (POST) and then loads the kernel boot program.
The post stage carries on the system hardware detection, including the memory detection, the system bus detection and so on.

3. Read MBR
After post, the BIOS reads the first sector (MBR) of the boot device, which is 512 bytes of information, and the MBR holds the starting part of the kernel boot, which the BIOS loads into memory and executes.
The main bootstrapper in the MBR contains 446-byte program code and a 64-byte partition table.

4. Load the system kernel
In the main bootstrapper program in the MBR, the partition table is scanned, the active partition is searched, the boot record of the active partition exists the secondary bootstrapper, this time the bootloader is loaded into memory and executed, it is responsible for loading the Linux kernel image and handing control over to the kernel.
The kernel image is stored in a compressed form and cannot be executed, and it is loaded into memory first after it is self-extracting.

5. Kernel initialization
The kernel starts the first program, the Init,init process is the origin of all processes in the system, and the process number is always 1. The init process generates the Getty process, the Getty process generates the login process, the login process generates the shell process, and we use the shell to generate other processes. The work of Init is done according to the file/etc/inittab file.

6. Execute/etc/rc.d/rc.sysinit Script
/etc/rc.d/rc.sysinit is the first script executed by Init that initializes the Linux system, including environment variables, network configuration, check file system, and so on.

7. Execute Run-level Script
The run-level of the system has been determined in/etc/inittab, and the corresponding command script/ETC/RC.D/RCX.D is executed.

8. Start other modules
such as memory management, hard disk Management and so on.

9. Execute/etc/rc.d/rc.local Script
/etc/rc.d/rc.local is the last script to initialize the system, where the user can add a system startup service, such as httpd.

10, the implementation of/bin/login
This program prompts the user to enter a user name and password, and then gives control to the shell process correctly.

11. Shell Startup

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux Boot basic process

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.