Article Title: detailed analysis of the boot guide process of Linux system programs. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
An attractive feature of Linux is that users can customize the entire system by themselves. However, you can run a "mini" Linux with only 1 MB of space or a powerful Linux with several GB of space. Regardless of the Linux operating system, you start from the boot program. Most common users run Linux on their PCs.
PC, also known as PC, is a common computer that uses Intel or AMD chips. When we connect the power of the PC, the CPU will execute the first command. The first command usually enables the CPU to jump to the BIOS entry address, and then the BIOS starts to perform self-check upon startup, this includes checking the memory and other hardware. If other devices have their own BIOS (such as SCSI or RAID settings), they will also be executed. After the self-check is completed, the BIOS starts the real operating system based on the set boot device and boot sequence, such as Linux (this article uses Linux as an example ).
For PCs, the following types of devices can be used as startup devices:
1) Hard Disk
This is the most common boot device. The hard disk has two types of interfaces: IDE interface and SCSI interface. Because the IDE hard disk is much cheaper than the SCSI hard disk, most PCs use IDE hard disks. A pc may have multiple hard disks. You can set which hard disks to start first in the PC's CMOS.
2) floppy disk
A floppy disk is one of the essential devices for a PC. It is often used for system installation or as an emergency system disk. There are also many Linux systems on a floppy disk.
3) optical drive
The disc drive is also one of the essential devices for PCs, including CDROM, DVDROM, and various recorders. Currently, most users install Linux through the optical drive.
4) USB disk
With the emergence of USB disks, many motherboard also began to support starting the system from a USB device. USB disk capacity is much larger than that of floppy disk. At present, there is a tendency to replace floppy disk.
5) Boot ROM of the NIC
Some NICs have Boot ROM chips that can write Boot information into Boot ROM. Many motherboards support Boot from Boot ROM. It is often used in diskless work disk environments.
No matter which boot device the system selects, it will read the content of the device's start address into the memory. If your boot device is an IDE hard disk, the system will read the first sector of the hard disk (this sector is usually called the Main Boot Sector, also known as MBR), read the content of this sector into the memory, and then run it. At this step, it is critical to guide the Linux operating system. This step will try to start the Linux boot program. If the boot program cannot be found, it will not be able to guide Linux. When many people cannot start Linux, most of them are caused by corruption or improper configuration of the boot program.
So what is a Bootstrap program? In fact, when you open your computer every day, the first program you are exposed to is the boot program. It is responsible for loading the operating system kernel software and transferring control to it. For Linux, the boot program is responsible for importing Linux Kernel when the computer is started, giving control of the computer to the Kernel, and then the Kernel further initializes the remaining operating system, the user logon screen is displayed in Linux. It can be seen that the boot program is very important for an operating system.
There are many Linux boot programs, the most common of which are lilo and grub:
1) lilo
Lilo is a flexible and versatile boot program for Linux. It does not depend on a specific file system. It can boot the Linux kernel image from a floppy disk or hard disk. Of course, it can also boot other operating systems. Before grub appeared, lilo was the best choice for Linux boot programs. At present, many people are still using it.
[1] [2] Next page