078-079.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 103 行

HTML
103
字号
<HTML>

<HEAD>

<TITLE>Linux Unleashed, Third Edition:Using LILO</TITLE>

<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0672313723//-->

<!--TITLE=Linux Unleashed, Third Edition//-->

<!--AUTHOR=Tim Parker//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Sams//-->

<!--CHAPTER=4//-->

<!--PAGES=078-079//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="075-077.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="080-081.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading12"></A><FONT COLOR="#000077">Using BOOTLIN</FONT></H4>

<P>With the Linux <TT>BOOTLIN</TT> configuration, which is also a common form of installation, no changes to the Master Boot Record are made. During the boot process, the Master Boot Record is read, and then a decision about which operating system to load is made. This decision is usually based on a user prompt. Essentially, this is the same as a normal DOS boot except the program <TT>BOOTLIN</TT> is invoked in either the <TT>CONFIG.SYS</TT> or <TT>AUTOEXEC.BAT</TT> files. This can then execute a program that lets you choose the operating system to load. The program <TT>BOOT.SYS</TT>, for example, may be used to present a menu that lets you choose between a Linux and DOS boot.</P>

<P>To install <TT>BOOTLIN</TT> in your DOS partition, follow these steps:</P>

<DL>

<DD><B>1.</B>&nbsp;&nbsp;Boot Linux. Make sure you have a boot floppy disk in case of problems.

<DD><B>2.</B>&nbsp;&nbsp;Place a copy of the Linux kernel in your DOS partition either through DOS or with one of the Linux Mtools. You only have to copy the kernel file into the home directory (or any subdirectory) of the DOS partition. This can even be done from a floppy.

<DD><B>3.</B>&nbsp;&nbsp;Copy <TT>BOOT.SYS</TT> and <TT>BOOTLIN.SYS</TT> to the DOS partition, using the same process as the Linux kernel.

<DD><B>4.</B>&nbsp;&nbsp;Add both the <TT>BOOT.SYS</TT> and <TT>BOOTLIN.SYS</TT> files to your <TT>CONFIG.SYS</TT> file.

<DD><B>5.</B>&nbsp;&nbsp;Make sure DOS is the active partition and reboot the machine.

</DL>

<P>When DOS starts, the BOOT device driver should give you the option of booting DOS or Linux. If you have problems, simply remove the <TT>BOOT.SYS</TT> and <TT>BOOTLIN.SYS</TT> files from the <TT>CONFIG.SYS</TT> file and you are back to normal.</P>

<P>Using the <TT>BOOT.SYS</TT> program has a useful advantage: No boot sectors are altered to support several operating systems. This can make it easy to load and to remove operating systems from a hard disk. Both the Master Boot Record with active partition and <TT>BOOT.SYS</TT> approaches can be employed together so that the hard disk starts to boot whichever operating system has the active flag, then pauses and waits for confirmation from the user (or a timeout to occur). In this case, no changes to the Master Boot Record need to be made.</P>

<H4 ALIGN="LEFT"><A NAME="Heading13"></A><FONT COLOR="#000077">Boot Parameters</FONT></H4>

<P>Regardless of which boot process you use, when Linux is booting, LILO pauses momentarily to check that the Shift, Control, and Alt keys are not pressed and that CapsLock and ScrollLock are set. If none of the keys are pressed and the locks are on, LILO displays the <TT>boot:</TT> prompt. At this point, LILO is waiting for the name of the boot image to be entered or if a timeout or Enter is pressed, the default boot image is loaded. The boot image is the kernel of whichever operating system is to be loaded, including DOS.</P>

<P>If you want to boot an image other than the default, you can enter its name at the <TT>boot:</TT> prompt. To obtain a list of all known boot images, enter a question mark or hit the Tab key (depending on the image and keyboard setting). The default boot image name is located in the file <TT>/etc/rc</TT> or /etc/lilo.conf (depending on the version of Linux) on the line that reads</P>

<!-- CODE SNIP //-->

<PRE>

BOOT_IMAGE=

</PRE>

<!-- END CODE SNIP //-->

<P>You can specify parameters for the kernel from the <TT>boot:</TT> prompt, too. You specify a parameter by entering it after the <TT>boot:</TT> prompt. Unless overridden, the parameters are used by the default image when it boots. Valid parameters differ a little depending on the version of Linux, but most versions support the following parameters:</P>

<CENTER>

<TABLE WIDTH="95%"><TR>

<TD WIDTH="20%">&#149; <TT>no387</TT>

<TD WIDTH="80%">Disables any onboard floating-point unit (FPU).

<TR>

<TD VALIGN="TOP">&#149; <TT>root</TT>

<TD>Boots from a device specified after the root parameter, such as <TT>root=/dev/ sda1</TT>. The root command requires a hexadecimal device number of the full path name of the device.

<TR>

<TD>&#149; <TT>ro</TT>

<TD>Mounts the root file system as read-only.

<TR>

<TD>&#149; <TT>rw</TT>

<TD>Mounts the root file system as read-write.

<TR>

<TD VALIGN="TOP">&#149; <TT>single</TT>

<TD>Boots the Linux system into single user (system administrator) mode.

</TABLE>

</CENTER>

<P>The root parameter allows a hexadecimal device number to be used. The device numbers are assigned depending on the type of device. For floppy drives, the numbers are assigned starting with 200, so <TT>/dev/fd0</TT> is 200, <TT>/dev/fd1</TT> is 201, <TT>/dev/fd2</TT> is 202, and so on. Hard disks have numbers assigned depending on the type of device. For most hard disks, the numbers start at 301 (not 300 because there is no <TT>/dev/hd0</TT>): <TT>/dev/hda1</TT> is 301, <TT>/dev/hda2</TT> is 302, and so on. When a second hard drive is used, the numbers jump to 340: <TT>/dev/hdb1</TT> is 341, <TT>/dev/hdb2</TT> is 342, and so on. For <TT>/dev/sda</TT> devices, numbering starts at 801: <TT>/dev/sda1</TT> is 801, <TT>/dev/sda2</TT> is 802, and so on. The second hard drive starts at 811: <TT>/dev/sdb1</TT> is 811,<TT> /dev/sdb2</TT> is 812, and so on. Because floppy and hard drives are usually the only devices that can act as a boot device, these numbers should suffice for all occurrences except removable media.</P>

<P>Parameters can be combined if separated by a space. For example, at the <TT>boot:</TT> prompt the following line boots the kernel called <TT>image5</TT> located on the device <TT>/dev/hda2</TT>:</P>

<!-- CODE SNIP //-->

<PRE>

image5 root=/dev/hda2 single ro

</PRE>

<!-- END CODE SNIP //-->

<P>The file system will be mounted as a read-only device. Single-user mode only will be invoked.

</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="075-077.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="080-081.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?