Lilo in Linux

zhaozj2021-02-17  82

Lilonull Jiang Yongzhong in Linux

Back to〗 Forward〗

Depth of Linux's LILO: Jiang Yongzhong Linux boot can be used in many ways, its loader LILO (Linux Loader) is a flexible boot loader, compared with other commonly used boot loader, LILO boot mode appear more artistic In-depth understanding of its in-depth, will help us to handle multi-system, network boot, large hard drives, and large memory. First, LILO's boot mechanism is well known that the initial start of the computer is controlled by the BIOS. After initialization of some hardware (eg: memory, keyboard, etc.), it will try to load the hard disk's main boot record (MBR) or floppy guide fan Area. The MBR can operate in two ways, which is positioned to the active partition and load the corresponding guiding sector, and then complete the loading of the basic components of the operating system within the partition; second, it is loaded directly from a designated partition. Information, and through which boot loaders such as LILO, OS / 2 Boot Loader and Partition Magic can be configured in this way. The boot sector of the floppy is equivalent to the boot sector of the hard disk activity partition, which is usually used to install an operating system on the soft disk. From this, it can be seen that as long as the LILO is installed on the MBR, the active partition, or the boot floppy disk, it can take over the control of the computer, and then the subsequent boot process is completed by LILO. There is a boot table address code in LILO, where it can be positioned to Linux kernel files, which can be used according to the cylindrical / magnetic head / sector (CHS) mode, and LBA Linear block mode, so even if some SCSI control program LILO can work well. When LILO is positioned, after the pre-boot process, the prompt: LILO BOOT: At this point, the system allows the selection to boot different operating systems or different kernel configurations, press the Tab key to display the option list, then enter optional Or directly Enter the default configuration, if you select the boot Linux, you can also transfer parameters to the system kernel.

Lilo has more flexibility compared to other system bootloaders, and its lead-guided ways are also more colorful. ● When LILO is installed on the MBR, active partition, or boot floppy disk of the hard disk, as the original bootstrap, it can boot any hard disk any partition of Linux and other operating systems; ● In addition to the guiding sector, it There is no implied file, nor does it need to use a specific zone. Its configuration file can be in any partition, even in a subdirectory that is unhappy with Linux; ● It can boot a few different Core configuration, even several different kernels; ● It can guide multiple Linux versions on the same machine; ● It boots Linux from the network. The flexibility of LILO makes its configuration is quite complicated. When there are multiple systems coexisting, it is recommended to install other operating systems first, and then load Linux so that LILO is relatively simple. Second, several important LILO boot parameters LILO's boot parameters have a lot, only for some important parameters. 1. "Boot =" This parameter indicates a device name (such as: / dev / had) containing the boot sector. If this item is omitted, the leading sector is read from the current root partition.

2. "root =" This parameter tells the kernel which device is used as the root file system when the setup is set, and its set value is the device name of the root file system, which is available: (1) / dev / hdan ~ / dev / hddn: ST-506 compatible with hard disk, N partitions (2) / dev / sdan ~ / dev / sden: SCSI compatible hard disk, N partitions (3) / DEV / XDan ~ / dev / xdbn: XT compatible hard disk, N partitions (4) / dev / fdn: floppy disk, A: (n = 0) or B: (n = 1) (5) / DEV / NFS: Signs of the root file system by the network 3. "NFSROOT =" If you need to provide the root file system through NFS to boot the disk-free workstation, this parameter specifies the ride, directory, and NFS where the network root file system is located. Format is: nfsroot = (:) (, nfs_options>) 4. "NFSADDRS =" Sets the various network interface addresses required for network communication, if not the parameters, the kernel will try to use reverse Address Analysis Agreement (RARP) or Start Agreement (Bootp) identifies: nfsaddrs = : : : : : : 5. "Image =" Specifies the kernel file of Linux. 6. "DELAY =" setting the waiting time before booting the first image. 7. "Disk =" This parameter defines a non-standard parameter for a particular hard disk.

