For faster navigation, this Iframe is preloading the Wikiwand page for Linux启动进程.

Linux启动进程

Linux启动进程是启动Linux时执行的一个复杂的初始化过程。它在很多方面类似于BSD系统和别的类Unix系统的启动过程。[1][2]

启动Linux系统涉及到很多阶段,包括硬件初始化(如BIOSUEFI)、执行启动程序(如GRUBSYSLINUX)、加载和启动Linux内核镜像,执行init(如Systemd)和执行守护进程

概述

x86x86-64是Linux操作系统的常用指令集架构

  1. BIOS/UEFI针对实际的硬件平台执行硬件初始化任务。
  2. 启动程序加载initrd/initramfs,并由启动程序加载Linux核心
  3. 内核将配置系统功能,譬如配置硬件,称为start_kernel(),这会执行大部分系统配置(中断、内存管理、装置和驱动程式初始化等)。然后它分别启动内存管理进程、init进程等在用户空间执行的进程。
  4. Init有特定的运行级别(System V)或目标(Systemd),每个运行级别或目标都是由特定的一组服务(守护进程)组成。
  5. 一个典型的桌面环境从X显示管理器开始初始化,X显示管理器显示登录画面,成功登录后由X显示管理器启动桌面环境(如GNOMEKDE)。

关机时,init会结束所有用户空间进程。init随后终止,内核自行关闭。

启动加载程序阶段

x86x86-64平台由BIOSUEFI固件初始化硬件,并由BIOS/UEFI加载启动程序。由启动程序加载Linux核心initrd。常见的启动程序有:

内核阶段

Linux内核处理所有操作系统进程,如内存管理、任务调度、I/O进程间通信和系统总体控制。这分为两个阶段 :

首先,内核被加载到内存中,并且建立了一些基本的功能,如基本内存管理。

内核会查找并执行init进程。

initramfs

initramfs自Linux内核的2.5.46版本开始加入这个概念,initramfs取代了initrd。早期用户空间的典型用途是检测需要哪些装置驱动程式来加载主用户空间文件系统,并从临时文件系统加载它们。[3]

init进程

init是Linux的根进程。进程号为1,它是所有进程的父进程。现时绝大多数Linux发行版都采用Systemd

System V init

Upstart init

Systemd init

参考资料

  1. ^ Linux 引导过程内幕. www.ibm.com. 2006-07-26 [2017-06-29]. (原始内容存档于2016-09-13) (中文(中国大陆)). 
  2. ^ 13.3. 引导管理器和各引导阶段. www.freebsd.org. [2017-06-29]. (原始内容存档于2020-11-23). 
  3. ^ About initramfs. www.linuxfromscratch.org. [2017-06-29]. (原始内容存档于2021-01-26). 
{{bottomLinkPreText}} {{bottomLinkText}}
Linux启动进程
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?