0923------APUE Learning Notes----------Linux system start-up process

Source: Internet
Author: User

Objective:

The day before yesterday when watching Apue suddenly thought of this problem, so give yourself a science of Linux system Start process.

1. Load the BIOS
After powering on, the computer first loads the BIOS (that is, the basic Input-output System, which is cured in a ROM chip on the motherboard, including the most basic input and output programs, System setup procedures, boot hardware self-test programs, and system bootstrap programs, etc.). Perform a hardware self test (that is, power on auto test) to check whether the computer hardware meets the basic conditions of the operation (for non-critical failures, some sound will be issued, a serious failure will be directly exited), after the hardware self-test is completed, the BIOS is based on CMOS (this is where the BIOS system settings are saved, Information that includes parts such as CPUs, soft hard drives, and keyboards) to locate the active and bootable device, usually the hard disk, in the boot order information that is saved.

2. Load Boot Loader
The BIOS gives control to the device with the highest priority, at which point the computer reads the first sector of the device, which is called the Master boot Record, the MBR (that is, the master boot recording), and the content of the sector is called the boot loader boot Loader, which is 512 bytes in size. Boot Loader is used to boot different operating systems, different operating system boot Loader are different, in the case of grub in Ubuntu, the system reads the GRUB configuration information and loads the kernel according to this configuration information.

3. Load kernel
The system reads the kernel image, extracts it into memory, the computer is managed by the kernel, the kernel detects the hardware environment first, then loads the driver (the kernel stores unnecessary functions as modules in/lib/module, the kernel loads dynamically, This is done by loading the virtual file system (INITRD file) and the hardware of the system is ready.

4. Executing the INIT program
After the kernel is loaded, the first program of the system is started, that is, the first user process init process is created (the program is in/sbin/init), and the INIT process reads system-related initialization files (for example,/etc/ INIT.D) To prepare the execution environment for the software, including the host name of the system, network settings, file system, etc. ( this process is relatively complex and will be supplemented ).

5. Login
Execute the/bin/login program, the user can log in, at this point, completed the system startup process.


Postscript:
In the process of popular science, found that each point is worth in-depth exploration, and even see a few papers to analyze the Linux startup process, in the INIT process because of the many kernel functions involved in the later study of the kernel should have a new feeling, because of limited time, dare not write, But I have an overall grasp of the start-up process, the main purpose has been achieved. Hope in the later practice slowly sentiment.

Resources:
Http://blog.chinaunix.net/uid-26495963-id-3066282.html
http://blog.csdn.net/clozxy/article/details/5487715
Http://www.ibm.com/developerworks/cn/linux/kernel/startup/index.html
Http://www.ruanyifeng.com/blog/2013/08/linux_boot_process.html


0923------APUE Learning Notes----------Linux system start-up process

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.