Linux 操作系统 系统启动

本文详细阐述了Linux启动流程的五个阶段:BIOS检查硬件、MBR加载引导程序、内核加载与初始化、init进程启动及用户登录。每个阶段都涉及到了如内核加载、内存映射等重要环节。
摘要由CSDN通过智能技术生成

Linux 的启动流程可以分为 5 个阶段:
    1.    内核引导:当计算机启动时,首先运行 BIOS 程序,该程序会检查硬件设备,然后加载主引导记录(MBR)。MBR 通常存储在硬盘的第一个扇区中,它包含一个小程序,称为引导加载程序,该程序负责加载 Linux 内核。
    2.    内核加载:引导加载程序从硬盘上加载 Linux 内核映像,并将其加载到内存中。然后,引导加载程序将控制权转移给内核。
    3.    内核初始化:内核加载后,它将初始化硬件设备,建立内存映射,并启动其他必要的系统进程。
    4.    启动 init 进程:内核初始化完成后,它会启动第一个用户进程,即 init 进程。init 进程是所有其他用户进程的父进程,它负责启动系统的其他部分,如文件系统、网络等。
    5.    用户登录:init 进程启动后,会启动登录进程(login process),等待用户登录。用户登录后,登录进程会启动用户的 shell 进程,用户就可以与系统进行交互了。
整个 Linux 启动流程可以概括为:BIOS 程序→MBR 中的引导加载程序→Linux 内核→init 进程→登录进程→用户 shell 进程。

 

The Linux boot process can be divided into five stages:
    1.    Kernel boot: When the computer starts, the BIOS program is executed first, which checks the hardware devices and then loads the Master Boot Record (MBR). The MBR usually stores in the first sector of the hard drive and contains a small program called the boot loader, which is responsible for loading the Linux kernel.
    2.    Kernel loading: The boot loader loads the Linux kernel image from the hard drive and loads it into memory. Then, the boot loader transfers control to the kernel.
    3.    Kernel initialization: After the kernel is loaded, it initializes the hardware devices, establishes memory mappings, and starts other necessary system processes.
    4.    Start the init process: After kernel initialization is complete, it starts the first user process, which is the init process. The init process is the parent process of all other user processes and is responsible for starting other parts of the system, such as the file system and network.
    5.    User login: After the init process starts, it starts the login process and waits for the user to log in. After the user logs in, the login process starts the user's shell process, and the user can interact with the system.
The entire Linux boot process can be summarized as: BIOS program → boot loader in MBR → Linux kernel → init process → login process → user shell process.

 

Mbr

引导程序

加载程序

在启动前需要安装Linux系统

建立内存映射

内核初始化

内核进程

 

Linux内核

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值