①
start the first step-load the BIOS
The BIOS is loaded first because the BIOS contains information about the CPU, device boot sequence information, hard disk information, memory information, clock information, PNP features, and so on.
②
start the second step-read MBR
the first sector of the No. 0 track on the hard disk is called the MBR, which is the master Boot Record,Master Boot Record, it'ssize is 512 bytes, which holds the pre-boot information and partition table information.
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.
③
start step three-run boot Loader
Boot Loader is a small program that runs before the operating system kernel runs.
With this applet, you can initialize the hardware device, set up a map of the memory space, and bring the system's hardware and software environment to a suitable state to prepare for the final call to the operating system kernel.
Boot Loader is available in several ways, including Grub, Lilo, and Spfdisk, which are common loader.
The system reads the GRUB configuration information in memory (typically menu.lst or grub.lst) and launches a different operating system according to this configuration information.
④
start step Fourth-load the kernel
Detecting Hardware
Based on the path of the kernel image set by grub, the system reads the memory image and does the decompression operation. At this point, the screen will generally output "uncompressing Linux" prompt. When the decompression core is complete, the screen output "OK, booting the kernel".
The system places the extracted kernel in memory and calls the Start_kernel () function to start a series of initialization functions and initialize the various devices (storage device, CPU, network card, sound card, etc.) to complete the establishment of the Linux core environment. At this point, the Linux kernel has been established, Linux-based programs should be able to run properly.
⑤
start the fifth step--
calling the init process
after the kernel is loaded, the first running program/sbin/init (where the PID of the Init process is 1, the process that is called first) , the Process reads the/etc/inittab file and initializes it based on this file. , The main role is to set the Linux operating level
It is set in the form ":Id:5:initdefault:", this indicates that Linux needs to run on level 5. Linux runs at the following levels:
0: Turn off the machine
1: Single-user mode
2: Multi-user mode with no network support
3: Multi-user mode with network support
4: Reserved, not used
5: Multi-user mode with network support with X-window support
6: Reboot the system, that is, restart
⑥
Start step Sixth-Execute
/etc/rc.d/
Rc.sysinit
After setting the operating level, the first user layer file executed by the Linux system is the/etc/rc.d/rc.sysinit program.
Functions: Including setting path, setting network configuration (/etc/sysconfig/network), starting swap partition, setting/proc, and so on.
⑦
start the eighth step--
Execute/ETC/RC.D/RC N &/etc/sysconfig
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.
⑧
start Nineth Step--Execute/etc/rc.d/rc.local
If you open this file, there is a word, read it, you will be the role of this command at a glance:
# This script is executed *after* all and the other init scripts.
# can put your own initialization stuff in here if you don ' t
# want to does the full Sys V style init stuff.
Rc.local is the place where Linux is left to the user to personalize after all initialization work. You can put the things you want to set up and start up here.
⑨
start Tenth Step--Execute/bin/login program, enter login status
At this time, the system has entered the waiting for the user input username and password, you can already use your own account login system.
7. Linux boot process