linux启动过程

简介:

1.启动过程:

The bootprocess involves several files and errors in these files is the usual cause of

bootproblems.

启动进程调用几个文件并在这几个文件中发生的错误通常是启动问题的原因。

系统启动后执行的操作:

 

1. Thecomputer's BIOS performs a power-on self-test (POST), and then locates andinitializes any

peripheraldevices including the hard disk.

电脑 BIOS执行上电自检(POST然后,定位和初始化周边设备包括硬盘。

 

2. TheBIOS reads the Master Boot Record (MBR) into memory from the boot device. (ForGUID Partition

Table(GPT) disks, this MBR is the protective MBR on the first sector of the disk.)The MBR stores

informationabout the organization of partitions on that device. On a computer with x86architecture,

the MBRoccupies the first 512 bytes of the boot device. The first 446 bytes containboot code that

points tothe bootloader program, which can be on the same device or on another device.The next

64 bytescontain the partition table. The final two bytes are the boot signature, whichis used for error

detection.The default bootloader program used on Oracle Linux is GRUB, which stands forGRand

UnifiedBootloader.

BIOS从启动设备读取主启动记录(MBR master boot record)到内存。(对于GUID 分区表磁盘(GPT磁盘)MBR是在第一磁盘扇区的保护MBRMBR存储关于设备分区组织信息。在一个 x86构架的电脑上,MBR占用启动设备的第一个512字节。前面446个字节包含指向bootloader程序的启动码,它可以在相同的设备或者不同设备。下面64字节包含分区表。最后2个字节是启动签名,用于错误检测。默认用在oracle linux上的bootloader程序是GRUB, 代表GrandUnified Bootloader.

什么是GUID?

全局唯一标识符(GUID,GloballyUnique Identifier)

是一种由算法生成的二进制长度为128位的数字标识符。

GUID 的格式为“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,其中每个 x 是 0-9 或 a-f范围内的一个4位16进制数。

 

 

3. TheGRUB bootloader loads the Oracle Linux kernel into memory.

GRUB加载kernel到内存

4. Thekernel initializes and configures the system hardware.

kernel初始化并配置系统硬件

5. Thekernel reads the initramfs file, extracts its contents into a temporary,memory-based file system

(tmpfs),and loads the modules that the file system contains.

kernel读取 initramfs文件,提取其内容到临时,基于内存的文件系统(tmpfs),并加载文件系统包含的模块。

6. Thekernel starts the /sbin/init process with a process ID of 1 (PID 1). init isthe ancestor of all

processeson a system. init reads its job configuration from the /etc/init directory. The/etc/

init/rcS.conffile controls how init handles system initialization.

kernel使用进程号1开始/sbin/init进程。 init是所有系统进程的祖先。init会从/etc/init目录读取它的job配置文件。/etc/init/rcS.conf文件控制init怎么样处理系统初始化。

 

7. initreads /etc/inittab to determine the default run level. The entry in/etc/inittab should

take theform id:N:initdefault:, where N is the default run level. If the file does notdefine a

defaultboot level, the default run level is 3.

init读取/etc/inittab决定默认的运行级别。/etc/inittab应该按照这种格式:id:N:initdefault:

8. initruns /etc/rc.sysinit to initialize thesystem, including:

settingthe host name

initializing the network

mounting the /proc file system

initializing SELinux based on its configuration

printing a welcome banner

initializing the system hardware based on kernel boot arguments

mounting the file systems

cleaning up directories in /var

starting swapping

 

init运行/etc/rc.sysinit来初始化系统,包括:

设置主机名

初始化网络

挂载/proc文件系统

初始化selinux

打印欢迎标语(/etc/motd

初始化基于kernel启动参数的系统硬件

挂载文件系统

清理/var目录

启动swaping

 

9. initexecutes scripts in the /etc/rcX.ddirectory to bring the system to the default run level, X. The

/etc/init/rc.conffile controls how init starts individual run levels. See Section 4.3, “AboutRun

Levels”and Section 4.3.4, “About Service Scripts”.

init执行/etc/rcX.d目录中的脚本来把系统带到默认的运行级别。

/etc/init/rc.conf文件控制init怎么样启动单独的运行级别。

 

10. initruns any actions that you have defined in /etc/rc.local.

init运行执行/etc/rc.local的语句












本文转自chenzudao51CTO博客,原文链接: http://blog.51cto.com/victor2016/1897356  ,如需转载请自行联系原作者

相关文章
|
Linux C语言
RISC-V Linux汇编启动过程分析
RISC-V Linux汇编启动过程分析
|
19天前
|
Linux Shell 网络安全
Linux 系统启动过程
Linux 系统启动过程
48 2
|
18天前
|
安全 Linux
探索Linux操作系统的启动过程
在这篇文章中,我们将深入探讨Linux系统的启动流程,从电源开启到登录界面呈现的每一个步骤。我们将揭示BIOS、引导加载器、内核以及初始化进程如何协同工作,使Linux系统顺利启动。通过了解这些过程,读者将能更好地理解Linux系统的工作原理,并为可能出现的启动问题提供解决思路。
56 14
|
10天前
|
安全 Ubuntu Linux
|
2月前
|
NoSQL Linux
Linux 0.11启动过程分析(一)
Linux 0.11启动过程分析(一)
35 1
|
2月前
|
Linux
探索Linux操作系统的启动过程
【8月更文挑战第31天】本文将深入探讨Linux系统从按下电源键到登录界面出现之间的神秘世界。我们将一步步揭开内核加载、初始化进程启动和系统服务运行的面纱,同时通过实际代码示例,揭示这一切是如何精妙地编织在一起的。无论你是系统管理员还是对操作系统感兴趣的爱好者,这篇文章都将给你带来新的视角和深刻的见解。
|
2月前
|
存储 Linux 调度
深入理解Linux操作系统的启动过程
【8月更文挑战第31天】本文将深入探讨Linux操作系统的启动过程,包括BIOS、内核、init进程等关键步骤。我们将通过实际代码示例,揭示Linux启动过程中的奥秘,帮助读者更好地理解和掌握Linux系统。
|
2月前
|
存储 Linux 数据库
探索Linux操作系统的启动过程
【8月更文挑战第24天】本文将带你深入了解Linux操作系统从开机到用户登录的全过程。我们将逐步解析BIOS/UEFI初始化、引导加载器(Bootloader)的作用、内核启动以及系统运行级别和初始化进程。通过阅读本文,你将获得对Linux启动流程的清晰认识,并能够理解每个阶段的关键任务。
|
5月前
|
Linux
Linux系统启动过程
Linux系统启动过程。
59 9
|
5月前
|
存储 小程序 Linux
浅谈 Linux 系统启动过程
【4月更文挑战第22天】浅谈 Linux 系统启动过程
101 8
浅谈 Linux 系统启动过程