CentOS system Start-up process

Source: Internet
Author: User


CentOS system Start-up process


START Process: POST--Bootsequence (BIOS)--Bootloader (MBR)->kernel (RAMDisk)--Rootfs (switch_root)-- /sbin/init (/etc/inittab,/etc/init/*.conf,/usr/lib/systemd/system/)--default RunLevel, system initialization, shutdown and startup services, boot terminal (graphics terminal)


Graphic:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/41/1D/wKiom1PQxc6SML8nAAFcDmK4XC0648.jpg "width=" 886 " height= "482" alt= "wkiom1pqxc6sml8naafcdmk4xc0648.jpg"/>(1) POST

The first step of the first power-on self-test, the computer itself will not execute the program, which will be loaded into a program, it will be automatically at boot time to map a program in a RAM to the address space can be addressed by the CPU, and can let the CPU can execute the instructions, and these instructions are complete system detection, after the detection is complete, BIOS is performed when all hardware or basic core hardware is not a problem.

(2) Bios

According to the program startup process set in the BIOS to find the MBR on the corresponding device, according to the boot sequence (boot Sequence), according to the boot sequence to find the corresponding storage device MBR, if the MBR exists, read the bootloader on the MBR, Bootloader is a program, the early MBR total 512 bytes, but it left bootloader space size is 446 bytes, in the bootloader configuration of all the boot operating system of the kernel location, so the BIOS after loading memory, When it is implemented to transfer control process or control permissions to bootloader, Bootloader takes control of the whole system and then reads the kernel of the corresponding operating system according to the user's choice.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7E/13/wKiom1b2fHLj0Ou-AAFUo5VjAZY297.jpg "title=" Bios.jpg "alt=" Wkiom1b2fhlj0ou-aafuo5vjazy297.jpg "/>

Grub:grand Unified Bootloader

Grub 0.x:grub Legacy

Grub 1.X:GRUB2 Grub Legacy:

Stage1:mbr

STAGE1_5:MBR after the sector, so that the stage1 in the bootloader can identify the Stage2 partition on the file system;

Stage2: Disk Partitioning (/boot/grub/) Profile:/boot/grub/grub.conf <--/etc/grub.confstage2 and kernels are typically placed on a basic disk partition;

/boot/grub/grub.conf:

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/7E/13/wKiom1b2eAaDFenVAAGnb-53uAg525.jpg "style=" float: none; "title=" grub.jpg "alt=" Wkiom1b2eaadfenvaagnb-53uag525.jpg "/>

(3) The third step: the kernel is loaded into the appropriate location in the kernel, decompression and completion of the kernel initialization, bootloader will transfer control permissions to the kernel.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/13/wKiom1b2eCPxqirGAACTeRptGwA534.jpg "title=" GRU is B.jpg "style=" Float:none; alt= "Wkiom1b2ecpxqirgaacterptgwa534.jpg"/>

(4) The fourth step: if the kernel accesses the root filesystem device needs a driver, and the kernel does not, you need to go to the root file to find the driver, but the file system itself is not mounted, so to access the root file system must first find the driver, to access the driver to find the root file system first, This presents a problem, with the help of INITRD to provide the kernel with the basic drivers needed to access the real root filesystem. So INITRD is an auxiliary, transitional middle layer. It makes it possible to connect the kernel to a real root filesystem, and it doesn't make any sense when the connection is complete.

Linux Kernel:

CentOS Boot Process:post--> Bootloader (BIOS, MBR)--Kernel (INITRD)--Rootfs-->switch_root-/sbin/init

Kernel Design System: Single core, micro core

Linux: Single-core design, but fully learn the advantages of micro-kernel system design, the introduction of the kernel of the modular mechanism;

Components of the kernel:

Kernel: Kernel core, generally bzimage, usually located in the/boot directory, named vmlinuz-version-release;

Kernel object: Kernel objects, kernel modules, typically placed in /lib/modules/version-release/

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7E/0F/wKioL1b2ePXyUAzEAACWXUpf5tY823.jpg "title=" Lsboot.jpg "style=" Float:none; "alt=" wkiol1b2epxyuazeaacwxupf5ty823.jpg "/>

(5) The fifth step: The init process is executed, and the INIT program itself is/etc/inittab (while on CentOS 6 init is not the traditional init, but the upstart, and upstart's configuration file in/etc/inittab and/etc All Files under/init/.*conf

1. Loading kernel According to the settings of boot loader will invoke the INIT process actively, and Init will get run-level information

2. Init executes the/etc/rc.d/rc.sysinit file to prepare the operating environment for software execution (e.g. network, time zone, etc.)

3. init execution of Run-level for each service (script mode)

4. init execute/etc/rc.d/rc.local file

5. Init executes the terminal simulator Mingetty to start the login process, and finally waits for the user to log in


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7E/13/wKiom1b2eFfAeVdUAAJEhgnedtU729.jpg "title=" Init.jpg "style=" Float:none; "alt=" wkiom1b2effaevduaajehgnedtu729.jpg "/>


Character Interface:


650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/7E/13/wKiom1b2d9_SXFT9AABApAL10KU941.jpg "title=" 3.jpg " Style= "Float:none;" alt= "wkiom1b2d9_sxft9aabapal10ku941.jpg"/>


Graphical interface:


650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/7E/0F/wKioL1b2eH6RoIFGAABbaWDBhs8157.jpg "title=" 5.jpg " Style= "Float:none;" alt= "wkiol1b2eh6roifgaabbawdbhs8157.jpg"/>


CentOS system Start-up process

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.