Article Title: New School: Linux operating system boot process analysis. Linux is a technology channel of the IT lab in China. Including Basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open-source systems first load BIOS hardware information. We all know that BIOS is the meaning of Basic Input/Output Setup, every time you press the enable key, the computer will first load the BIOS information. When you start the system, press the del key to enter the BIOS for configuration, for example, the most commonly used one is to set the boot from the hard disk or from the optical drive or others. I believe anyone who has installed the operating system knows this. Of course, there is a lot of information in the BIOS, such as the hard disk size and voltage.
If the BIOS is set to start from the hard disk, the first sector of the first boot hard disk, MBR, will be read after reading the BIOS. Someone may have heard of it, that is, master boot record. boot programs such as grub and lilo are installed here. Why read this information? Think about the multiple systems installed on your machine. Without a boot program, the machine does not know which system he should start. The function of the boot program is to provide several operating system options, each option points to the startup address of the operating system.
After the machine finds the linux kernel from the boot program, it will start to load the linux kernel. the linux kernel is basically installed under/boot, and the boot program will find and load the kernel under boot.
After loading, the kernel executes the/sbin/init program, which selects the login mode based on the information in the/etc/inittab file. There are 7 modes in total, 0-6 numbers. Basically, in linux, the graphic interface is installed in mode 5.
After you know the logon mode, you need to read the host information. linux first reads/etc/rc. d/rc. sysinit, which includes the PATH and some basic information about the LINUX operating system.
Next, we will start to load each module. The system reads information about the module from/etc/modules. conf.
The/sbin/init program starts to execute all the scripts in run-level. At the beginning, it has selected the same mode as 0--6, and then it will execute/etc/rc. d/rc *. d. Go to the/etc/rc. d/rc5.d folder and check the ls-l folder. You will find that the links are all links to scripts in rc. d/init. d. Because different login modes have different scripts to start, and all the startup scripts are from init. d. Rc *. the script name in d either starts with K or starts with S, K indicates kill, S indicates start, and numbers after S and K represent the startup priority. The smaller the value, the higher the priority.
Most of the boot tasks have been completed here, and then/sbin/init will start to execute linux's personalized settings. These settings are stored in/etc/rc. d/rc. local.
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