Lilo in Linux OS

Source: Internet
Author: User

Lilo is a boot loader program written in a Linux environment (so install and configure it all under Linux). Its main function is to boot the Linux operating system. But it can not only boot Linux, it can also boot other operating systems, such as dos,windows and so on. It can be used not only as the boot program in the boot sector of the Linux partition, but also in the whole process of fully controlling the boot Loadr in MRB. Let's take a look at a few typical scenarios where the main boot sector of the hard disk and the contents of the program within the boot sector of each partition.

(1) Only DOS one operating system installed on the computer

This situation corresponds to the DOS hard drive boot that you just introduced, as shown in 13.6.


Figure 13.6 Disk partition map with DOS only

(2) The computer is installed with DOS and Linux operating system, Linux is started by Loadin, 13.7 is shown.


Figure 13.7 booting from DOS with Loadlin

Linux in this case, the DOS of the main boot area has not changed, the boot sector of the partition has not changed, but only in the DOS configuration file Autoexec.bat added Loadin program only.

(3) Lilo is stored in the boot sector of the Linux partition, as shown in 13.8.


Figure 13.8 Lilo is stored within the boot sector of the Linux partition

In this case, Lilo resides within a basic partition on the hard disk. If you want to boot from Linux, you must set the Linux partition as the active partition. And if you want to use Windows, you have to activate the partition where Windows is located, and then reboot to get into Windows, which means you can't choose which operating system to enter from when you start up, so the multiple boot is too cumbersome. Recall the multi-boot under Windows, you just enter a F3 key at the boot, you can automatically enter the DOS6.22, this is the way we want. Windows can do it, and Lilo can certainly do it, and it can do better. (Lilo not only allows you to choose which system to boot from, it also allows you to pass parameters to the Linux kernel), see this pattern, 13.9:


Figure 13.9 Lilo multi-boot in the partition boot sector

Regardless of which partition you boot from, you can choose to enter Linux or DOS, but when booting from a DOS partition,

If you don't want to get into Linux, you'll need to step through Autoexec.bat to skip Loadlin. When booting from a Linux partition, you only need to enter the operating system name at startup (the name can be set by yourself when you configure Lilo) and you can choose which operating system to enter. This table is completely used to illustrate the Lilo installation location, in fact you may have seen, since no matter from which partition can access all operating systems, so long as there is an active partition is enough, from a convenient point of view, starting from the Linux partition is a good choice.

(4) Lilo is placed in the main boot sector of the hard drive.

As shown in 13.10. Lilo if it is selected as MRB at the time of installation, it will be responsible for the entire boot loader process, but there is a risk that it will overwrite the MBR and may cause your original system to fail to boot, so you need to back up the primary boot sector first.


Figure 13.10 Lilo placed in the main boot sector

The functionality of Lilo is actually implemented by several programs, which are:

? Map Installer: This is the program that Lilo uses to manage startup files. It can place the files required by the Lilo startup in the appropriate location (the location of these files is determined by Lilo itself) and records these locations for Lilo access. In fact, when you run/sbin/lilo this program, map installer has been working, it will boot loader write to the boot partition (the original boot loader will be backed up), create a record file-map file to map the kernel's startup files. Whenever your kernel changes (for example, the kernel is upgraded), you must run/sbin/lilo to ensure that the system is running properly.

' boot Loader: This is the part of the LILO program that is read into memory by the BIOS and is responsible for reading the boot partition of the Linux kernel or other operating system into memory. In addition, the boot loader of Linux also provides a command line interface that allows the user to choose which operating system to start and join the startup parameters.

ƒ Other files : These files mainly include the map file (/BOOT/MAP) for storing the map installer records and the configuration file (/etc/lilo.conf) that holds the Lilo configuration information. These files are required when Lilo starts, and they are typically stored in the/boot directory.

Lilo can also transfer parameters to the Linux kernel while booting Linux. As we mentioned earlier, Lilo provides a command-line interpreter that, when the system loads Lilo and displays the word "Lilo" on the screen, you can press CTRL or SHIFT (different versions of LILO may differ, my system needs to press the TAB key) and a " LILO Boot "indicates that the command line interpreter has been activated and can be entered from the keyboard. If your corresponding system boot prompt is "Linux", "DOS" then you can type "Linux" to start Linux, or type "DOS" to start Windows. If you choose to start Linux, you can also add some parameters after "Linux", and Lilo can pass these parameters to the kernel. For example:

LILO Boot:linux 1 tells the kernel to start in single-user mode.

LILO Boot:linux ether=eth0,0x280,10 tells the kernel that the port address of your first NIC is 0x280 and the interrupt number is 10.

Lilo provides a number of parameters, such as Debug, and so on, specifically these parameters and their role, please consult Lilo's text block. In addition, not all hardware needs to be supported with parameters. If your hardware device is already supported when compiling the kernel, it is not necessary to add parameters at all. In fact, only those special (and less commonly used) devices need to set the parameter value at startup, clear its port address and interrupt number, to save a lot of time to detect the port address and interrupt number.

As with default startup options, you can pre-define the parameters you want to enter at startup in/etc/lilo.conf, which avoids having to repeat the input every time you start. Let's look at a concrete example of lilo.conf, where the script is on the left, and the right side is an explanation of the program. From this example, it can be seen that lilo.conf the idea of the establishment of a DOS Config.sys similar.

#/etc/lilo.conf

# LILO configuration file

# gernerated by ' Liloconfig '

#

# Start LILO Global Section/*lilo Common configuration block */

Append = "ether=eth0,0x280,10″/* Note that this is the parameter passed to the kernel, and we write it down here so that we can avoid the hassle of typing each time it starts up. */

Boot =/dev/hda2/*lilo installed on the partition table on partition second of the hard drive 1 */

Delay = 50/* Give the user the choice of which operating system to start the wait time */

VGA = normal/* Monitor set to standard vga*/

# RAMDisk = 0/* No virtual boot disk installed */

# End LILO Global section//Universal configuration block ended */

# Linux Bootable partition config begins/* configuration block for starting Linux */

Root =/dev/hda2/*linux is installed on the second partition on drive 1 */

Image =/vmlinuz/* Select Vmlinuz as the kernel in the root directory */

lable = Linux/* Startup selected identifier is linux*/

Image =/zimage-2.4.18/* When booting Linux, you can select multiple cores. For example, if we compile a new kernel and want to start it, just write the program here, and of course, don't forget to run lilo to change the map file first. */

Label = Newkernel

Read-only/* Read-only installation to prevent mis-operation in startup */

#Linux bootable partition config ends/*linux configuration block End */

#DOS Bootable partition config Begens/* configuration block for starting DOS */

other =/DEV/HDA1/* The boot loader of the operating system is installed in the partition table of partition one of hard disk 1 */

Label = DOS/* Startup selected identifier is dos*/

Table =/dev/hda/* The root directory of the operating system is on partition one of hard disk 1 */

# Dos bootab le partion config ends/*dos configuration block End */

Lilo details for Linux OS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.