8. "Append =" transmits an optional parameter line for the kernel, and the typical application is to specify parameters for hard disk automatically identify by the system, such as: append = "HD = 64, 32, 202" 9. "Label = "This parameter specifies a name for each image for booting. 10. "Read-Only" settings in a read-only mode to root file system for File System Consistency Check (FSCK). 11. "Install =" Install a specified file as a new boot sector, default to /boot/boot.b. 12. "Loader =" Description The chain loader used, defaults to /boot/chain.b, if not started from the first hard disk or floppy disk, then this option must be explained. 13. "Table =" describes the device name containing the partition table. If this parameter is ignored, the bootloader will not pass the partition information to the bootable operating system. When the partition table pointed to this parameter is modified, the / sbin / lilo must be re-run. 14. The program executed when the kernel initialization is initialized, and the process is usually in init, getty, rc, and sh, version 1.3.43 to execute / sbin / init description command line, if there is a problem during the boot process If INIT = / bin / sh can be set directly to the shell. 15. "RamDisk_start =" Since the kernel cannot be placed in a compressed memory file system image, in order to make the kernel image can be placed in a floppy disk, add "ramdisk_start = ", such a kernel? start execution. 16. "MEM =" The purpose of this parameter is the number of memory used for Linux: such as MEM = 96MB, the purpose of the purpose is that the MEM = NOPENTIUM tells the kernel not to use the 4MB pagination table.

17. "VGA =" Sets the display mode, such as 80 × 50, 132 × 44, etc. Third, the LILO typical configuration method is usually, Linux installer itself can complete the LILO installation configuration, thereby solving the boot problem of multiple systems. If the system cannot automatically complete this configuration, you can modify the configuration by manual modification. File /etc/lilo.conf to achieve boot under different conditions. 1. There is only one suggestion when the system can automatically complete the configuration: install lilo to the root of the Linux partition, not MBR. Suppose there is DOS / Windows in the current HDA1 installed Linux, and /etc/lilo.conf is approximately as follows: boot = / dev / hda2 # Specify boot position compact delay = 50 # delay 5 second root = current # 根 当 当 i = = / boot / vmlinuz # Specifies Linux kernel file label = linux # with Linux for Representative Name Other = / dev / hda1 # Other operating systems The partition table = / dev / hda # specifies the partition table Hard disk label = DOS # with DOS representative name 2. When the system cannot automatically complete the configuration, the system cannot automatically complete the configuration. It is not more than two: (1) BIOS can't see the root partition of Linux directly; (2) BIOS You can only read the first 504MB of the standard IDE hard drive. At this time, you must follow a basic principle: establish a smaller Linux partition that the BIOS can access, which contains the kernel files, mapping files, and chain loaders, etc., and the root can be another independent partition. . As for other details on the configuration, we will explain the following examples. Example 1: The main hard disk is an IDE interface, the second hard disk is the SCSI interface, and the root file is on SCSI.

Countermeasure: A smaller Linux partition (/ DEV / HDA2) is divided on the IDE hard disk, which contains basic files, and is switched to / u2. The main content of its profile /etc/lilo.conf is: boot = / DEV / HDA # lilo Mount MBR Install = / U2 / etc / lilo / boot.b # from Boot.b installed LILO boot record MAP = / u2 / etc / lilo / map # installer establishes this mapping file, Tell the boot load program COMPACT TIMEOUT = 50 image = / u2 / vmlinuz # kernel files should be copied in advance to / u2 Label = Linux root = / dev / sda1 # Tell the kernel root system to read-only on the SCSI hard drive Other = / dev / hda1 loader = / u2 / etc / limited / chain.b # Indicates Loader Label = DOS Example 2: A standard IDE big hard disk needs to be installed Linux and DOS / Windows. For big hard disk problems, many people only know less than 1024 cylinders, and I don't know why standard IDE hard disks can only recognize 504MB. In fact, the BIOS's INT13 call is a CHS code of three bits, and 10 is a column number, 8 bit is a magnetic head number, and 6 is a sector number. Possible cylindrical numbers are 0 to 1023, and the available head numbers are 0 ~ 255, and the possible sector numbers on the track are 1 to 63, and the 24 bits can be addressed up to 845,5716864 bit group (7.875GB). But unfortunately, the standard IDE interface allows 256 sectors / tracks, 65536 column and 16 heads. Itself can access 237 = 137438953472 (128 GB), but there are only 63 sectors of the BIOS and 1024 cylindrical restrictions, only 528482304 (504 MB) can be derived.

转载请注明原文地址:https://www.9cbs.com/read-31571.html

New Post(0)