Home>

Centos 6 startup process detailed

1. post (power on selt test):

Press the power button first to check whether the hardware device can operate normally.Such as:cpu, memory, hard disk and other hardware devices.Of course, the post is not detected by the hardware (the hardware will not be!), But it is completed by a software,This software is the basic input output system (bios)It is installed on the cmos chip. When the power is turned on, the cmos is powered on, and then the bios program is started. The bios will read the hardware and check whether it can run normally according to the hardware information recorded on the cmosAfter the hardware device is initialized.

2. mbr (master boot record) master boot partition:

After the BIOS initializes the hardware, it will read the mbr through the int13 interrupt function of the hardware, and read the boot loader in the mbr. The boot loader is a software.It has a menu function,Directly load kernel information and related control transformations,mbr is only 512 bytes, of which the first 446 bytes store the boot loader and 46 bytes store the partition table information.2bytes is the partition flag.446 bytes is not enough to install the boot loader. In fact, 446 bytes before mbr is just the smallest main program with the boot loader installed.That is, stage1, because the boot loader is executed in three stages:stage1, stage1.5, and stage2.stage1.5 is stored in the subsequent sector of mbr,It is mainly used to interact with the file system of the partition where stage2 is located.stage2 loads all files, configuration files and environment parameter information in the hard disk partition/boot directory.

3. Kernel, initrd/initramfs:

/boot directory contains vmlinuz, initramfs and other kernel related files,After the boot loader reads all files, configuration files, and environment parameter information in the/boot directory,Will decompress and load the kernel into memory,Start testing based on the functions provided by the kernel,Load each device,This test is different from the bios self-test,So far,Subsequent work is done by the kernel (because the boot loader has loaded vmlinuz and initramfs into memory), at this time the kernel has not loaded the disk.Because there is no disk driver yet,The kernel passes the virtual file system in the/boot directory.That is, initramfs, which simulates a rootfs (root file system), and loads the core modules required during the startup process.After loading, release the rootfs (root file system), and mount the real root file system as read-only,Begin the normal startup process.

4, init:

User space first execution program,After the kernel, hardware and driver are loaded,The kernel will execute the first execution program/sbin/init in user space. The main function of the init program is to prepare the software running environment.Including the system host name,Network Configuration,File system format and other services configuration.

init configuration file:

centos 6:adopts the upstart method, which is characterized in that the communication between the daemons depends on d-bus, so it can basically achieve similar parallel startup.Configuration files:/etc/inittab, /etc/init/*.conf

  • Previous Python shopping program ideas and code
  • Next Multi-level nested repeating problem with ng-repeat and ul li in Angular