Boot Order of Linux systems

Source: Internet
Author: User

    • First step: Load the BIOS
    1. When you turn on the power of the IA computer, the computer first loads the BIOS information for the computer's motherboard, because it contains information about the CPU, the device boot sequence [the boot sequence of the USB drive to install the system], the memory information, the clock information, the PNP feature, and so on, after which the computer will read the hardware device in sequence.
    • Step two: Read MBR
    1. As we all know, the first sector of the No. 0 trackon the hard disk is called the MBR, that is, the master boot record, which is the master boot records, it is 512 bytes in size, although the place is not small, but it is stored in the pre-boot information, partition table information.
      When the system locates the MBR of the hard disk specified by the BIOS, it is copied to the physical memory where the 0X7C00 address resides. Actually the content that is copied to the physical memory is boot Loader, and specifically to your computer, that is LILO or grub.
    • Step Three: Boot Loader
    1. Boot Loader is a small program that runs before the operating system kernel runs. Through this small program, we can initialize the hardware device, set up a map of the memory space , so as to bring the system's hardware and software environment to a suitable state , in order to finally call the operating system kernel ready to do everything .
      Boot Loader is available in several ways, including Grub, Lilo, and Spfdisk, which are common loader.
      Let's take grub as an example to explain, after all, there are not many people with Lilo and Spfdisk.
      The system reads the GRUB configuration information in memory (typically menu.lst or grub.lst) and launches a different operating system according to this configuration information.
    • Fourth step: Load the kernel
    1. According to the path of the kernel image that the grub sets, the system reads the memory image, and the decompression operation, at this time, the screen generally will output "uncompressing Linux" prompt, when the decompression kernel completes, the screen output "OK, botting the kernel", that is, inside After the kernel is loaded, the system puts the extracted kernels into memory and calls the Start_kernel () function to start a series of initialization functions and initialize the various devices to complete the Linux core environment, so that the Linux kernel is initialized, Linux-based programs It should be working properly.
    • Fifth step: User layer init According to the Inittab file to set the operating level
    1. After the kernel is loaded, the first program to run is/sbin/init, which reads the/etc/inittab file and initializes the work based on the secondary file. /etc/inittab file on the die set Linux operating level, which is set as follows:
# Inittab is no longer used if using systemd.## ADDING CONFIGURATION here would have no EFFECT on YOUR system.## Ctrl-alt -delete is handled by/usr/lib/systemd/system/ctrl-alt-del.target## SYSTEMD uses ' targets ' instead of runlevels. By default, there is both main targets:## multi-user.target:analogous to RunLevel 3# graphical.target:analogous to Runle  Vel 5## to view current default target, run:# systemctl get-default## to set a default target, run:# systemctl Set-default target.target#

0: Turn off the machine

1: Single User

2: Multi-user mode with no network support

3: Multi-user mode with network support

4: Reserved, not used temporarily

Wait a minute

Different Linux distributions, not the same for start-up control

    • Sixth step:
    1. After setting the run level, Linux executes a user layer file that is the/etc/rc.d/rc.sysinit script, which will set the PATH, set the network configuration [/etc/sysconfig/network], start the swap partition, set/ Proc, wait.
    • Seventh Step: Boot the kernel module
    1. The kernel module is loaded according to the/etc/modules.conf file or the file in the/ETC/MODULES.D directory.
    • Eighth step: Execute a different run-level script
    1. Depending on the runlevel, the system will run the appropriate script from RC0.D to RC6.D to perform the appropriate initialization and start the appropriate service.
    • Nineth Step: Execute/etc/rc.d/rc.local
    1. If you open this file, there is a word, read it, you will be the role of this command at a glance:
      # This script is executed *after* all and the other init scripts.
      # can put your own initialization stuff in here if you don ' t
      # want to does the full Sys V style init stuff.
      Rc.local is the place where Linux is left to the user to personalize after all initialization work . You can put the things you want to set up and start up here.
    • Tenth step: Execute/bin/login program, enter login status
    1. is the Linux login interface, waiting for the user to enter the user name and password.
    • Note: The above can refer to the above CENTOS7 version, the relevant files are relatively easy to see.
    • Article Reference address: http://m.blog.chinaunix.net/uid-26495963-id-3066282.html?winzoom=1.375

Boot Order of Linux systems

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.