Linux+: Linux Install 07 – OS Startup

All Operating Systems (OS) at some point need to start up. With any OS, it is important to know the various procedures for starting the OS.

When starting a system, the OS will be loaded and started. Once started, all of the appropriate drivers and services are executed as well. When a system starts, the following is performed:

1. Basic Input/Output System (BIOS) or Complementary metal–oxide–semiconductor (CMOS) - checks configuration of boot and system
2. BIOS Drivers – uses basic drivers in BIOS chips for use of hardware before OS loads (keyboard, mouse, video, etc)
3. Power On Self Test (POST) – system diagnostics
4. Bootstrap Loader – control is passed to the boot record of the first boot disk configured in the CMOS​

The Bootstrap Loader, also called Bootstrap or Boot Loader, is read from Read Only Memory (ROM) which passes control to the data within the Boot Record of the first bootable device listed in the CMOS. If the device exists and contains boot information, then the information is loaded, otherwise the next devices is checked. For example, if the first device is a CD-ROM, but it contains no bootable CD, the next device is checked and so on until either boot information is found or all devices have failed.

If a system has only one OS installed on it, then the Boot Loader can load the Linux Kernel and start the OS.

Some systems, whether they have multiple Operating Systems installed, will have some type of boot program. When multiple OSs are installed, there will be some type of boot loader which offers a choice of which OS to load.

NOTE: Some OSs include a boot loader which can still display a screen, even when only one OS is installed.

LILO

LILO can be in the boot sector of the bootable disk or in the Master Boot Record (MBR). LILO is not dependent on a specific file system for the boot disk. There are a few files associated with LILO:

lilo.conf – configuration file for LILO which is typically stored as /etc/lilo.conf. The file contains information on the disks which contain an OS and also the parameters to load the specified OS.map – stores information on the files needed by LILO and where they are located. The map file is located in /sbin/lilo and must be updated when the kernel is upgraded by ‘map installer’.boot.xxyy – backup of boot sector which LILO overwrites in case the boot loader is removed and the original boot sector can be restored for a single OS system or the original boot loader is restored.​

When the boot loader is executed, it displays one letter of LILO as the process runs. Each letter can be specific to the process and help determine errors if the system stops at a specific letter as follows:

No letters – Boot device has failed. LILO is not present. The boot partition where LILO is installed is not the active boot partition.

L – First stage of the boot loader has finished and has been unable to load the second stage. This usually indicates bad BIOS parameters or bad sectors on the media or even a corruption of the boot loader. The letter is usually followed by an error code as follows:

GRUB allows for multiple Operating Systems to be selected from at startup to start a specific OS. GRUB also allows for use of network images to be loaded on systems without partitions.

The current version of GRUB is version 2. There are three stages in the GRUB process:

Stage 1 – The MBR contains boot.img which is set to load core.img

Stage 1.5 – Core.img is loaded which in turn checks configuration files and file system drivers

Stage 2 – Files from /boot/grub/ are loaded and an interface is displayed to allow a selection to be made so control is passed to a specific kernel

Instead of selecting a kernel after Stage 2, the user is allowed to press 'e' to edit the GRUB menu. Another option is to press ‘c’ to get to a GRUB command-line prompt.

NOTE: It is possible for GRUB to pass control to another boot-loader program. For example, Windows systems have a boot menu. When you select MS-Windows from a GRUB menu, it can then pass control to the Windows loader to allow Windows to load.

There are tools to allow for customization of GRUB:

GRUB Customizer

Startup-Manager

Anaconda

YaST2

NOTE: If you have a GUI Linux system and it starts to a command-line prompt, type 'startx' to load X Windows. Or, type the command for your specific GUI if 'startx' does not work.

After the Startup procedure is complete, the logon process begins. Once there is a logon screen, type or select select your username and type the password, which is case sensitive. Press enter, or select the appropriate button to login. If the username and password are correct, then the desktop should appear.