Linux boot process, module management and Loader

Source: Internet
Author: User

1. System Boot Process:

1) Load BIOS hardware information and self-test, and obtain the first bootable device according to the setting

2) Read and execute the boot Loader (i.e. Grub,spfdisk, etc.) of the MBR in the first boot device

3) Load Kernel,kernerl will start to detect hardware information and load driver based on boot loader settings

4) After the hardware driver is successful, kernel will actively call the INIT program. And Init will get run-level information.

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

6) Init execution of each service Run-level (script mode)

7) Init execution/etc/rc.d/rc.local file

8) Init execution terminal emulator Mingtty to start login, and finally wait for the user to log in.

2.BIOS, boot self-test, MBR and boot loader

1) Start the whole system first you have to let the system load the BIOS, and through the BIOS program to load the CMOS information, and through the CMOS set of values to obtain the host hardware configuration. After obtaining this information, the BIOS will also self-test, then start to perform hardware detection initialization, and set the PNP (Plug and play, Plug and Play device), after the definition of the device sequence can be turned on, then the device will begin to read the data (MBR related task start).

2) the Boot Manager (boot Loader) is installed in the first sector (sector) of the boot device, which is the MBR (Master boot record, the main boot record area) We have been talking about. The BIOS reads the MBR through the channel INT 13.

3) The main function of loader is to identify the file format of the operating system and load the core into the main memory to execute. Each of these file systems (filesystem or partition) retains a single boot sector that provides the operating system installation boot loader, and usually the operating system installs a copy of loader to the boot sector of the file system on which his root directory resides. Linux system installation, you can choose to install the boot loader to the MBR, or you can choose not to install. When Windows is installed, it is pre-programmed to install both the MBR and boot sector a boot loader program. Therefore, when installing multiple operating systems, your MBR is often covered by the boot loader of different operating systems.

4) The main functions of boot loader are:

Menu: Users can choose different boot items, which is also an important function of multi-boot

Load Core Archives: Direct point to the bootable program section to start the operating system

Transfer other loader: The power-on management function is transferred to other loader.

5) Windows Loader presets do not have the control transfer feature, so you cannot use Windows loader to load Linux loader, which is why you must install Windows in Linux first.

3. Load core detection hardware and Initrd:boot loader start reading the core, Linux will compress the core into the main memory, and take advantage of the core functions, start testing and driving the various peripheral devices, including storage devices, CPU, network card, sound card and so on. At this point, Linux will re-detect the hardware with its own functionality, not necessarily the hardware information detected by the BIOS. That is, the core is only beginning to take over the BIOS after the work. The core is generally placed in the/boot/vmlinuz

4.Linux can dynamically load the core modules (which can be understood as drivers), which are placed within the/lib/modules/directory. Because it is placed in the root directory of the disk (/lib cannot be placed in a different partition), the core must mount the root directory during boot so that the core module can be read to provide the ability to load the driver. And to worry about affecting the file system in the disk, the root directory is mounted in read-only mode during boot.

5. Virtual file system is generally used by the file name/boot/inird, the file can be loaded into memory through the boot loader, then the file will be compressed and in memory to simulate a root directory, and this simulation in the memory of the file system can provide an executable program, Through this program to load the boot process of the most needed core modules, usually these modules are USB,RAID,LVM,SCSI and other file system and disk interface driver, and so on, will help the core re-call/sbin/init to start the subsequent normal boot process.

6. First program init and configuration Files/etc/inittab and RunLevel: After the core load, after the hardware detection and driver load, at this time your host hardware should be ready, when the core will actively call the first program, that is/sbin/init, Therefore, the PID of the program is 1, the main function of the program is to prepare the software execution environment including the host name of the system, network settings, language processing, file system format and other system services start. And all the actions will be through the init configuration file/etc/init configuration file, that is,/etc/inittab to plan, and inittab within a very important setting project, that is the default runlevel (boot execution level). About the operating level tree reference: http://7613577.blog.51cto.com/7603577/1587174

7./etc/inittab Interpretation:

Initdefault: Preset runlevel setting value

Sysinit: Initialize the action item on behalf of the system

Ctraltdel: For [Ctr]+[alt]+[del] Three keys can restart the setting

Wait: The command item set in the following field must be executed to continue the other actions below

Respawn: Instructions that represent the following fields can be regenerated indefinitely (restarted). Eg:tty1 Mingetty generated by the login screen, at the end of the logout, the system will open a new login screen to wait for the next login.

8.init processing Process: The contents of the file is set to a line from the top down processing, specifically:

1) First get runlevel that is the default boot level.

2) system initialization using/etc/rc.d/rc.sysinit

3) Execute runlevel corresponding line, eg:runlevel=5, then execute L5:5:WAIT:/ETC/RC.D/RC 5

4) Set [Ctr]+[alt]+[del] This set of key combination function

5) Set up two mechanisms of PF,PR system

6) Start the Mingetty six terminals (TTY1~TTY6)

7) finally start the graphical interface with/etc/x11/perfdm-nodaemon


This article is from "Tiger Brother's Blog" blog, please be sure to keep this source http://7613577.blog.51cto.com/7603577/1602691

Linux boot process, module management and Loader

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.