📄 boot-introduction.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>The Booting Problem</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="The FreeBSD Booting Process" href="boot.html" /><link rel="PREVIOUS" title="The FreeBSD Booting Process" href="boot.html" /><link rel="NEXT" title="The MBR, and Boot Stages One, Two, and Three"href="boot-blocks.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="boot.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 12 The FreeBSD BootingProcess</td><td width="10%" align="right" valign="bottom"><a href="boot-blocks.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="BOOT-INTRODUCTION" name="BOOT-INTRODUCTION">12.2 The BootingProblem</a></h1><p>Turning on a computer and starting the operating system poses an interesting dilemma.By definition, the computer does not know how to do anything until the operating systemis started. This includes running programs from the disk. So if the computer can not runa program from the disk without the operating system, and the operating system programsare on the disk, how is the operating system started?</p><p>This problem parallels one in the book <i class="CITETITLE">The Adventures of BaronMunchausen</i>. A character had fallen part way down a manhole, and pulled himself out bygrabbing his bootstraps, and lifting. In the early days of computing the term <iclass="FIRSTTERM">bootstrap</i> was applied to the mechanism used to load the operatingsystem, which has become shortened to ``booting''.</p><p>On x86 hardware the Basic Input/Output System (BIOS) is responsible for loading theoperating system. To do this, the BIOS looks on the hard disk for the Master Boot Record(MBR), which must be located on a specific place on the disk. The BIOS has enoughknowledge to load and run the MBR, and assumes that the MBR can then carry out the restof the tasks involved in loading the operating system.</p><p>If you only have one operating system installed on your disks then the standard MBRwill suffice. This MBR searches for the first bootable slice on the disk, and then runsthe code on that slice to load the remainder of the operating system.</p><p>If you have installed multiple operating systems on your disks then you can install adifferent MBR, one that can display a list of different operating systems, and allows youto choose the one to boot from. FreeBSD comes with one such MBR which can be installed,and other operating system vendors also provide alternative MBRs.</p><p>The remainder of the FreeBSD bootstrap system is divided into three stages. The firststage is run by the MBR, which knows just enough to get the computer into a specificstate and run the second stage. The second stage can do a little bit more, before runningthe third stage. The third stage finishes the task of loading the operating system. Thework is split into these three stages because the PC standards put limits on the size ofthe programs that can be run at stages one and two. Chaining the tasks together allowsFreeBSD to provide a more flexible loader.</p><p>The kernel is then started and it begins to probe for devices and initialize them foruse. Once the kernel boot process is finished, the kernel passes control to the userprocess <a href="http://www.FreeBSD.org/cgi/man.cgi?query=init&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">init</span>(8)</span></a>, which thenmakes sure the disks are in a usable state. <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=init&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">init</span>(8)</span></a> then startsthe user-level resource configuration which mounts file systems, sets up network cards tocommunicate on the network, and generally starts all the processes that usually are runon a FreeBSD system at startup.</p></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="boot.html" accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="boot-blocks.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">The FreeBSD Booting Process</td><td width="34%" align="center" valign="top"><a href="boot.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">The MBR, and Boot Stages One, Two, andThree</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -