Introduction: Because centos7 using systemd init process changes is relatively large, here introduces the use of the boot process and centos5 6.
First a rough start on the flow chart
The first step: POST POST
POST is part of the BIOS functions, responsible for CPU, motherboard, memory and other hardware self-test work.
Step two: BootLoader boot loader
which is responsible for guiding the system starts, the current mainstream linux are using GRUB2 boot loader, which is responsible to find a kernel file, providing grub menu.
The third step: loading the kernel file
by the above kernel boot files to load into memory decompressor, a total of four steps:
1.探测可识别到的所有硬件设备。
2.加载硬件驱动程序(它是借助于ramdisk/ramfs加载的)
3.以只读的方式挂载文件系统
4.运行用户空间的第一个程序:/sbin/init
init initialization
1. init is acquired according to a run-level configuration file, and acquires the system initialization script file path (file init centos5 of / etc / inittab, centos6 split / etc / inittab files for multiple files).
2. Read the system initialization script /etc/rc.d/rc.sysinit, and follow the script content.
- Set the host name
- A banner
- Selinux and activate udev
- Mount the / etc / fstab file defined file system
- Detecting the root file system, and read-write file system remounting
- Set the system clock
- Activate the swap set
- Setting kernel parameters according to the /etc/sysctl.conf file
- Activate lvm equipment and software raid
- Load additional device drivers
- Cleanup operations
According to acquire the previous run level, run the script file /etc/rc.d/rc
/etc/rc.d/ there are several rc # .d directory (the # represents the number, also run level) of the file, its directory files in the file is connected only to the service script files in /etc/init.d/, according to the linked file in the default run level and /etc/rc#.d in / etc / inittab acquired startup and shutdown system services, must now also think of why start at different levels of service is not the same, why some start-up service, but some close links to files in the /etc/rc#.d/ beginning with K or S, K indicates the startup of service to be stopped, S for the boot to be started service, and the service script, there will be a priority,
K : K ## : ## execution order; the smaller the number, the first operation; the smaller the number of services, is generally dependent on the level of service
S : ## S : ## execution order; the smaller the number, the first run ; smaller number of services are often relied upon to service
In 2345 the level of /etc/rc#.d directory will have a rc.local file, link it to /etc/rc.d/rc.local, it is not a startup file, it is actually an ordinary file, if What do you want to boot operating you can write this file.
Step Four: Start the terminal program
here is what to look at in the end run level, if it is a graphical interface directly into the graphical interface.
Step five: the user logs on
to the system startup done here.
Because relatively large changes in version comparison system initialization process command
init command:
Set command boot comparison
again a system diagram start:
system start detailed map: