LILO configuration guide (finishing version)
1. General boot boot process. On the PC, the initial startup was completed by the BIOS. When the boot self-test is over (POWER-ON Self Test, POST), the BIOS attempts to read into the first sector of the floppy disk, regarding it as the boot sector. If there is no flush, try reading the first sector of the hard disk. New BIOS can change this order, start from the hard drive. Even from the CD. Since most BIOS does not provide SCSI support, if you want to start from the SCSI disk, the SCSI adapter provides his own BIOS. If you can't find anything, the old BIOS will launch built-in ROM Basic, or print "NO ROM-Basic "The startup of the operating system is completed. Since the boot sector is relatively small, it is usually its main task to read the second Loader, and the second Loader reads the third Loader until the entire operating system is fully read. DOS Guidance Area: Offset 0x000 JMP XX Near Jump INTO The Program Code 0x003 Disk Parameters 0x03e Program Code Loading The DOS KERNEL 0X1FE 0XA55 MAGIC NUMBER FOR BIOS visible, the boot area is relatively simple. Its length is always 512 bytes. The above, disk parameters are only meaningful to DOS. It is important that the boot area starts from 0 and ends with BIOS's Magic Number. It is relatively simple from the floppy disk because there is only one guiding sector: the first sector. The hard disk is difficult, it is divided into many partitions. However, the BIOS is at all regardless of the partition information. It is like a hard disk as a floppy disk, and it is still read into the first partition, called: Master Boot Record. (MBR). So MBR should also be the same as the structure described above: starting from 0, At the end of the MAGIC NUMBER of BIOS, there is a partition table. FIG follows: OFFSET Length 0x000 0x1BE code loading and starting the boot sector of the active partitian 0x1BE 0x010 partition1 0x1CE 0x010 partition2 0x1DE 0x010 partition3 0x1EE 0x010 partition4 0x1FE 0x0012 0xAA55 Disk parameters occupy 16 bytes of each partition information, structured as follows: 1 BOOT Boot flag: 0 = not active, 0x80 active 1 HD Begin: head number 2 SEC CYL Begin: sector and cylinder number of boot sector 1 SYS System Code: 0x83 linux, 0x82 linux swap etc. 1 HD End: head number 2 SEC CYL End : Sector and Cylinder Number of Boot Sector 4 Low Byte High byte Relative Sector Number of Start Sector 4 Low Byte High Byte Number of Sectors In The Partition So the hard disk can have 4 partitions. These four partitions are called the primary partition: Primary Prititions. If they are not enough, the so-called extension partition can be set. The extension partition contains at least one logical partition. The first sector structure of the extension partition is similar to MBR, and its first entry of its partition table corresponds to the first logical partition. If there is a second logical partition, the second entry of the partition table contains a pointer. This pointer points to an address behind the first logical partition. This address contains a partition table.
The first entry of the partition table corresponds to the second logical partition. This makes up a linked list to extend the partitions can have any number of logical partitions. Each primary partition and extension zone contain a guiding sector. The system can only start from one of these places. Boot flag determines which area is booted. It turns out that only the primary partition, so MS-DOS's FDISK and most similar tools can only activate the primary partition .. MBR code To make the following: 1: Determine the activity partition. 2: Use the BIOS to read the active partition start sector. 3: Skip 0 where you start the sector. MBR's space is enough to complete these work. As mentioned above, each partition theory comprises a guiding sector, and the presence of the second hard disk is also included and the first similar structure. MBR can accommodate a complex boot program. The so-called Boot Manager, dynamic decision activity partition. Linux provides us with Lilo 2, Lilo: The Linux Loader LILO boot sector includes a space for a partition table, so LILO can be installed in the MBR or mounted in a partitioned boot sector. LILO has all the features of the DOS boot sector, and it can also boot logical sectors and second hard disk partitions. LILO can also cooperate with additional guides (eg NT Loader) so that users can have many options. (Note: The following headings are to prevent ambiguity, using the original) 2.1 LILO Started by MS-DOS MBR If the system has at least one Linux primary partition, (non-exchanging area, on the first hard disk), then LILO can One installed in these partitions. When the LILO corresponds to the partition being activated, the boot process is as follows: BIOS reads into the MBR MBR to read the active primary partition: the partition where the LILO is located. LILO boots Linux or additional operating systems. To guide other OS and do not use LILO very simple, activate the partition. There is no change in the Linux partition, very safe. 2.2 LILO Started by a Boot Manager If the user does not want to delete the old boot manager, or an OS LILO cannot boot, it can be considered this path. 1. If Boot Manager can guide the extension area, then it is a good place to LILO. 2. If Boot Manager can boot the second hard disk partition, Linux can be mounted on the second hard disk. 3. Some boot manager can even boot logical partitions, which can be installed on logical partitions. Of course, pay attention to the following: 1 Some operating systems directly rewrite MBR, which will destroy the original Boot Manager. 2 Re-dividing will destroy the guiding sector of the extended partition, which is LILO might want to reload. When installing a new system, whether you want to re-install (Linux) rely on new Boot Manager, or the LILO boot sector is logged out, or boot manager provides a boot item. Re-partition or partition formatting will delete all LILO and Linux. 2.3 LILO occupies MBR, if the entire Linux system is on the second hard disk, and the first hard disk does not extend the partition, then LILO is only installed on the MBR. In this way, the old MBR will be rolled out, so before installing the LILO, the old MBR (including the partition table) is to be backed up. There are many tools in DOS to accomplish this task.
Under Linux, this backup: # dd if = / dev / had of = / backup / mbr bs = 512 count = 1 Write command: # dd if = / backup / mbr of = / dev / had BS = 446 count = 1 This, the original MBR is written, but does not include a partition table. If the partition table is also restored, then BS = 512. Note that this new partition table will be destroyed! 2.4 LILO files related to LILO is usually placed in / boot / under, the configuration file lilo.conf is / etc / under. The mapping file containing the actual boot system information has / sbin / lilo installation. For any LILO installation, the configuration file should be set to suit your personal needs. The Configuration File: The configuration file is basically, the configuration file is some variable assignment. Each line contains a marker variable or a variable assignment. The configuration file is assigned to several districts by special variables, and each zone boots a Linux or other OS. Explain the common line: boot = device Description that device or which partition Contains the guiding sector. If you do not assign a value to the Boot, take the current default. Compact activation a mode, in which LILO requests to read several partitions to the BIOS. This greatly shortens the load time, especially from the floppy disk. Delay = TENTHS is in 10 seconds, which specifies that LILO will wait for the user to wait for the user before booting the first boot configuration. If no definition is defined, direct boot. LINEAR makes LILO to generate linear addresses without using the usual sector / head / cylinder mechanism. The Linux address mechanism can do not rely on the physical structure of the disk. Install = boot sector uses the specified Boot Sector to write the boot sector, default with /boot/boot.b disktab = disktab Use the specified disktab, default to save the hard disk physical structure information. Map = map file Description Mapping file path. Message = file Specifies a file that will be displayed in LILO boot. If the file is not explained, it will only appear "LILO". Verbose = Level Description Lilo's debug level. From 0 (not displayed) to 5 (all status information). Backup = Backup file The backup file for the sector content is previously guided. The default use /boot/boot.device number force-backup = backup file and backup are the same, and if the backup file exists, it is overwritten. Prompt specifies that you want to select the kernel you want to boot by the keyboard. Will you choose from. Timeout = TENTHS sets a timeout value, and there must be a keyboard input within this time, otherwise the first configuration is used. Similarly, if it is timeout, you cannot enter the password again. In general, the default value is infinite. Note: DELAY AND TIMEOUT (Joe believes), DELAY is "LILO" After the user must have an input for the longest time. Timeout is the user's maximum interval for the user after the user is selected after any key. Serial = Port, BPS Parity Bits Sets the serial parameters. If LILO will get serial parameters from this file. If one is invalid, all three parameters are invalid.
Port Select one from four standard serial ports: 0 corresponds to COM1 or / DEV / TTYS0. The supported baud rate range is: 100-9600. All check settings are supported (N: NONE, E: Even, O: ODD) BITS 7 or 8. The default is serial = 0,2400n8. Ignore-Table allows LILO to ignore the destroyed partition table. FIX-TABLE allows LILO to transform each partition (Sector / Head / Cylinder) address to linear addresses. Typically, the partition address begins with Cylinder Boudary. Some operating systems will change this. Since LILO can only write its starting sector on a partition consistent, the incorrect 3D address can be corrected with fix-table. However, this correction cannot be guaranteed to be forever, so the retardation area is to ensure that alignment cylinder boudary is the best choice. Password = password Sets Password Restricted to relax the restriction of Password. Only the user wants to pass the additional startup parameters to the kernel, password Optional is required to allow configuration to have a few kernels, or do not exist. If Optional, LILO will print some error messages and then exit. Each configuration boot from the LILO starts from the Image line. Image = kernel label = name image contains the kernel to be booted. Label is selected for the user. Image lines typically point to a device, such as / dev / fd0, which can be found in the range of the kernel to indicate it. Range = Range Range can be represented by Start Sector -End Sector or Start Sector Length. For example: image = / dev / fd0 label = floppy range = 1 512 The following variable assignment may occur: append = string transmits String as the boot parameter to the kernel. For example, hardware parameters. Literal = string and append are not much. However, he will rush away the original setting. So you can't be explained globally. Ramdisk = size Sets the size of the RAM DISK. Read-Only Read-Write Sets the way root file system access. Root = Device Sets the device where the root file system exists. VGA = MODE screen settings. Possible modes are: Normal, Extended and Ask. The following settings are for other operating systems: logader = loader is said to boot the file of the operating system. By /boot/chain.b. In addition, LILO contains the following loader: OS2_D.B can boot OS / 2 any_d.b from the second hard disk, attempting to turn the two hard drives before booting the operating system, so that Guide the OS on the second hard disk illustrates a device that stores the OS that is booted on a partition of the device. If there is no explanation of Table, LILO will not pass the information to the osunsafe to be booted. Guided OS check. This setting is only used when you want to boot from a floppy disk. Without this setting, each Map Installer starts running, the boot disk is inserted into the floppy drive. The DiskTab file disktab file contains physical structure information for devices to be booted by LILO. Typically, this information can be obtained from the device driver. So, only this method will not use the DiskTab file when it is not.