Linux boot guide process

Source: Internet
Author: User

Start Step 1 -- load BIOS
Turn on the computer power, the computer will first load BIOS information, BIOS contains CPU information, device startup sequence information, hard disk information, memory information, clock information and so on.

 

Start Step 2 -- read MBR
The first sector of the 0th magnetic track on the hard disk is called MBR, that is, Master Boot Record, that is, the Master Boot Record. Its size is 512 bytes, which stores the pre-start information and partition table information.
After the system finds the MBR of the hard disk specified by the bios, it will copy it to the physical memory where the 0 × 7c00 address is located. In fact, the content copied to the physical memory is the boot loader, and to your computer, it is LILO or grub.

 

Step 3 -- Boot Loader
Boot Loader is a small part of the boot loader that runs before the operating system kernel runs.Program. Through this small program, we can initialize hardware devices and build a map of memory space to bring the system's hardware and software environment to a suitable state, in order to make all preparations for the final call to the operating system kernel. There are several boot loaders, among which grub and lilo are common loaders. The System reads grub configuration information (generally menu. lst or grub. lst) in the memory and starts different operating systems according to the configuration information.

 

Step 4-load the kernel
Based on the path of the kernel image set by grub, the system reads the memory image and decompress it. At this time, the screen will usually output the "Uncompressing Linux" prompt. After the kernel is decompressed, the screen outputs "OK, booting the kernel ".
The system places the decompressed kernel in the memory, and calls the start_kernel () function to start a series of initialization functions and initialize various devices to complete the establishment of the Linux core environment. So far, the Linux kernel has been established, and Linux-based programs should be able to run normally.

 

Step 5 -- User-layer init sets the running level based on the inittab File
After the kernel is loaded, the first program to run is/sbin/init, which reads the/etc/inittab file and initializes the file based on the file.
The main function of the/etc/inittab file is to set the Linux running level in the form of ": ID: 5: initdefault:", which indicates that Linux needs to run on level 5. The Linux operating level is set as follows:

    • 0: Shutdown
    • 1: single-user mode
    • 2: multi-user mode without network support
    • 3: multi-user mode with network support
    • 4: reserved, not used
    • 5. Multi-user mode with network support and X-window support
    • 6. reboot the system.

 

Start step 6 -- execute RC. sysinit in the init process
After the running level is set, the first user-layer file executed by Linux is/etc/rc. d/RC. the sysinit script program sets path, network configuration (/etc/sysconfig/Network), swap partition, and Proc.

 

Step 7 -- start the kernel module
The kernel module is loaded Based on the/etc/modules. conf file or the file in the/etc/modules. d directory.

 

Start Step 8-execute script programs of different running levels
Depending on the running level, the system will run the corresponding script programs from rc0.d to rc6.d to complete the initialization and start the corresponding service.

 

Start Step 9 -- run/etc/rc. d/rc. Local
If you open this file, there is a sentence in it. After reading it, you will see the role of this command at a Glance:

 
# This script will be executed * after *All the other init scripts. # You can put your own initialization stuffInHereIfYou don't # WantDoThe full sys V style init stuff.

RC. Local is a place for users to personalize Linux after all initialization work. You can put what you want to set and start here.

 

Start step 10-run the/bin/login program and enter the logon status
At this point, the system has entered the waiting for the user to enter the username and password status, the user can use their own account to log on to the system \

 

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.