SlideShare a Scribd company logo
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.
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

What's hot

U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
Satpal Parmar
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
GlobalLogic Ukraine
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
Emertxe Information Technologies Pvt Ltd
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
Emertxe Information Technologies Pvt Ltd
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
mukul bhardwaj
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
RuggedBoardGroup
 
Linux device drivers
Linux device drivers Linux device drivers
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
Dinesh Damodar
 
linux device driver
linux device driverlinux device driver
linux device driver
Rahul Batra
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
Linaro
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
Emertxe Information Technologies Pvt Ltd
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
Archana Chandrasekharan
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
Rashila Rr
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
 
Bootloaders
BootloadersBootloaders
Bootloaders
Anil Kumar Pugalia
 

What's hot (20)

U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
 
linux device driver
linux device driverlinux device driver
linux device driver
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Bootloaders
BootloadersBootloaders
Bootloaders
 

Similar to Basics of boot-loader

Boot process
Boot processBoot process
Boot process
Salman Memon
 
File000124
File000124File000124
File000124
Desmond Devendran
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
Anando Kumar Paul
 
BOOTING.ppt
BOOTING.pptBOOTING.ppt
BOOTING.ppt
TripleRainbow
 
IRJET- Orchestration of Operating System Start-Up
IRJET- Orchestration of Operating System Start-UpIRJET- Orchestration of Operating System Start-Up
IRJET- Orchestration of Operating System Start-Up
IRJET Journal
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting Process
Mike Wang
 
3996234.ppt
3996234.ppt3996234.ppt
3996234.ppt
KdpKumar
 
An Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessAn Insight into the Linux Booting Process
An Insight into the Linux Booting Process
Hardeep Bhurji
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
RajKumar Rampelli
 
Booting how boot to the system and details
Booting how boot to the system and detailsBooting how boot to the system and details
Booting how boot to the system and details
MadniFareed1
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
brusnigin
 
Booting & shut down,
Booting & shut down,Booting & shut down,
Booting & shut down,
Bhushan Pawar -Java Trainer
 
Understanding The Boot Process
Understanding The Boot ProcessUnderstanding The Boot Process
Understanding The Boot Process
Dominique Cimafranca
 
BIOS__Power-On-Self-Test.pptx
BIOS__Power-On-Self-Test.pptxBIOS__Power-On-Self-Test.pptx
BIOS__Power-On-Self-Test.pptx
SamiWhoo
 
Funciones del bios y codigos post ingles
Funciones del bios y codigos post inglesFunciones del bios y codigos post ingles
Funciones del bios y codigos post ingles
Jose Antonio Torres P
 
Unit 4 booting & shut down
Unit 4 booting & shut downUnit 4 booting & shut down
Unit 4 booting & shut down
Bhushan Pawar -Java Trainer
 
1 study of motherboard
1 study of motherboard1 study of motherboard
1 study of motherboard
Ankit Dubey
 
Booting
BootingBooting
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloading
Arpita Gupta
 
1.0 introduction to personal computer
1.0  introduction to personal computer1.0  introduction to personal computer
1.0 introduction to personal computer
Gagandeep Singh
 

Similar to Basics of boot-loader (20)

Boot process
Boot processBoot process
Boot process
 
File000124
File000124File000124
File000124
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
 
BOOTING.ppt
BOOTING.pptBOOTING.ppt
BOOTING.ppt
 
IRJET- Orchestration of Operating System Start-Up
IRJET- Orchestration of Operating System Start-UpIRJET- Orchestration of Operating System Start-Up
IRJET- Orchestration of Operating System Start-Up
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting Process
 
3996234.ppt
3996234.ppt3996234.ppt
3996234.ppt
 
An Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessAn Insight into the Linux Booting Process
An Insight into the Linux Booting Process
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 
Booting how boot to the system and details
Booting how boot to the system and detailsBooting how boot to the system and details
Booting how boot to the system and details
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 
Booting & shut down,
Booting & shut down,Booting & shut down,
Booting & shut down,
 
Understanding The Boot Process
Understanding The Boot ProcessUnderstanding The Boot Process
Understanding The Boot Process
 
BIOS__Power-On-Self-Test.pptx
BIOS__Power-On-Self-Test.pptxBIOS__Power-On-Self-Test.pptx
BIOS__Power-On-Self-Test.pptx
 
Funciones del bios y codigos post ingles
Funciones del bios y codigos post inglesFunciones del bios y codigos post ingles
Funciones del bios y codigos post ingles
 
Unit 4 booting & shut down
Unit 4 booting & shut downUnit 4 booting & shut down
Unit 4 booting & shut down
 
1 study of motherboard
1 study of motherboard1 study of motherboard
1 study of motherboard
 
Booting
BootingBooting
Booting
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloading
 
1.0 introduction to personal computer
1.0  introduction to personal computer1.0  introduction to personal computer
1.0 introduction to personal computer
 

Recently uploaded

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 

Recently uploaded (20)

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 

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.
  • 9.
  • 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.