Linux boot process

Source: Internet
Author: User

Knowledge Points:

1, the BIOS and CMOS difference, these two is not a dongdong. Own Baidu Bar

2, the first sector of the hard disk MBR

3. The relationship between the Kernel,initrd,module and the three people. The author is also not quite understand what INITRD is to do, check the information to understand. Links at the bottom of this article, do not understand can learn under.

Startup process:
1. Load BIOS
Post power-on self-test, detects hardware information (including CPU, hard disk, memory, clock, device boot sequence information). The hardware is assigned an interrupt number (interrupt routine) and the hardware information is stored in the CMOS. Boot the hardware system based on the system boot sequence in CMOS (CD, USB, HDD)
2. Read MBR
The first step in the hardware boot process is to read the first sector of the hard disk. is the MBR.
Knowledge points for MBR:
The first sector of the No. 0 track on the hard disk is called the MBR, which is the master boot record, which is the main boot recording, it is 512 bytes in size, but it contains pre-boot information and partition table information. Can be divided into two parts: the first part is the boot (pre-boot) area, accounting for 446 bytes, the second part is divided into partitioned table (PARTITION pable), a total of 66 bytes, recording the partition information of the hard disk. One of the functions of the Preboot zone is to find the partition marked Active (active) and read the boot area of the active partition into memory.

When the system locates the MBR of the hard disk specified by the BIOS, it is copied to the physical memory where the 0X7C00 address resides. Actually the content that is copied to the physical memory is boot Loader, and specifically to your computer, that is LILO or grub.
3. Boot Loader (grub boot)
Boot Loader is a small program, grub, that runs before the operating system kernel runs. Through this small program, we can initialize the hardware device, set up a map of the memory space, so as to bring the system's hardware and software environment to a suitable state, in order to finally call the operating system kernel ready to do everything.
4. Load the kernel
Kernel-->initrd-->system Module
The purpose of the INITRD is to make the system aware of the CPU, memory, and other information after the kernel loading system, so as to allow

What hardware must be used to boot, if not related to the start, it can be lost to the next user-configured system module.
But when you need to put additional modules in the Initrd file (or take out the module), the answer is when the host has one more in the boot operation

The device that was first found before the system.
If the hard device can wait for the operating system to be used, it can be loaded directly into the module using Modprobe, without having to modify the Initrd file, because this will only increase the number of files to load at startup. Note, however, that the modules placed in the INITRD file must be modules compiled with the same version of kernel as the operating system, so that they can be used.
5. Load INITRD
The above explains
6. Init process
After the system has loaded the Linux kernel, kernel will start the system's first system process, the INIT process, in the final process. Then put the system's

Start handing over to the INIT process
7,/etc/inittab
The init process reads the/etc/inittab file and initializes the system based on the level of system operation in the file.
8,/etc/rc.d/rc.sysinit
Init executes the first script, mainly including setting path, setting network configuration (/etc/sysconfig/network), starting swap partition, setting/proc and so on.
9. Boot the kernel module system module
Depending on the/etc/modules.conf file or the file in the/ETC/MODULES.D directory to load the kernel module
10. Execute scripts with different runlevel
Depending on the runlevel, the system will run the appropriate script from RC0.D to RC6.D to perform the appropriate initialization and start the appropriate service
11, the implementation of/etc/rc.d/rc.local
The last script, user-definable boot program
12, login program, logon status

Enquiry Information:

http://www.ibm.com/developerworks/cn/linux/l-k26initrd/
Http://book.51cto.com/art/200903/117057.htm

This article is from the "1058223494" blog, please be sure to keep this source http://4708705.blog.51cto.com/4698705/1431120

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.