Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
5 views26 pages

Lecture 2

The document outlines the booting process of a computer, detailing the roles of BIOS, bootloaders, and kernel initialization. It explains the boot sequence, including cold and warm booting, and the function of the Master Boot Record (MBR) in loading the operating system. Additionally, it discusses various bootloaders like GRUB and LILO, highlighting their functionalities and processes in booting Linux systems.

Uploaded by

mahengejimson02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views26 pages

Lecture 2

The document outlines the booting process of a computer, detailing the roles of BIOS, bootloaders, and kernel initialization. It explains the boot sequence, including cold and warm booting, and the function of the Master Boot Record (MBR) in loading the operating system. Additionally, it discusses various bootloaders like GRUB and LILO, highlighting their functionalities and processes in booting Linux systems.

Uploaded by

mahengejimson02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

BOOTLOADER

CP 211
Department of Computer Science and Engineering
The University of Dodoma
Objectives
• Keywords
• Booting Sequence
• Bios
• Bootloader
• Kernel Initialization
Key Terms
1. BIOS = Stands for Basic Input/Output System, it is a system that is
responsible for preparing the hardware, and then transferring
control to the operating system.
2. Firmware = is a specific class of computer software that is
embedded into hardware devices to provide a low-level control to
help them operate effectively. Example: BIOS, UEFI, Routers,
Switches, Camera, etc.
3. Bootstrap processor = the processor that starts fetching, decoding
and executing instructions at startup time (i.e., immediately after
the removal of reset).
Booting Sequence
Booting: A process of starting a computer initiated by a hardware push
like as a button or by a software command.

• Booting can be;


1. Cold booting: When the computer is started after having been
switched off.

2. Warm booting: When the operating system alone is restarted after a


system crash or freeze.
Why Booting
1. Hardware is not intelligent, and will not initiate itself.

1. Location of OS is unknown to the hardware, thus a special program


is required to locate it.
Boot sequence
1. Turn on
2. CPU jump to address of BIOS (0xFFFF0)
3. BIOS runs POST (Power-On Self Test)
4. Find bootable devices
5. Loads and execute boot sector form MBR
6. Load OS
Turn On
• When the computer is switched on power supply turns on and
initializes.
• The power supply takes some time until it can generate reliable
power for the rest of the computer, and having it turn on prematurely
could potentially lead to damage.
• Therefore, the chipset will generate a reset signal to the processor
(the same as if you held the reset button down for a while on your
case) until it receives the Power Good signal from the power supply.
2. CPU jump to address of BIOS
• When the processor first starts up, there is nothing at all in the
memory to execute.
• Thus processor is programmed to look at the system BIOS ROM for
the start of the BIOS boot program, at FFFF0h, right at the end of the
system memory.
• This location just contains a instruction telling the processor where to
go to find the real BIOS startup program
3. BIOS
• BIOS refers to the software code run by a computer when first
powered on
• The primary function of BIOS is a code program embedded on a chip
that recognizes and controls various devices that make up the
computer.

BIOS on board
BIOS on screen
3. BIOS runs POST (Power-On Self Test)
• Performed by Firmware IOS/UEFI to determine if the computer's
essential hardware is working properly.
• If POST fails, the booting will fail.
• POST involved testing the following devices;
(i) processors, (ii) memory, (iii) storage, (iv) controllers, (v) keyboard,
(vi) pointer device, and (vii) system timer.
After POST, the bios will go through the
following tests
• The BIOS looks for the video card.

• The BIOS then looks for other devices' ROMs to see if any of them
have BIOSes.

• Normally, the IDE/ATA hard disk BIOS.

• The BIOS displays its startup screen.


After POST, the bios will go through the
following tests
• The BIOS does more tests on the system, including the memory count-up
test which you see on the screen.

• The BIOS performs a "system inventory" of sorts, doing more tests to


determine what sort of hardware is in the system.

• If the BIOS supports the Plug and Play standard, it will detect and configure
Plug and Play devices at this time and display a message on the screen for
each one it finds.

• The BIOS will display a summary screen about your system's configuration.
Booting
• The BIOS begins the search for a drive to boot from.
• Most modern BIOSes contain a setting that controls if the system
should first try to boot from the floppy disk (A:) or first try the hard
disk (C:).
• Some BIOSes will even let you boot from your CD-ROM drive or other
devices, depending on the boot sequence BIOS setting.
MBR (Master Boot Record)
• OS is booted from a hard disk, where the Master Boot Record (MBR) contains
the primary boot loader
• The MBR is a 512-byte sector, located in the first sector on the disk (sector 1
of cylinder 0, head 0)
• After the MBR is loaded into RAM, the BIOS yields control to it.

15
MBR (Master Boot Record)

16
MBR (Master Boot Record)
• The first 446 bytes are the primary boot loader, which contains both
executable code and error message text
• The next sixty-four bytes are the partition table, which contains a record for
each of four partitions
• The MBR ends with two bytes that are defined as the magic number (0xAA55).
The magic number serves as a validation check of the MBR

17
Boot loader
• Boot loader could be more aptly called the kernel loader. The task at this stage is
to load the Linux kernel
• Optional, initial RAM disk
• GRUB and LILO are the most popular Linux boot loader.

18
Other boot loader (Several OS)
• bootman
• GRUB
• LILO
• NTLDR
• XOSL
• BootX
• loadlin
• Gujin
• Boot Camp
• Syslinux
• GAG

19
GRUB: GRand Unified Bootloader
• GRUB is an operating system independant boot loader
• A multiboot software packet from GNU
• Flexible command line interface
• File system access
• Support multiple executable format
• Support diskless system
• Download OS from network
• Etc.

20
GRUB boot process
1. The BIOS finds a bootable device (hard disk) and transfers control to
the master boot record
2. The MBR contains GRUB stage 1. Given the small size of the MBR,
Stage 1 just load the next stage of GRUB
3. GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk
immediately following the MBR. Stage 1.5 loads Stage 2.
4. GRUB Stage 2 receives control, and displays to the user the GRUB boot
menu (where the user can manually specify the boot parameters).
5. GRUB loads the user-selected (or default) kernel into memory and
passes control on to the kernel.

21
Example GRUB config file

22
LILO: LInux LOader
• Not depend on a specific file system
• Can boot from harddisk and floppy
• Up to 16 different images
• Must change LILO when kernel image file or config file is changed

23
How Linux boot?

24
Outline of Boot Sequence
Kernel Initialization

You might also like