SlideShare a Scribd company logo
5
Most read
7
Most read
13
Most read
Bootloaders
What ?
How ?
Why ?
What is a bootloader ?
●

●

A boot loader is a computer program that loads
the main operating system or run time
environment for the computer after completion
of the self-tests.
Will be covering the loading and working of a
bootloader with respect to the physical memory
implementation of the x86 based systems.
Booting
●

The term boot is short for bootstrap or bootstrap load and derives
from the phrase to 'pull oneself up by one's bootstraps'. The usage
calls attention to the requirement that, if most software is loaded onto
a computer by other software already running on the computer, some
mechanism must exist to load the initial software onto the computer.
●

Two major sections
–

Lower memory (< 1MB)

–

High memory

●

First 640 KB backed by RAM

●

Reserved memory for BIOS

●

Real Mode
–
–

Can only access lower memory

–
●

16 bit instructions
BIOS interrupts are available

Protected mode
–

32 bit instructions

–

Can access high memory

–

BIOS interrupts are not available
Boot Sequence
●

Turn on the Power button.

●

CPU pins are reset and registers are set to specific value.

●

CPU jumps to address of BIOS (0xF0000), the reset vector.

●

●

●

●

BIOS run POST (Power-On Self Test) and other necessary
checks.
BIOS jumps to MBR (Master Boot Record) of the boot disk.
Primary Bootloader runs from MBR and jumps to Secondary
Bootloader.
Secondary Bootloaders loads Operating System.
When in BIOS
●

A firmware interface

●

Initialize and test the system hardware components (POST)

●

Provides interface to access hardware (with interrupts)

●

●

●

●

Stored on a non-volatile ROM/flash memory chip on the
motherboard
Table of interrupt vectors resides in the beginning that contain
the segmented addresses of the interrupt handlers. The number
of interrupt is essentially an index into this table.
Checks each device to see if it's bootable
Loads the first sector (boot sector) from the disk to memory
address 0x007C00
Boot Sector
●

●

A Master Boot Record (MBR) is the first sector of a data storage
device that has been partitioned. The MBR sector may contain code
to locate the active partition and invoke its Volume Boot Record.
A Volume Boot Record (VBR) is the first sector of a data storage
device that has not been partitioned, or the first sector of an individual
partition on a data storage device that has been partitioned. It may
contain code to load and invoke an operating system installed on that
device or within that partition.

●

First 446 bytes are the primary boot loader

●

Next sixty-four bytes are the partition table

●

Ends with two bytes that should be 0x55AA. These numbers act as
validation that this sector is the boot sector or Master Boot Record.
Basics of boot-loader
First stage
●

Resides in the boot sector of disk

●

Loaded by the BIOS.

●

Should be covered in 446 bytes due to size constraints in the boot
sector.

●

Load segment registers (%DS, %ES, %FS, %GS, %SS).

●

Set the stack pointer.

●

Reset disk controller.

●

Reads the 2nd stage bootloader and loads it into memory.

●

Jump to it.
Second Stage
●

●

●

●

●

●

Query the BIOS for the size of lower and upper memory( INT 12h
BIOS interrupt).
Loads the kernel from the boot disk into memory, prepare the system
for executing the kernel, and jump to the kernel entry point.
Switch into protected mode and load the kernel into high (> 1 MB)
memory.
BIOS services used to read sectors from the boot disk are available
only in real mode and real mode cannot access high memory.
Repeatedly switch back and forth between real mode and protected
mode while reading the kernel from the floppy disk.
Small kernel can be preloaded entirely into low memory before
transitioning into protected mode.
Starting up … finally!!
●

●

●

●

●

●

●

Kernel needs startup arguments while loading, but this cannot be
done at runtime.
Solution: Configuration files (grub.cfg,initramfs)
The bootloader loads the kernel as well as the temporary filesystem
before the actual file system is loaded.
Initramfs(initial ram file system) : successor of initrd. Solves the
chicken-egg problem.
An archive of the initial file system that gets loaded into memory. The
Linux kernel mounts it as root file system and starts the init process
from it.
initramfs needs to contain all of the device drivers and tools needed
to mount the real root filesystem.
After all these, /sbin/init, /etc/init, /bin/init, and /bin/sh are called in the
order; the first user process is init and they read etc/events.d or
etc/inittab. Hence the system starts.
Basics of boot-loader

More Related Content

PDF
U-Boot - An universal bootloader
Emertxe Information Technologies Pvt Ltd
 
PDF
Uboot startup sequence
Houcheng Lin
 
PPTX
Embedded linux
Wingston
 
PPT
Linux Booting Steps
Anando Kumar Paul
 
PDF
Embedded Linux Kernel - Build your custom kernel
Emertxe Information Technologies Pvt Ltd
 
PDF
Understanding The Boot Process
Dom Cimafranca
 
