LinuxBoot Process
firmware
First boot step of power down: Start firmware firmware→post power-on self test
Check for hardware loading, such as keyboard, memory, etc.
Not related to the operating system. But different hardware platform, different firmware ;
When you add a new hard disk, the first step is to first enter the firmware mode to detect if the firmware has recognized the hard drive!
The most important role of firmware, read MBR -...
Bootstrap Program
Read mbr[master bootrecord, master boot recording ]
"MBR is located at 0 cylinders on disk,0 heads,1 sectors "
The purpose of this step is to read the data in the MBR [MBR holds three kinds of data ]:
1.boot Loader: Bootstrap program, self-launcher, in Linux :GRUB
2.Partition table: Disk partition tables
3.Magic Number: End Sign
/etc/grub.conf Brief Analysis:
kernel/vmlinuz-2.6.32-358.el6.i686 ro Root=uuid=6e428aef ... Used to specify the location of the kernel
2: Motherboard number
6: Minor version number, if this is the odd-numbered test version, the even is the official version
32: Last version number
As you can see, the most important role of GRUB is loaded into the kernel !
Attached-about the kernel:
1. is an executable file, is a file, not a bunch of files
The 2.z- representative is a compressed file , so at boot time, he will continue to unzip the file
Load Kernel
The kernel does only two things during this period:
1. Drive Hardware
2. startup process init:
after Init starts, read the configuration file inittaband execute the default runlevel to continue booting.
InUNIXIn the/linux system, Initthe first process that can exist,It'sPIDconstant for1UsuallyPIDis randomly assigned, butInitSpecial, can be ordered by:Ps-el| More View],linuxin the systemInitnominally, the parent process of all processes,AlthoughInitof thePIDconstant for1,but it also has to be responsible for a more advanced function:P IDto be0of theKernel Scheduler(Kernel Scheduler),thereby obtainingCPUTime.
The kernel Scheduler is responsible for: assigning system time, inter-process switching
init Read configuration file /etc/inittab
the runlevel of Linux,
0-halt: Shut down the machine
1- Single user mode, no graphical interface
"Repair mode, similar to the Safe mode with Windows "
2- Multi-user mode, but no graphical interface,2 and 3 are the most used Linux server mode
3- similar to 2, added NFS
4- not used, but can be customized by the user
5-Default runlevel:x11 Description is a graphical multi-user environment
6- restart
Run-level switching:
1. View the current RunLevel runlevel
N means that the runlevel has not been switched
S represents the running level before switching
The number represents the current run level
2. Switch the operating level
init [0123456Ss]
or telinit [0123456Ss]
Attach- Synchronize hardware and software clocks: "Two time should be consistent"
Hwclock display Hardware clock
Hwclock--help : The options for synchronizing clocks are described in detail
Change Time:
-S | --hctosys set the system time from the hardware clock
-W | --SYSTOHC set the hardware clock to the current system time
--set set the RTC to the time given with--date
e.g.
Date Mmddhhmm
Hwclock--set--date= "9/23/14 16:31:05"
Linux boot Process (second edition)