System startup process
BIOS
We call it the basic input and output system, which is usually stored in the BIOS chip on the motherboard, which is responsible for checking the hardware and finding the bootable device, and can set the boot order;
If a device is bootable, then the last two bytes of the first sector 512 bytes are 55AA;
MBR
Boot code is executed after the BIOS has found a bootable device
The boot code is the first 446 bytes of the primary sector; function: Load a more complex bootstrapper
GRUB
The Real Boot program
Grub is now the mainstream boot program for Linux use
Can be used to boot almost all operating systems
Grub related files are saved in the/boot/grub directory
Grub configuration File/boot/grub/grub.conf
Entering the Grub directory, you can see the stage1,stage2 and the file ending with stage1_5, meaning that:
The stage1 is the MBR, and it's exactly 512 bytes in size.
Stage1_5 to add support for a file system
Stage2 The Real Boot program
Load Order: Stage1-->stage1_5-->stage2
Grub Configuration File
Default takes the first set of boot configurations (such as a red box is a standard system configuration, and multiple configurations if there are multiple systems)
Timeout boot wait time
Splashimage Boot Program Background interface
Hiddenmenu Hide Menu Bar
Title Name
The root (h0,0) operating system exists on the first partition of the first hard drive
Kernel Kernel configuration
INITRD Loading the driver module
. The MBR boot code will be responsible for locating and loading the Linux kernel
Linux kernel:
Kernel module packaging files are also typically loaded:
Linux system boot dynamically loads the driver module, thus streamlining the system core, making the boot faster and more efficient
Command dmesg view this boot kernel output, or/VAR/LOG/DMESG file view
Init
The first process in a Linux system is the parent process for all processes
Call/etc/rc.d/rc.sysinit is responsible for initializing the system, mounting the file system, and starting the corresponding service based on the RunLevel
Linux Run Level
The default run level can be configured via /etc/inittab :
Each level of the corresponding start-up service is saved in /etc/rc.d/rc[0123456].d ;
The command runlevel can display the previous runlevel and the current runlevel;
Command init can be used to change the current run level.
Linux system Boot