ODP
Linux Internals - Kernel/Core
Shay Cohen
 
PDF
Bootloaders
Anil Kumar Pugalia
 
U-Boot - An universal bootloader
Emertxe Information Technologies Pvt Ltd
 
Uboot startup sequence
Houcheng Lin
 
Embedded linux
Wingston
 
Linux Booting Steps
Anando Kumar Paul
 
Embedded Linux Kernel - Build your custom kernel
Emertxe Information Technologies Pvt Ltd
 
Understanding The Boot Process
Dom Cimafranca
 
Linux Internals - Kernel/Core
Shay Cohen
 
Bootloaders
Anil Kumar Pugalia
 

What's hot (20)

PDF
Arm device tree and linux device drivers
Houcheng Lin
 
PPTX
booting steps of a computer
Anusha Babooa
 
PPTX
Linux Boot Process
darshhingu
 
PDF
U boot-boot-flow
BabuSubashChandar Chandra Mohan
 
PDF
Linux kernel modules
Dheryta Jaisinghani
 
PDF
Introduction To Linux Kernel Modules
dibyajyotig
 
PPTX
Linux file system
Md. Tanvir Hossain
 
PDF
A practical guide to buildroot
Emertxe Information Technologies Pvt Ltd
 
PPT
Bootstrap process of u boot (NDS32 RISC CPU)
Macpaul Lin
 
PPTX
What is Bootloader???
Dinesh Damodar
 
PDF
Board Bringup
Anil Kumar Pugalia
 
PPT
U Boot or Universal Bootloader
Satpal Parmar
 
PPT
Bios
Vishal Gohel
 
PDF
Linux Internals - Interview essentials 4.0
Emertxe Information Technologies Pvt Ltd
 
PPTX
Bios
Evans Lampi
 
PDF
PCI Drivers
Anil Kumar Pugalia
 
PPTX
Linux vs windows
Rajan Kandel
 
Arm device tree and linux device drivers
Houcheng Lin
 
booting steps of a computer
Anusha Babooa
 
Linux Boot Process
darshhingu
 
Linux kernel modules
Dheryta Jaisinghani
 
Introduction To Linux Kernel Modules
dibyajyotig
 
Linux file system
Md. Tanvir Hossain
 
A practical guide to buildroot
Emertxe Information Technologies Pvt Ltd
 
Bootstrap process of u boot (NDS32 RISC CPU)
Macpaul Lin
 
What is Bootloader???
Dinesh Damodar
 
Board Bringup
Anil Kumar Pugalia
 
U Boot or Universal Bootloader
Satpal Parmar
 
Linux Internals - Interview essentials 4.0
Emertxe Information Technologies Pvt Ltd
 
PCI Drivers
Anil Kumar Pugalia
 
Linux vs windows
Rajan Kandel
 
Ad

Similar to Basics of boot-loader (20)

PPTX
Boot process
Salman Memon
 
PDF
File000124
Desmond Devendran
 
PPTX
CSA-113-personal-computeasdaasdasdasr.pptx
marcxaaron
 
PPT
BOOTING.ppt
TripleRainbow
 
PDF
IRJET- Orchestration of Operating System Start-Up
IRJET Journal
 
PDF
Grub2 Booting Process
Mike Wang
 
PPT
3996234.ppt
KdpKumar
 
PPTX
An Insight into the Linux Booting Process
Hardeep Bhurji
 
PPTX
System Booting Process overview
RajKumar Rampelli
 
PPT
Booting how boot to the system and details
MadniFareed1
 
ODP
Linux boot process
brusnigin
 
PDF
Booting & shut down,
Bhushan Pawar -Java Trainer
 
PPTX
BIOS__Power-On-Self-Test.pptx
SamiWhoo
 
DOC
Funciones del bios y codigos post ingles
Jose Antonio Torres P
 
PDF
Boot process: BIOS vs UEFI
Alea Soluciones, S.L.
 
PDF
Unit 4 booting & shut down
Bhushan Pawar -Java Trainer
 
DOCX
1 study of motherboard
Ankit Dubey
 
PPTX
Bootloader and bootloading
Arpita Gupta
 
PPTX
1.0 introduction to personal computer
Gagandeep Singh
 
PDF
Questions1. Research the Master Boot Record. Write a long paragra.pdf
Rahul04August
 
Boot process
Salman Memon
 
File000124
Desmond Devendran
 
CSA-113-personal-computeasdaasdasdasr.pptx
marcxaaron
 
BOOTING.ppt
TripleRainbow
 
IRJET- Orchestration of Operating System Start-Up
IRJET Journal
 
Grub2 Booting Process
Mike Wang
 
3996234.ppt
KdpKumar
 
An Insight into the Linux Booting Process
Hardeep Bhurji
 
System Booting Process overview
RajKumar Rampelli
 
