9.2. GRUB

GNU GRand Unified Boot loader(GRUB)是​​​​​​​允​​​​​​​许​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​引​​​​​​​导​​​​​​​时​​​​​​​选​​​​​​​择​​​​​​​已​​​​​​​安​​​​​​​装​​​​​​​的​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​或​​​​​​​内​​​​​​​核​​​​​​​的​​​​​​​程​​​​​​​序​​​​​​​。​​​​​​​它​​​​​​​也​​​​​​​允​​​​​​​许​​​​​​​用​​​​​​​户​​​​​​​把​​​​​​​参​​​​​​​数​​​​​​​传​​​​​​​给​​​​​​​内​​​​​​​核​​​​​​​。​​​​​​​

9.2.1. GRUB 和​​​​​​​ x86 引​​​​​​​导​​​​​​​过​​​​​​​程​​​​​​​

GRUB 在​​​​​​​下​​​​​​​列​​​​​​​阶​​​​​​​段​​​​​​​把​​​​​​​它​​​​​​​自​​​​​​​己​​​​​​​载​​​​​​​入​​​​​​​内​​​​​​​存​​​​​​​:
  1. The Stage 1 or primary boot loader is read into memory by the BIOS from the MBR[4]. The primary boot loader exists on less than 512 bytes of disk space within the MBR and is capable of loading either the Stage 1.5 or Stage 2 boot loader.
  2. 如​​​​​​​果​​​​​​​有​​​​​​​需​​​​​​​要​​​​​​​,第​​​​​​​ 1.5 阶​​​​​​​段​​​​​​​的​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​由​​​​​​​第​​​​​​​一​​​​​​​阶​​​​​​​段​​​​​​​的​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​读​​​​​​​入​​​​​​​内​​​​​​​存​​​​​​​。​​​​​​​ 某​​​​​​​些​​​​​​​硬​​​​​​​件​​​​​​​在​​​​​​​进​​​​​​​入​​​​​​​第​​​​​​​二​​​​​​​阶​​​​​​​段​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​之​​​​​​​前​​​​​​​,要​​​​​​​求​​​​​​​一​​​​​​​个​​​​​​​中​​​​​​​间​​​​​​​步​​​​​​​骤​​​​​​​。​​​​​​​当​​​​​​​ /boot/ 分​​​​​​​区​​​​​​​处​​​​​​​于​​​​​​​硬​​​​​​​盘​​​​​​​的​​​​​​​ 1024 柱​​​​​​​面​​​​​​​之​​​​​​​上​​​​​​​,或​​​​​​​者​​​​​​​使​​​​​​​用​​​​​​​ LBA 模​​​​​​​式​​​​​​​时​​​​​​​,这​​​​​​​就​​​​​​​会​​​​​​​发​​​​​​​生​​​​​​​。​​​​​​​第​​​​​​​ 1.5 阶​​​​​​​段​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​位​​​​​​​于​​​​​​​ /boot/ 分​​​​​​​区​​​​​​​或​​​​​​​者​​​​​​​是​​​​​​​ MBR 和​​​​​​​ /boot/ 分​​​​​​​区​​​​​​​的​​​​​​​一​​​​​​​小​​​​​​​部​​​​​​​分​​​​​​​空​​​​​​​间​​​​​​​里​​​​​​​。​​​​​​​
  3. 第​​​​​​​二​​​​​​​阶​​​​​​​段​​​​​​​或​​​​​​​第​​​​​​​二​​​​​​​级​​​​​​​的​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​被​​​​​​​读​​​​​​​入​​​​​​​内​​​​​​​存​​​​​​​。​​​​​​​ 第​​​​​​​二​​​​​​​级​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​显​​​​​​​示​​​​​​​ GRUB 菜​​​​​​​单​​​​​​​和​​​​​​​命​​​​​​​令​​​​​​​环​​​​​​​境​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​界​​​​​​​面​​​​​​​允​​​​​​​许​​​​​​​用​​​​​​​户​​​​​​​选​​​​​​​择​​​​​​​引​​​​​​​导​​​​​​​哪​​​​​​​个​​​​​​​内​​​​​​​核​​​​​​​或​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​、​​​​​​​把​​​​​​​参​​​​​​​数​​​​​​​传​​​​​​​递​​​​​​​给​​​​​​​内​​​​​​​核​​​​​​​、​​​​​​​或​​​​​​​者​​​​​​​查​​​​​​​看​​​​​​​系​​​​​​​统​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​
  4. 第​​​​​​​二​​​​​​​级​​​​​​​的​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​把​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​或​​​​​​​内​​​​​​​核​​​​​​​,以​​​​​​​及​​​​​​​ /boot/sysroot/ 里​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​读​​​​​​​入​​​​​​​内​​​​​​​存​​​​​​​。​​​​​​​ 一​​​​​​​旦​​​​​​​ GRUB 决​​​​​​​定​​​​​​​启​​​​​​​动​​​​​​​哪​​​​​​​个​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​或​​​​​​​者​​​​​​​内​​​​​​​核​​​​​​​,它​​​​​​​就​​​​​​​会​​​​​​​把​​​​​​​它​​​​​​​载​​​​​​​入​​​​​​​内​​​​​​​存​​​​​​​并​​​​​​​把​​​​​​​机​​​​​​​器​​​​​​​的​​​​​​​控​​​​​​​制​​​​​​​权​​​​​​​交​​​​​​​给​​​​​​​那​​​​​​​个​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
