Linux+: Linux Install 07 – OS Startup

J

Jarret W. Buse

Guest
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.

There are two basic options for Linux start:

1. Boot directly to the Linux OS
2. Use a boot program
a. LInux LOader (LILO)
b. GNU GRand Unified Bootloader (GRUB)
c. Others​

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:
  • 00 – Internal error – corrupt map file
  • 01 – Illegal command – BIOS may not recognize boot disk
  • 02 – Address mark not found – disk error, keep loading system
  • 03 – Write-protected disk – LILO is writing a file and disk is protected
  • 04 – Sector not found – configuration file contains incorrect information about disk
  • 06 – Change line active – try to boot again
  • 07 – Invalid initialization – BIOS did not initialize the boot disk
  • 08 –DMA overrun – try to boot again
  • 09 – DMA attempt across 64k boundary – configuration for boot disk is invalid
  • 0C – Invalid media – may be a sector error, try to boot again
  • 10 – CRC error – sector error, rerun mapper and try again, may require a new boot disk
  • 11 – ECC correction successful – error detected and corrected, which causes LILO to halt, try to boot again
  • 20 – Controller error, try to boot again
  • 40 – Seek failure – try to boot again
  • 80 – Disk timeout – Disk is not ready or media is corrupted
  • 99 – Invalid second stage – BIOS configuration error of disk or bad map file
  • 9A –Second Stage not found – confirm correct boot device
  • BB – BIOS error – try to boot again
  • LI – First stage is complete and second stage is loaded, but unable to start.
  • LIL – Second stage has started, but unable to load the map file. Typical causes can be bad sectors or incorrect BIOS parameters.
  • LIL? – Second stage is not in the correct sector on the disk caused by incorrect BIOS parameters.
  • LIL- - The descriptor table is corrupted caused by incorrect BIOS parameters.
  • LILO – LILO has successfully started.


GRUB

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.
 

Attachments

  • slide.jpg
    slide.jpg
    42.4 KB · Views: 65,177

Members online

No members online now.

Top