?? readme
字號:
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 derivedfrom 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 theBIOS 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 usingthe Enhanced BIOS call (int 0x13, AH=0x42) and the packet-call interface.These calls are supported on post-1998 systems, and through software BIOSextensions 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 anew keyword in the 'lilo.conf' file: "lba32". This keyword is mutuallyexclusive with the keyword "linear". On the command line, these optionsare 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-mailat the address he provided in the latest 'lilo.lsm' file. I do not wantversions 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 twobytes into the DX register, and the last byte into the AL register. This isthe 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 thatthe 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 high8 bits are in 'head'. To flag this as a 'linear' address, the 'device' bytehas 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 withbit 5 of the 'device' byte being set (mask 0x20 or'ed in). The 32-bit addressis spread over the 'sector', 'cylinder', 'head', and 'count' fields, from lowbyte to high byte, respectively. Whenever this full 32-bit address isspecified explicitly, the actual sector count to transfer is implied to beone (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 high8-bits of the address are NOT specified explicitly, but are assumed to bethe same as the previous transfer, the 'count' of sectors to transfer willbe in the range [2..127], and bit 5 (mask 0x10) of the 'device' byte will beclear.The first-stage loader uses single sector transfers only, so it uses asimplified disk read routine, always assumes a sector transfer count of 1,and always assumes that the full 32-bit address of the sector is specifiedwhen 'lba32' mode is detected in the 'device' byte. However, the second-stage loader is capable of multi-sector transfers when map-compaction hasbeen used (-c switch, or 'compact' global option), so it uses the fullycapable read routine to load the -initrd- image, and the -kernel- image.Both 'linear' and 'lba32' will use the Enhanced BIOS packet calls, if theyare available. Otherwise, the disk address is converted to C:H:S, using thedisk 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 EnhancedDisk Drive Specification, version 3.0, rev 0.8, dated March 12, 1998. Thisdocument is available on-line from Phoenix Technologies Ltd., at: http://www.phoenix.com/products/specs.htmlKnown 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 21Important: 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 meansto boot your system from a different media if you install LILO on your harddisk.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-timeinstallation". 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. LILO is a versatile boot loader for Linux. It does not depend on a specific file system, can boot Linux kernel images from floppy disks and from hard disks and can even act as a "boot manager" for other operating systems.* * PC/MS-DOS, DR DOS, OS/2, Windows 95, Windows NT, 386BSD, SCO UNIX, Unixware, ...One of up to sixteen different images can be selected at boot time. Various parameters, such as the root device, can be set independently for each kernel. LILO can even be used 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 describes installation and use of LILO in greater detail. The troubleshooting section at the end describes diagnostic messages and contains suggestions for most problems that have been observed in the past.Please read at least the sections about installation and configuration if you're already using an older version of LILO. This distribution is accompanied by a file named INCOMPAT that describes further incompatibilities to older versions.For the impatient: there is a quick-installation script to create a simple but quite usable installation. See section "Quick installation" for details.But wait ... here are a few easy rules that will help you to avoid most problems people experience with LILO: - _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. - Read the documentation. Especially if what the system does doesn't correspond to what you think it should do. - Make sure you have an emergency boot disk, that you know how to use it, and that it is always kept up to date. - Run /sbin/lilo _whenever_ the kernel or any part of LILO, including its configuration file, has changed. When in doubt, run it. You can't run /sbin/lilo too many times. - If performing a destructive upgrade and/or erasing your Linux partitions, de-install LILO _before_ that if using it as the MBR. - Don't trust setup scripts. Always verify the /etc/lilo.conf they create before booting. - If using a big disk, be prepared for inconveniences: you may have to use the LINEAR option. System overview---------------LILO is a collection of several programs and other files: 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 /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. Various files contain data LILO needs at boot time, e.g. the boot loader. Those files normally reside in /boot. The most important files are the boot loader (see below) and the map file (/boot/map), where the map installer records the location of the kernel(s).* Another important file is the configuration file, which is normally called /etc/lilo.conf 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. * 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.LILO primarily accesses the following parts of the system: 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 /boot directory, and the kernels. 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 /boot/boot.b The kernel is loaded and started by the boot loader. Kernels typically reside in the root directory or in /boot. Note that many of the files LILO needs at boot time have to be accessible with the BIOS. This creates certain restrictions, see section "BIOS restrictions".Introduction============The following sections describe how PCs boot in general and what has to be known when booting Linux and using LILO in particular.Disk organization-----------------When designing a boot concept, it is important to understand some of the subtleties of how PCs typically organize disks. The most simple case are floppy disks. They consist of a boot sector, some administrative data (FAT or super block, etc.) and the data area. Because that administrative data is irrelevant as far as booting is concerned, it is regarded as part of the data area for simplicity. +---------------------------+ |Boot sector| | |-----------+ | | | | Data area | | | | | +---------------------------+The entire disk appears as one device (e.g. /dev/fd0) on Linux.The MS-DOS boot sector has the following structure: +------------------------+ 0x000 |Jump to the program code| |------------------------| 0x003 | | | Disk parameters | | | |------------------------| 0x02C/0x03E | | | Program code | | | | | |------------------------| 0x1FE | Magic number (0xAA55) | +------------------------+LILO uses a similar boot sector, but it does not contain the disk parameters part. This is no problem for Minix, Ext2 or similar file systems, because they don't look at the boot sector, but putting a LILO boot sector on an MS-DOS file system would make it inaccessible for MS-DOS.Hard disks are organized in a more complex way than floppy disks. They contain several data areas called partitions. Up to four so-called primary partitions can exist on an MS-DOS hard disk. If more partitions are needed, one primary partition is used as an extended partition that contains several logical partitions.The first sector of each hard disk contains a partition table, and an extended partition and _each_ logical partition contains a partition table too. +--------------------------------------------+ | Partition table /dev/hda | | +------------------------------------------| | | Partition 1 /dev/hda1 | | | | | |------------------------------------------| | | Partition 2 /dev/hda2 |
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -