Linux study NOTE _ 5_Linux Boot Process Analysis _ 1

Source: Internet
Author: User
Linux boot process: 1. press the power to start the first step: Start the firmware → POST power-on self-check to check the hardware loading, such as, keyboard, memory, etc. It has nothing to do with the operating system. Therefore, when you add a new hard disk, the first step is to first enter the firmware module.

Linux boot process:

1. press the first start step of the power supply: start firmware → POST power-on self-check

Check the hardware loading status, such as the keyboard and memory.

It has nothing to do with the operating system. Therefore, when you add a new hard disk, the first step is to first enter the firmware mode and check whether the firmware has identified this Nic!

Synchronize the hardware and software clock: [in theory, the two times should be consistent]

Hwclock display hardware clock

Hwclock-h: describes the synchronization clock options in detail.

Change Time:

Use man to view hwclock, or date to provide detailed instructions.

After the first step is successfully completed:

2. read MBR [masterboot record, master boot record]: GRUB in Linux

[MBR is located in the disk's 0 cylinder, 0 Head, 1 sector]

The purpose of this step is to read

Data in MBR:

1. Bootloader: self-starting Program

2. Partitiontable: disk partition table

3. MagicNumber: ending flag

 

The most important role: load the kernel!

Grub. conf analysis:

Kernel/vmlinuxz-2.6.18-194. e15 ro root... used to specify the kernel location

2: motherboard ID

6: minor version number. if the odd number is the test version, the even number is the official version.

18: Last version

About the kernel:

Is an executable file, is a file, not a pile of files

Z-indicates a compressed file, so it will be decompressed continuously at startup.

3. load the kernel: during this period, there are only two functions:

1. driver hardware

2. start process init: after init is started, read the configuration file inittab and execute the default running level to continue the boot process. In UNIX systems, init is the first process that can exist. its PID is always 1. [generally, PID is randomly allocated, but init is special. you can run the following command: ps-el.]

Appendix: PPID: parent process

Parent-child process relationship: the parent process ends and the child process must be terminated.

In Linux, init is essentially the parent process of all processes.

The PID of init is always 1, but it must also be responsible for a more advanced function: Kernel scheduler with PID 0 (Kernelscheduler)

The kernel scheduler is responsible for allocating system time and switching between processes.

4. init reads the configuration file/etc/inittab

Analyze the Linux running level,

Analysis:

0-halt: Shutdown

1-single-user mode. only the root user can log on without a graphical interface.

[Repair mode, similar to Windows security mode]

2-multi-user mode, but there is no graphical interface. 1 and 2 are the most widely used Linux servers.

3-like 2, NFS is added

4-unavailable, which can be customized by the user

5-default system running level: x11 indicates a graphical and graphical multi-user environment.

6-restart

Run-level switch:

 

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.