LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1377|回复: 2

问一个boot sequence的问题

[复制链接]
发表于 2004-11-17 18:55:10 | 显示全部楼层 |阅读模式
在linux-boot上看到介绍boot sequence

Boot Sequence  

Stage 0 = in the BIOS
  Execute a JMP at 0xFFFFFFF0 ( 1st instruction after power on )
  Power-On-Self-Test
  Detect hardware
  Load Interrupt Vector table ( 0x0 )
  Find Master Boot Sector ( 1st 512Bytes and sector ends with 0xaa55 )
  Copy Master Boot Sector ( track 0 Sector 0 ) into RAM at 0x7C00
  Execute ( int 0x19 ) the MBR ( aka 1st Stage Loader ) moved to 0x9000
Stage 1 BootLoader ( aka Master Boot Sector )
  the BootLoader is arch/i386/boot/bootsect.S
  Displays: Loading.....
  setup() is loaded at 0x00090200
  zImage is loaded at 0x00010000 bootsect.S -Ttext 0x1000
  bzImage is loaded at 0x00100000 bbootsect.S -Ttext 0x100000 -D__BIG_KERNEL__
  Print L than load 2nd stage
  Print I than execute the 2nd stage
Stage 1.5 FS
  Grub will load its filesystem boot info
Stage 2 Main Boot Process
  Print L than load 2nd stage
  Read the /boot/map file
  Print O after the map file was loaded
  Grub and Lilo will show its kernel options to boot
  Displays: Uncompressing vmlinuz.....
Stage 3 Kernel - Hardware Detect and Scan
  Jump/Execute setup() ( arch/i386/boot/setup.S or bsetup.S )
  Scan the PCI bus for peripherals: KB, mouse, svga, disks
  setup interrupts vectors
  Load the device Drivers ( modules )
  switch from real-mode to protected mode
  -- or -- is this where: "uncompressing linux" displays
  Jump/Execute startup_32() ( arch/i386/kernel/head.S ) ( Start PID=0 )
Stage 4 Root FileSystem
  Jump/Execute start_kernel() ( start PID=1 )
  Load the optional ramdisk ( execute /linuxrc ) or is it before pid=0
  run init ( /etc/inittab ) ( PID = 1 )
  run rc.sysinit
  run rcx.d init scripts

我想问一下
Stage 1.5 FS
  Grub will load its filesystem boot info
这里是否说grub也要加载自己的fs?如果是的话,这里的fs是否是最早加载的fs,而这里的fs一般是什么?

:help
发表于 2004-11-18 13:11:22 | 显示全部楼层
以前Linuxsir里的一篇文章,不知还能不能找到。它里面有段话可能可以解释你的问题。[php]
    3. "root"
  在 Linux 中,当谈到 "root" 文件系统时,通常是指主 Linux 分区。但是,GRUB 有它自己的 root 分区定义。GRUB 的 root 分区是保存 Linux 内核的分区。这可能是您的正式 root 文件系统,也可能不是。例如,在 Gentoo Linux 中,有一个单独的小分区专用于保存 Linux 内核与引导信息。大多数情况下,我们不安装这个分区,这样在系统意外崩溃或重新引导时,就不会把它弄乱。
  这些,我们讨论的是 GRUB,需要指定 GRUB 的 root 分区。进入 root 分区时,GRUB 将把这个分区安装成只读型,这样就可以从该分区中装入 Linux 内核。GRUB 的一个很“酷”的功能是它可以读取本机的 FAT、FFS、minix、ext2 和 ReiserFS 分区,我们很快就会讨论这个功能。但现在,让我们输入 root 分区。在提示中输入 root,但不要按 Enter 键:
   grub> root (
  现在,按一次 Tab 键。如果系统中有多个硬盘,GRUB 将显示可能完成的列表,从 "hd0" 开始。如果只有一个硬盘,GRUB 将插入 "hd0,"。如果有多个硬盘,继续进行,在 ("hd2") 中输入名称并在名称后紧跟着输入逗号,但不要按 Enter 键。部分完成的 root 命令看起来如下:
  grub> root (hd0,
  现在,继续操作,再按一次 Tab 键。GRUB 将显示特定硬盘上所有分区的列表,以及它们的文件系统类型。在我的系统中,按 Tab 键时得到以下列表:
   grub> root (hd0, (tab)
   Possible partitions are:
   Partition num: 0, Filesystem type is ext2fs, partition type 0x83
   Partition num: 1, Filesystem type unknown, partition type 0x82
   Partition num: 2, Filesystem type unknown, partition type 0x7
   Partition num: 4, Filesystem type is reiserfs, partition type 0x83
   Partition num: 5, Filesystem type is reiserfs, partition type 0x83
  如您所见,GRUB 的交互式硬盘和分区名称实现功能非常有条理。这些,只需要好好理解 GRUB 新奇的硬盘和分区命名语法,然后就可以继续操作了。
[/php]

附上原文

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2004-11-18 15:08:23 | 显示全部楼层
thx a lot
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表