Linux Boot Sequence

  Boot Sequence翻译成中文是引导顺序、启动顺序,是学习linux的一个重要的知识点,也是一个基础的知识点,做下笔记。

  Linux Boot Sequence:

  1、load bios(hardware information)

    加载BIOS(硬件信息),BIOS:Basic Input Output System(基本输入输出系统),是一组固化到计算机内主板上一个ROM芯片上的程序,它保存着计算机最重要的基本输入输出的程序、系统设置信息、开机后自检程序和系统自启动程序。详见百度百科

  2、read MBR's config to find out the OS

    读取MBR配置查找需要启动的操作系统,MBR: Master Boot Record(硬盘的主引导记录),它由三部分组成:主引导程序、硬盘分区表、硬盘有效标志。

  3、load the kernel of the OS

    加载操作系统的内核。注意这里有个一个选择操作系统的步骤。GRUB(the GRand Unified Bootloader),是多启动规范的实现,它允许用户可以在计算机内同时拥有多个操作系统,并在计算机启动时选择希望运行的操作系统。GRUB可用于选择操作系统分区上的不同内核,也可用于向这些内核传递启动参数。

  4、init process starts...

    启动第一个进程init

  5、execute /etc/rc.d/sysinit

    init进程启动后,会执行/etc/rc.d目录下的sysinit命令

  6、start other modules(etc/modules.conf)

    加载其他模块,只有这些模块加载之后,网络、光驱等才可以使用。

  7、execute the run level scripts

    run level: linux内核启动完之后,后续的启动是分层次的。可以分任意层次进行启动,每个层次之间无直接关系,并且各层之间启动的程序不一样。

    run level层次:

      0) - 系统停机状态  /etc/rc.d/rc0.d/

      1) - 单用户工作状态  /etc/rc.d/rc1.d/

      2) - 多用户状态(没有NFS)  /etc/rc.d/rc2.d/

      3) - 多用户状态(有NFS)  /etc/rc.d/rc3.d/

      4) - 系统未使用  /etc/rc.d/rc4.d/

      5) - 图形界面  /etc/rc.d/rc5.d/

      6) - 系统正常关闭并重新启动  /etc/rc.d/rc6.d/ 

  8、execute /etc/rc.d/rc.local

    运行 /etc/rc.d/rc.local脚本。rc.local脚本主要用于自启动。

  9、 execute /bin/login

    执行/bin/login,展示系统登录界面。

  10、shell started...

  

  我们可以把这个步骤简化分为以下几个步骤:

  1、BIOS Initialization

    BIOS初始化

  2、Boot Loader

    1st Stage - small, resides in MBR or boot sector

    2nd Stage - loaded from boot partition

  3、Kernel initialization

    内核初始化

  4、init starts and enter desired run level by executing:

    初始化启动,通过运行以下命令来执行run level

    /etc/rc.d/rc.sysinit

    /etc/rc.d/rc and /etc/rc.d/rc?.d/

    /etc/rc.d/rc.local

    X Display Manager if appropriate

 

  基于BIOS、MBR、GRUB、Kernel、Init、run level六个概念,也有人将这个启动步骤分为这六部。关于Linux的启动,读者只需仔细理解研究这六个概念就可以了。

  参考:

  尚学堂科技轻松愉快LINUX视频教程

  红帽RH133官方教程

  6 Stages of Linux Boot Process

      

posted @ 2011-11-22 22:04  慢热君Kevin  阅读(2047)  评论(0编辑  收藏  举报