⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user.tex

📁 linux 的引导程序源码The Microsoft&reg Windows&reg Software Development Kit (SDK) provides the documentation
💻 TEX
📖 第 1 页 / 共 5 页
字号:
%% Copyright 1992-1998 by Werner Almesberger.% Copyright 1999-2000 by John R. Coffman (version 21-3)% All rights reserved.%% See file COPYING for details.%%%def%:=%:\begin{verbatim}%:LILO - Generic Boot Loader for Linux ("LInux LOader") by Werner Almesberger%:===========================================================================%:%:   NOTE:  This document is no longer maintained.  However, it is%:   still current.  Changes to LILO for versions 21.2 and later are%:   documented in detail in the 'man' pages for 'lilo' and 'lilo.conf'.%:   Refer to them first, then to this document.%:%:  %:Version 21-4 (release) -- John Coffman <johninsd@san.rr.com>%:%:Minor changes suggested by Werner to show that this release is derived%:from the source code to his version 21.  Added VERSION_MAJOR and %:VERSION_MINOR to replace VERSION.  The file VERSION is replaced by %:'version.h'.%:%:The first and second stage loaders have been modified so that ONLY%:'lba32' will use EDD packet calls.  'linear' will now always ask the%:BIOS for the disk geometry, and then use C:H:S addressing.%:%:%:Version 21-2  -- John Coffman <johninsd@san.rr.com>%:%:This version was created to allow booting on disks larger than 8.4Gb using%:the Enhanced BIOS call (int 0x13, AH=0x42) and the packet-call interface.%:These calls are supported on post-1998 systems, and through software BIOS%:extensions such as EZ-DRIVE(tm).  %:%:My primary objective in making these changes to LILO, is not to break any-%:thing.  Hence, the 32-bit direct addressing of sectors is supported by a%:new keyword in the 'lilo.conf' file:  "lba32".  This keyword is mutually%:exclusive with the keyword "linear".  On the command line, these options%:are invoked with the new "-L" switch, or the old "-l" switch, respectively.%:%:Apologies to Werner Almesberger for not communicating these changes/addi-%:tions to him directly; but I have not been able to contact him by e-mail%:at the address he provided in the latest 'lilo.lsm' file.  I do not want%:versions of LILO to get out-of-step.%:%:Disk sector addresses are conveyed from the Map Installer (lilo executable)%:to the boot loaders, first- and second-stages through a 5 byte structure:%:%:     sector    [1..63] plus 2 high bits of Cylinder%:     cylinder  [0..1023] low eight bits in this byte%:     device    [0..3] for floppies, [0x80..0x8F] for hard disks%:     head      [0..254] no, the max is 254, not 255%:     count     [1...] number of sectors to transfer%:     %:The first two bytes are normally loaded into the CX register, the second two%:bytes into the DX register, and the last byte into the AL register.  This is%:the call used for the C:H:S addressing scheme of the original IBM-PC BIOS.%:LILO checks that the 64Kb DMA boundary is never crossed by a call, and that%:the count never exceeds the sector count of one track on the disk.%:%:When 'linear' is specified, a 24-bit, 0 based addressing scheme is employed.%:The low 8 bits are in 'sector'; the middle 8 bits in 'cylinder'; and the high%:8 bits are in 'head'.  To flag this as a 'linear' address, the 'device' byte%:has bit 6 set (mask 0x40 or'ed in).  The count field is a maximum of 128,%:since anything greater would cross a 64Kb DMA boundary.  It is up to the %:loader code (second stage only), to check that no track boundary is crossed.%:%:The situation is more complicated with 'lba32' addressing.  It is flagged with%:bit 5 of the 'device' byte being set (mask 0x20 or'ed in).  The 32-bit address%:is spread over the 'sector', 'cylinder', 'head', and 'count' fields, from low%:byte to high byte, respectively.  Whenever this full 32-bit address is%:specified explicitly, the actual sector count to transfer is implied to be%:one (1), and this fact is flagged in the 'device' byte by setting bit 5%:(mask 0x10 or'ed in).  When a multi-sector transfer is called for, the high%:8-bits of the address are NOT specified explicitly, but are assumed to be%:the same as the previous transfer, the 'count' of sectors to transfer will%:be in the range [2..127], and bit 5 (mask 0x10) of the 'device' byte will be%:clear.%:%:The first-stage loader uses single sector transfers only, so it uses a%:simplified disk read routine, always assumes a sector transfer count of 1,%:and always assumes that the full 32-bit address of the sector is specified%:when 'lba32' mode is detected in the 'device' byte.  However, the second-%:stage loader is capable of multi-sector transfers when map-compaction has%:been used (-c switch, or 'compact' global option), so it uses the fully%:capable read routine to load the -initrd- image, and the -kernel- image.%:%:Both 'linear' and 'lba32' will use the Enhanced BIOS packet calls, if they%:are available.  Otherwise, the disk address is converted to C:H:S, using the%:disk geometry returned by (int 0x13, AH=8).  If cylinder overflow occurs --%:i.e., cylinder > 1023, then error code '9f' is issued.%:%:The BIOS calls used to implement large disk booting conform to the Enhanced%:Disk Drive Specification, version 3.0, rev 0.8, dated March 12, 1998.  This%:document is available on-line from Phoenix Technologies Ltd., at:%:   %:   http://www.phoenix.com/products/specs.html%:%:Known bugs:%:   The chain loader, 'os2_d.b', still will not boot OS2 4.0 from a secondary%:   partition on my "D:" drive.  Boot Manager can, and I am still working on%:   the problem.%:----------------------------------------------------------------------------%:%:%:Version 21%:%:Important: The file INCOMPAT contains vital (in)compatibility information%:           for this release of LILO. Read it before proceeding.%:%:Installing boot loaders is inherently dangerous. Be sure to have some means%:to boot your system from a different media if you install LILO on your hard%:disk.%:%:%:There is also a LaTeX version of this document in the "doc" directory.%:It is much nicer to read than pure ASCII.%:%:%:Installation%:------------%:%:Please read the file INCOMPAT for compatibility notes.%:%:The installation procedure is described in the section "Normal first-time%:installation". Please read "Booting basics" for the whole story.%:%:*** QUICK INSTALLATION ***%:%:    If you want to install LILO on your hard disk and if you don't want%:    to use all its features, you can use the quick installation script.%:    Read QuickInst for details.%:%:%:\end{verbatim}%%beginskip\documentstyle[fullpage]{article}\parindent=0pt\parskip=4pt\tolerance=9000\hyphenation{hexa-decimal}% Okay, what follows is more TeX than LaTeX ...\def\hditem#1{\hbox to 1.2in{#1\hfil}}\def\boottwo#1{$$  \bf  \begin{tabular}{|ll|}    \hline    \hditem{\rm Master Boot Record} & \hditem{\rm Operating system} \\    \hline    #1 \\    \hline  \end{tabular}  $$}\def\bootthree#1{$$  \bf  \begin{tabular}{|lll|}    \hline    \hditem{\rm Master Boot Record} & \hditem{\rm Boot sector} &      \hditem{\rm Operating system} \\    \hline    #1 \\    \hline  \end{tabular}  $$}\def\bootfour#1{$$  \bf  \begin{tabular}{|llll|}    \hline    \hditem{\rm Master Boot Record} & \hbox to 1.1in{\rm Boot sector\hfil} &      \hditem{\rm Operating systems} & \hbox to 0.4in{\hfil} \\    \hline    #1 \\    \hline  \end{tabular}  $$}\def\sep{\rightarrowfill &}\def\empty{&}\def\branch{\hfill$\longrightarrow$ &}\def\cont{---\,$\cdots$}\def\key#1{$[$#1$]$}\def\LILO{LILO}\def\meta#1{{\it #1\/}}	% ... <blah> ...\def\path#1{{\tt #1}}   % ... /foo/bar ...\def\raw#1{{\tt #1}}	% ...  raw output  ...\def\craw#1{{\tt #1}}	% ...  raw output  ...\def\name#1{{\sf #1}}	% ... FooBar ...\def\emphasize#1{{\bf #1}} % ... _don't_ ...\def\unit#1{\hbox{\tt #1}} % ... \unit{-x foo} ...%%def\\key{([^{}]*)}=[$1]%%def\\LILO=LILO%%def\\meta{([^{}]*)}=<$1>%%def\\path{([^{}]*)}=$1%%def\\raw{([^{}]*)}=~$1~%%cmd\\craw{([^{}]*)}=((($x = $1) =~ tr/a-z/A-Z/), $x)%%def\\name{={%%def\\emphasize{([^{}]*)}=\\_$1\\_%%def\\underline{([^{}]*)}=$1%%def\\begin{command}=\\raw{$SI$SI$SI$SI%%def\\end{command}=$SO$SO$SO$SO}%%def\\addtocounter{([^{}]*)}{([^{}]*)}=~%%def\\hbox{([^{}]*)}=$1%%def(\\unit{[^{} ]*) ([^{}]*})=$1~$2%%def\\unit{([^{} ]*)}=$1%%def{\$([^{}])\$}=$1%%def%4=    %	^^^^%       four invisible spaces here%%def%;=        %	^^^^^^^^%       eight invisible spaces here\newenvironment{command}{\def\[{$\bigl[$}\def\]{$\bigr]$}\def\|{$\big\vert$}%  \parindent=-2em\advance\leftskip by -\parindent\vskip -\parskip~\par  \begingroup\tt\textfont0=\font}{%  ~\endgroup\par\advance\hoffset by \parindent}\begin{document}\title{\LILO \\  \Large  Generic boot loader for Linux \\  Version 21 \\ ~\\  \bf User's guide}\author{Werner Almesberger \\  {\tt Werner.Almesberger@epfl.ch}}\date{December 4, 1998}\maketitle{  \parskip=-1pt  \setcounter{tocdepth}{2}  \tableofcontents}%%endskip~\\\LILO\ is a versatile boot loader for Linux. It does not depend on a specificfile system, can boot Linux kernel images fromfloppy disks and from hard disks and can even act as a ``boot manager'' forother operatingsystems.\footnote{PC/MS-DOS, DR DOS, OS/2, Windows 95, Windows NT, 386BSD,SCO UNIX, Unixware, $\ldots$}One of up to sixteen different images can be selected at boot time.Various parameters, such as the rootdevice, can be set independently for each kernel. \LILO\ can even beused as the master boot record.This document introduces the basics of disk organization and booting,continues with an overview of common boot techniques and finally describesinstallation and use of \LILO\ in greater detail. The troubleshootingsection at the end describes diagnostic messages and contains suggestionsfor most problems that have been observed in the past.Please read at least the sections about installation and configuration ifyou're already using an older version of \LILO. This distribution isaccompanied by a file named \path{INCOMPAT} that describes furtherincompatibilities to older versions.For the impatient: there is a quick-installation script to createa simple but quite usable installation. See section \ref{quickinst} fordetails.But wait $\ldots$ here are a few easy rules that will help you to avoidmost problems people experience with \LILO:\begin{itemize}  \item \emphasize{Don't panic.} If something doesn't work, try to find    out what is wrong, try to verify your assumption and only then attempt    to fix it.  \item Read the documentation. Especially if what the system does doesn't    correspond to what you think it should do.  \item Make sure you have an emergency boot disk, that you know how to    use it, and that it is always kept up to date.  \item Run \path{/sbin/lilo} \emphasize{whenever} the kernel or any part    of \LILO, including its configuration file, has changed. When in doubt,    run it. You can't run \path{/sbin/lilo} too many times.  \item If performing a destructive upgrade and/or erasing your Linux    partitions, de-install \LILO\ \emphasize{before} that if using it as the    MBR.  \item Don't trust setup scripts. Always verify the \path{/etc/lilo.conf}    they create before booting.  \item If using a big disk, be prepared for inconveniences: you may have    to use the \craw{linear} option.\end{itemize}\newpage\subsection*{System overview}\LILO\ is a collection of several programs and other files:\begin{description}  \item[The map installer] is the program you run under Linux to put all    files belonging to \LILO\ at the appropriate places and to record    information about the location of data needed at boot time. This program    normally resides in \path{/sbin/lilo}. It has to be run to refresh that    information whenever any part of the system that \LILO\ knows about    changes, e.g. after installing a new kernel.  \item[Various files] contain data \LILO\ needs at boot time, e.g. the    boot loader. Those files normally reside in \path{/boot}. The most    important files are the boot loader (see below) and the map file    (\path{/boot/map}), where the map installer records the location of    the kernel(s).\footnote{\LILO\ does not know how to read a file system.    Instead, the map installer asks the kernel for the physical location of    files (e.g. the kernel image(s)) and records that information. This    allows \LILO\ to work with most file systems that are supported by    Linux.} Another important file is the configuration file, which is    normally called \path{/etc/lilo.conf}  \item[The boot loader] is the part of \LILO\ that is loaded by the BIOS    and that loads kernels or the boot sectors of other operating systems.    It also provides a simple command-line interface to interactively    select the item to boot and to add boot options.\end{description}\LILO\ primarily accesses the following parts of the system:\begin{description}  \item[The root file system partition] is important for two reasons: first,    \LILO\ sometimes has to tell the kernel where to look for it. Second, it    is frequently a convenient place for many other items \LILO\ uses, such    as the boot sector, the \path{/boot} directory, and the kernels.  \item[The boot sector] contains the first part of \LILO's boot loader. It    loads the much larger second-stage loader. Both loaders are typically    stored in the file \path{/boot/boot.b}

⌨️ 快捷键说明

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