Linux system notes 2-system guidance

Source: Internet
Author: User

2.1 Guide
This is the second article in the Linux series. Let's take a look at how the Linux system is guided. Linux is different from windows.
2.2 INIT process
This is the first process to start the system. This process is generated when the hardware boot completes and the control is handed over to the system kernel. And his PID Number is always 1.
When the BIOS determines the boot from the hardware device, read the MBR and determine the second boot program. This boot program is mainly used to load the kernel and execute a series of boot processes. After detecting the hardware, the kernel generates the INIT process. The INIT process creates other daemon processes by calling shell scripts, which are mostly RC files, such as rc0.d, now I understand what these files are for. RC is short for Run Command. Is a legacy of operating system development.
2.3 guiding process
There are generally six phases:
Load and initialize the kernel;
Detection hardware;
Create a kernel process;
Operator intervention (IF );
Execute the system startup script;
Multi-User Mode;
The kernel is a binary image located in/boot/vmlinuz or/vmlinuz. the Linux system adopts a single kernel structure, so the entire kernel is in the memory. The first task of the kernel is to check the hardware. The driver is loaded by the kernel.
After kernel initialization, several spontaneous processes will be created. They are not created by fork. Some process names we see in the ps command are enclosed in brackets, and the PID numbers are relatively small, often created by the kernel, which is actually a component of the kernel. It looks more like a process.
List several items:
Kjournald
Kswapd
Kreclaimd

Ksoftirqd


We can see that the PID numbers are very small. After the startup script is executed, the Getty process is generated so that the user can log in.
Guidance involves grup programs. This is a very popular Boot Loader currently. It is especially important when it comes to multiple systems. If you are interested, you can check the information on your own.
The single-user mode is mentioned here. When Linux is started, manual intervention can be performed to change to single-user logon. Currently, all I have applied is to forget the root password, select this login to change the password.
2.4 Startup Script
When talking about the startup script, you must mention the INIT process, which involves a running-level concept.
Level 0: The system is completely shut down;
Level 1: single-user mode;
2-5: Multi-User Mode;
Level 6: reboot;
Level 0 and Level 6, the system cannot stay in these two levels. When the computer starts, the running level is gradually increased from level 0, currently, most Linux distributions are of the 5-level version by default. This is a prompt process for the init process to complete this running level.
In the/etc/init. d folder, many startup scripts for daemon are stored, and we often start processes from here. However, when the INIT process brings the system to a new running level, it looks for the startup script at the current running level through the rc0.d, rc1.d... directory. Of course, the symbolic link in the directory directs to the script in the/etc/init. d folder.

Not complete...




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.