Booting how boot to the system and details
MadniFareed1
 
Linux boot process
brusnigin
 
Booting & shut down,
Bhushan Pawar -Java Trainer
 
BIOS__Power-On-Self-Test.pptx
SamiWhoo
 
Funciones del bios y codigos post ingles
Jose Antonio Torres P
 
Boot process: BIOS vs UEFI
Alea Soluciones, S.L.
 
Unit 4 booting & shut down
Bhushan Pawar -Java Trainer
 
1 study of motherboard
Ankit Dubey
 
Bootloader and bootloading
Arpita Gupta
 
1.0 introduction to personal computer
Gagandeep Singh
 
Questions1. Research the Master Boot Record. Write a long paragra.pdf
Rahul04August
 
Ad

Recently uploaded (20)

PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 

Basics of boot-loader

  • 3. What is a bootloader ? ● ● A boot loader is a computer program that loads the main operating system or run time environment for the computer after completion of the self-tests. Will be covering the loading and working of a bootloader with respect to the physical memory implementation of the x86 based systems.
  • 4. Booting ● The term boot is short for bootstrap or bootstrap load and derives from the phrase to 'pull oneself up by one's bootstraps'. The usage calls attention to the requirement that, if most software is loaded onto a computer by other software already running on the computer, some mechanism must exist to load the initial software onto the computer.
  • 5. ● Two major sections – Lower memory (< 1MB) – High memory ● First 640 KB backed by RAM ● Reserved memory for BIOS ● Real Mode – – Can only access lower memory – ● 16 bit instructions BIOS interrupts are available Protected mode – 32 bit instructions – Can access high memory – BIOS interrupts are not available
  • 6. Boot Sequence ● Turn on the Power button. ● CPU pins are reset and registers are set to specific value. ● CPU jumps to address of BIOS (0xF0000), the reset vector. ● ● ● ● BIOS run POST (Power-On Self Test) and other necessary checks. BIOS jumps to MBR (Master Boot Record) of the boot disk. Primary Bootloader runs from MBR and jumps to Secondary Bootloader. Secondary Bootloaders loads Operating System.
  • 7. When in BIOS ● A firmware interface ● Initialize and test the system hardware components (POST) ● Provides interface to access hardware (with interrupts) ● ● ● ● Stored on a non-volatile ROM/flash memory chip on the motherboard Table of interrupt vectors resides in the beginning that contain the segmented addresses of the interrupt handlers. The number of interrupt is essentially an index into this table. Checks each device to see if it's bootable Loads the first sector (boot sector) from the disk to memory address 0x007C00
  • 8. Boot Sector ● ● A Master Boot Record (MBR) is the first sector of a data storage device that has been partitioned. The MBR sector may contain code to locate the active partition and invoke its Volume Boot Record. A Volume Boot Record (VBR) is the first sector of a data storage device that has not been partitioned, or the first sector of an individual partition on a data storage device that has been partitioned. It may contain code to load and invoke an operating system installed on that device or within that partition. ● First 446 bytes are the primary boot loader ● Next sixty-four bytes are the partition table ● Ends with two bytes that should be 0x55AA. These numbers act as validation that this sector is the boot sector or Master Boot Record.
  • 10. First stage ● Resides in the boot sector of disk ● Loaded by the BIOS. ● Should be covered in 446 bytes due to size constraints in the boot sector. ● Load segment registers (%DS, %ES, %FS, %GS, %SS). ● Set the stack pointer. ● Reset disk controller. ● Reads the 2nd stage bootloader and loads it into memory. ● Jump to it.
  • 11. Second Stage ● ● ● ● ● ● Query the BIOS for the size of lower and upper memory( INT 12h BIOS interrupt). Loads the kernel from the boot disk into memory, prepare the system for executing the kernel, and jump to the kernel entry point. Switch into protected mode and load the kernel into high (> 1 MB) memory. BIOS services used to read sectors from the boot disk are available only in real mode and real mode cannot access high memory. Repeatedly switch back and forth between real mode and protected mode while reading the kernel from the floppy disk. Small kernel can be preloaded entirely into low memory before transitioning into protected mode.
  • 12. Starting up … finally!! ● ● ● ● ● ● ● Kernel needs startup arguments while loading, but this cannot be done at runtime. Solution: Configuration files (grub.cfg,initramfs) The bootloader loads the kernel as well as the temporary filesystem before the actual file system is loaded. Initramfs(initial ram file system) : successor of initrd. Solves the chicken-egg problem. An archive of the initial file system that gets loaded into memory. The Linux kernel mounts it as root file system and starts the init process from it. initramfs needs to contain all of the device drivers and tools needed to mount the real root filesystem. After all these, /sbin/init, /etc/init, /bin/init, and /bin/sh are called in the order; the first user process is init and they read etc/events.d or etc/inittab. Hence the system starts.