Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the startup process of the Linux operating system?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how the Linux operating system startup process is", the content is simple and easy to understand, the organization is clear, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how the Linux operating system startup process is" this article bar.

Linux operating system startup process

02 CentOS 6 Startup Process

1. Loading BIOS

When the computer is powered on, the first is BIOS power-on self-test, which starts according to the boot device (usually the hard disk) set in the BIOS.

2. Read MBR

After loading BIOS information, the computer will find the hard disk specified by BIOS, read the MBR storage record information of the disk, and boot the system.

3. GRUB boot

Select Boot Kernel/Perform Single User Mode Reset Password

4. Loading Kernel

The computer reads the memory image, and when the screen outputs "OK,booting the kernel." The system places the kernel in memory and calls the start_kernel() function to start a series of initialization functions and initialize various devices to complete the establishment of the Linux kernel environment.

5. Set the system operation level

When the kernel is loaded, it starts the first daemon, init, and sets the inittab runlevel by reading the/etc/inittab file from that process.

Linux common operating levels are as follows: 1,0: shutdown mode 2,1: single user mode 3,2: multi-user mode without network support 4,3: character interface multi-user mode 5,4: reserved, unused 6,5: graphical interface multi-user mode 7,6: reboot system, restart mode

6. Load rc.sysinit(system initialization)

After reading the runlevel, the system will execute the first user-level file/etc/rc.d/rc.sysinit, which includes: setting PATH runlevel changes, setting network configuration, starting swap partition, setting/proc, system functions, configuring SELinux, etc.

7. Load kernel module

Read the/etc/modules.conf file and the folder in the/etc/modules.d directory to load the system kernel modules. This module file can be added later or modified and deleted.

8. Start the run-level program

Depending on the runlevel read in step 5, the operating system will run the appropriate scripts from rc0.d to rc6.d to complete the initialization and start the corresponding services.

9. Read the rc.local file

After the operating system starts the corresponding service, it will read and execute the/etc/rc.d/rc.local file. You can add the task that needs to be booted to the end of the file. The system will execute and start the corresponding command line by line. As shown below:

10. Execute the/bin/login program

Run the/bin/login program and boot to the system login interface, as shown in the figure below. Enter the username and password to log in to the Linux operating system. At this point the operating system complete boot process is complete.

03 CentOS 7 Startup Process

CentOS 7 and CentOS 6 boot process is similar, but to the init program, changed to systemd.

CentOS 7 boot sequence:

HarmonyOS Technology Community

UEFi or BIOS initialization, running POST

Select Start Device

Bootloader, centos7 is grub2

Load the loader configuration file: /etc/grub.d/,/etc/default/grub,/boot/grub2/grub. cfg

Load kernel options

loading initramfs initializing pseudo-file system

Kernel initialization, centos7 uses systemd instead of init

Execute initrd.target all units, including mount/etc/fstab

Switch from initramfs root file system to disk root directory

systemd executes default target configuration, configuration file/etc/systemd/system/default.target

systemd executes sysinit.target to initialize system and basic.target to prepare operating system

systemd starts native and server services under multi-user.target

systemd Execute/etc/rc.d/rc.local under multi-user.target

Systemd executes getty.target and login services under multi-user.target

systemd performs services required graphically

The following picture is what I saw on the Internet. The summary is very detailed and shared with everyone. For learning only, if there is copyright problem, please contact us. thank

The above is "Linux operating system startup process is how" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report