这​​​​​​​个​​​​​​​引​​​​​​​导​​​​​​​Red Hat Enterprise Linux的​​​​​​​方​​​​​​​法​​​​​​​被​​​​​​​称​​​​​​​作​​​​​​​ direct loading,这​​​​​​​是​​​​​​​因​​​​​​​为​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​直​​​​​​​接​​​​​​​装​​​​​​​载​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​在​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​和​​​​​​​内​​​​​​​核​​​​​​​之​​​​​​​间​​​​​​​没​​​​​​​有​​​​​​​中​​​​​​​间​​​​​​​步​​​​​​​骤​​​​​​​。​​​​​​​
其​​​​​​​他​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​引​​​​​​​导​​​​​​​过​​​​​​​程​​​​​​​可​​​​​​​能​​​​​​​有​​​​​​​所​​​​​​​不​​​​​​​同​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​,Microsoft® Windows® 操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​,以​​​​​​​及​​​​​​​其​​​​​​​他​​​​​​​的​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​,都​​​​​​​使​​​​​​​用​​​​​​​ chain loading 的​​​​​​​方​​​​​​​式​​​​​​​装​​​​​​​载​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​种​​​​​​​方​​​​​​​式​​​​​​​下​​​​​​​,MBR 指​​​​​​​向​​​​​​​存​​​​​​​放​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​分​​​​​​​区​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​扇​​​​​​​区​​​​​​​,找​​​​​​​到​​​​​​​所​​​​​​​需​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​来​​​​​​​引​​​​​​​导​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
GRUB 支​​​​​​​持​​​​​​​ direct 和​​​​​​​ chain 装​​​​​​​载​​​​​​​这​​​​​​​两​​​​​​​种​​​​​​​方​​​​​​​式​​​​​​​,这​​​​​​​使​​​​​​​它​​​​​​​几​​​​​​​乎​​​​​​​可​​​​​​​以​​​​​​​引​​​​​​​导​​​​​​​任​​​​​​​何​​​​​​​操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​

警告

During installation, Microsoft's DOS and Windows installation programs completely overwrite the MBR, destroying any existing boot loaders. If creating a dual-boot system, it is best to install the Microsoft operating system first.


[4] For more on the system BIOS and the MBR, refer to 第 30.2.1 节 “BIOS”.

为了尽快向用户提供最新的信息,本文档可能会包括由机器自动从英文原文翻译的内容。如需更多信息,请参阅此说明。