2
Most read
4
Most read
5
Most read
© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Bootloaders
2© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What to Expect?
W's of Bootloaders
Specifics of a Bootloader
With U-Boot in consideration
U-Boot Hands-On
U-Boot Source Code
U-Boot Porting
3© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What is a Bootloader?
Simply, a loader (program), which boots up
(starts) the system
A Customized Program started by
Controller's Internal Code in Embedded Systems, Or
Default Program Counter settings in Desktops
4© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Tasks of a Bootloader
Initialization Tasks
Memory Setup & Initialization
System Peripheral Initialization
for the kernel
Actual Task
Load the RAM-based File System, like initrd, initramfs, ...
Load the Kernel with proper arguments
Jump to the start of the Kernel
Additional Tasks
Multiple Kernel Boots
Multiple-way Boots
5© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Design of Bootloaders
As Bootloader is started by a fixed code
It needs to be placed at a hard-coded location
Hard-coded locations are not big enough for the
complete code (/ logic / tasks) of the bootloader
Hence, it is typically split into 2 portions
Stage 1 – Small enough to load Stage 2 from our desired
location
Stage 2 – The actual bootloader we want to have
6© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Bootloader Comparisons
On Desktops
Initialization Tasks are done by BIOS
Bootloader is to just Boot the Kernel
On Embedded Systems
All needs to be done by the Bootloader
But in an optimized way
Hence, the 2 bootloaders are
Quite different from each other
Later being more board dependent & constrained
7© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Check
Name the Stage 1 & Stage 2 bootloaders
Desktops
Embedded Systems
8© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Stage 2 Bootloader Flavours
Prevalent Desktop Bootloaders
LILO
GRUB
SYSLINUX
loadlin
Coreboot (Earlier called LinuxBIOS)
Popular Embedded System Bootloaders
BootLoader Object (BLOB)
Redboot
U-Boot
9© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Specifics
10© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Initialization Details
Bootloader starts its execution from flash / *PROM
Hardware Diagnostics, like POST, …
Configuring the CPU speed, MMU setting, etc
Memory Initialization
Determining on-board memory size
Turning on the caches
Clearing memory
Optionally, Relocate to RAM, and start execution from
there
Setting up interfacing ports like serial, VGA, …
11© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot's Argument Passing
Three-Party Communication
Kernel hard-codes the offset of argument structure
Developer attaches the load & start addresses
In a U-Boot recognizable Header
To the kernel image
We shall do when building kernel image
U-Boot
Reads the U-Boot Header wrapped kernel image
Loads the kernel at the read load address
Fills the kernel argument structure at the hard-coded offset
Arguments are obtained from its environment
Jumps to the kernel start address to start executing
12© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-boot Hands-on
Stopping at the U-Boot
Help - “?”
Commands
Booting: bootp, bootm, boot, ...
NOR Flash: erase, cp, protect, …
NAND Flash: nand
Miscellaneous: reset, ...
...
Environment Variables
printenv
setenv
saveenv
13© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Source Tree
arch – Architecture dependent Code
board – Board dependent Code
common – Environment & Command Line Code
doc – Documentation
drivers – Device specific Drivers
fs – File System support Code
include – Headers
lib – Compression, Encryption related Code
net – Minimal Network Stack
tools – U-Boot Utilities (mkimage is here)
14© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Compiling
Preparing the Makefile
Setup (ARCH,) CROSS_COMPILE for cross compilation
Or, invoke make with these options
Configuring for a particular board
make <board>_config
Compiling for the configured board
make (Output would be u-boot.bin)
Cleaning up
make clean
15© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
U-Boot Porting
Implies adding a new Board to U-Boot
That entails
Adding <board>_config for make
Adding board specific code at the right places
16© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Adding <board>_config
Adding an entry in the Makefile with
Architecture
CPU
Board
Vendor (May be NULL)
SoC (May be NULL)
Adding the new board directory under board/ with
Makefile
Initialization Code for the Board
Configuration Makefile
Adding the new board header under include/configs/ with
Configuration for the Board
Note: If a new architecture is added, a U-Boot architecture porting would be needed - though, that is uncommon
17© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Adding Board specific Code
Highly depends on the Board
CPU Architecture
Clock Interfaces
Console Interfaces
LCD Interfaces
Network Interfaces
Peripherals
…
Should be added in the appropriate Folders
With appropriate file names
And following the U-Boot Coding Guidelines
Existing Code may serve as the example for the same
18© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What all have learnt?
W's of Bootloaders
Specifics of a U-Boot
U-Boot Initialization Sequence
U-Boot's argument passing to Kernel
U-Boot Hands-On
U-Boot Source Code
Understanding the Source Structure
Configuring for a Board
Compiling the u-boot image
U-Boot Porting for a New Board
19© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Any Queries?

More Related Content

PPTX
What is Bootloader???
PDF
Embedded Operating System - Linux
PDF
Board Bringup
PDF
Embedded Linux Kernel - Build your custom kernel
PDF
Linux Internals - Part II
PPTX
Bootloaders (U-Boot)
PPT
Basic Linux Internals
What is Bootloader???
Embedded Operating System - Linux
Board Bringup
Embedded Linux Kernel - Build your custom kernel
Linux Internals - Part II
Bootloaders (U-Boot)
Basic Linux Internals

What's hot (20)

PPTX
U-Boot presentation 2013
PPTX
Linux Kernel Booting Process (1) - For NLKB
PDF
Spi drivers
PDF
Linux Porting
PDF
U-Boot - An universal bootloader
PDF
PDF
BeagleBone Black Bootloaders
PDF
Linux-Internals-and-Networking
PDF
Uboot startup sequence
PDF
PDF
Linux Porting
PDF
Embedded_Linux_Booting
PDF
BeagleBone Black Bootloaders
PDF
Introduction to Linux
PDF
Root file system for embedded systems
PDF
Arm device tree and linux device drivers
PDF
Jagan Teki - U-boot from scratch
PPTX
Linux I2C
PPT
U Boot or Universal Bootloader
U-Boot presentation 2013
Linux Kernel Booting Process (1) - For NLKB
Spi drivers
Linux Porting
U-Boot - An universal bootloader
BeagleBone Black Bootloaders
Linux-Internals-and-Networking
Uboot startup sequence
Linux Porting
Embedded_Linux_Booting
BeagleBone Black Bootloaders
Introduction to Linux
Root file system for embedded systems
Arm device tree and linux device drivers
Jagan Teki - U-boot from scratch
Linux I2C
U Boot or Universal Bootloader
Ad

Viewers also liked (19)

PDF
Linux User Space Debugging & Profiling
PDF
Functional Programming with LISP
PDF
Mobile Hacking using Linux Drivers
PDF
Shell Scripting
PDF
Embedded Software Design
PDF
Synchronization
PDF
PDF
Embedded C
PDF
Linux Network Management
PDF
PDF
System Calls
PDF
Inter Process Communication
PDF
Network Drivers
PDF
References
PDF
Kernel Debugging & Profiling
PDF
Interrupts
PDF
Introduction to Linux Drivers
PDF
Character Drivers
Linux User Space Debugging & Profiling
Functional Programming with LISP
Mobile Hacking using Linux Drivers
Shell Scripting
Embedded Software Design
Synchronization
Embedded C
Linux Network Management
System Calls
Inter Process Communication
Network Drivers
References
Kernel Debugging & Profiling
Interrupts
Introduction to Linux Drivers
Character Drivers
Ad

Similar to Bootloaders (20)

PDF
BeagleBoard-xM Booting Process
PDF
BeagleBone Black Booting Process
PDF
BeagleBoard-xM Bootloaders
PDF
Armboot process zeelogic
PPT
C C N A Day2
PPTX
U-Boot Porting on New Hardware
PDF
Details on Bootloaders in Embedded LInux
DOCX
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
PDF
USB Drivers
PPTX
SESI 7 RouterTroubleshooting.pptx
DOCX
bios.docx
PPTX
Basic Divice.pptx
PDF
Linux Kernel Overview
PPTX
SRWE_Module_1.pptx Networking Courses IT
ODP
SR-IOV Introduce
PDF
Block Drivers
PDF
5 p9 pnor and open bmc overview - final
PPTX
Id. 01 router (computing)
PPT
5003361.ppt
PDF
PCI Drivers
BeagleBoard-xM Booting Process
BeagleBone Black Booting Process
BeagleBoard-xM Bootloaders
Armboot process zeelogic
C C N A Day2
U-Boot Porting on New Hardware
Details on Bootloaders in Embedded LInux
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
USB Drivers
SESI 7 RouterTroubleshooting.pptx
bios.docx
Basic Divice.pptx
Linux Kernel Overview
SRWE_Module_1.pptx Networking Courses IT
SR-IOV Introduce
Block Drivers
5 p9 pnor and open bmc overview - final
Id. 01 router (computing)
5003361.ppt
PCI Drivers

More from Anil Kumar Pugalia (16)

PDF
File System Modules
PDF
Kernel Debugging & Profiling
PDF
PDF
System Calls
PDF
Introduction to Linux
PDF
Playing with R L C Circuits
PDF
Audio Drivers
PDF
Video Drivers
PDF
Power of vi
PDF
gcc and friends
PDF
"make" system
PDF
Hardware Design for Software Hackers
PDF
RPM Building
PDF
PDF
Linux Memory Management
PDF
Linux File System
File System Modules
Kernel Debugging & Profiling
System Calls
Introduction to Linux
Playing with R L C Circuits
Audio Drivers
Video Drivers
Power of vi
gcc and friends
"make" system
Hardware Design for Software Hackers
RPM Building
Linux Memory Management
Linux File System

Recently uploaded (20)

PPTX
TEXTILE technology diploma scope and career opportunities
PPTX
The various Industrial Revolutions .pptx
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PDF
The influence of sentiment analysis in enhancing early warning system model f...
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PDF
Statistics on Ai - sourced from AIPRM.pdf
PDF
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
PDF
Consumable AI The What, Why & How for Small Teams.pdf
DOCX
search engine optimization ppt fir known well about this
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPT
What is a Computer? Input Devices /output devices
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PPTX
Training Program for knowledge in solar cell and solar industry
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
TEXTILE technology diploma scope and career opportunities
The various Industrial Revolutions .pptx
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
sbt 2.0: go big (Scala Days 2025 edition)
The influence of sentiment analysis in enhancing early warning system model f...
Convolutional neural network based encoder-decoder for efficient real-time ob...
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Statistics on Ai - sourced from AIPRM.pdf
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
Consumable AI The What, Why & How for Small Teams.pdf
search engine optimization ppt fir known well about this
OpenACC and Open Hackathons Monthly Highlights July 2025
sustainability-14-14877-v2.pddhzftheheeeee
What is a Computer? Input Devices /output devices
NewMind AI Weekly Chronicles – August ’25 Week III
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Basics of Cloud Computing - Cloud Ecosystem
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
Training Program for knowledge in solar cell and solar industry
Custom Battery Pack Design Considerations for Performance and Safety

Bootloaders

  • 1. © 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Bootloaders
  • 2. 2© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. What to Expect? W's of Bootloaders Specifics of a Bootloader With U-Boot in consideration U-Boot Hands-On U-Boot Source Code U-Boot Porting
  • 3. 3© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. What is a Bootloader? Simply, a loader (program), which boots up (starts) the system A Customized Program started by Controller's Internal Code in Embedded Systems, Or Default Program Counter settings in Desktops
  • 4. 4© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Tasks of a Bootloader Initialization Tasks Memory Setup & Initialization System Peripheral Initialization for the kernel Actual Task Load the RAM-based File System, like initrd, initramfs, ... Load the Kernel with proper arguments Jump to the start of the Kernel Additional Tasks Multiple Kernel Boots Multiple-way Boots
  • 5. 5© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Design of Bootloaders As Bootloader is started by a fixed code It needs to be placed at a hard-coded location Hard-coded locations are not big enough for the complete code (/ logic / tasks) of the bootloader Hence, it is typically split into 2 portions Stage 1 – Small enough to load Stage 2 from our desired location Stage 2 – The actual bootloader we want to have
  • 6. 6© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Bootloader Comparisons On Desktops Initialization Tasks are done by BIOS Bootloader is to just Boot the Kernel On Embedded Systems All needs to be done by the Bootloader But in an optimized way Hence, the 2 bootloaders are Quite different from each other Later being more board dependent & constrained
  • 7. 7© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Check Name the Stage 1 & Stage 2 bootloaders Desktops Embedded Systems
  • 8. 8© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Stage 2 Bootloader Flavours Prevalent Desktop Bootloaders LILO GRUB SYSLINUX loadlin Coreboot (Earlier called LinuxBIOS) Popular Embedded System Bootloaders BootLoader Object (BLOB) Redboot U-Boot
  • 9. 9© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Specifics
  • 10. 10© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Initialization Details Bootloader starts its execution from flash / *PROM Hardware Diagnostics, like POST, … Configuring the CPU speed, MMU setting, etc Memory Initialization Determining on-board memory size Turning on the caches Clearing memory Optionally, Relocate to RAM, and start execution from there Setting up interfacing ports like serial, VGA, …
  • 11. 11© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot's Argument Passing Three-Party Communication Kernel hard-codes the offset of argument structure Developer attaches the load & start addresses In a U-Boot recognizable Header To the kernel image We shall do when building kernel image U-Boot Reads the U-Boot Header wrapped kernel image Loads the kernel at the read load address Fills the kernel argument structure at the hard-coded offset Arguments are obtained from its environment Jumps to the kernel start address to start executing
  • 12. 12© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. U-boot Hands-on Stopping at the U-Boot Help - “?” Commands Booting: bootp, bootm, boot, ... NOR Flash: erase, cp, protect, … NAND Flash: nand Miscellaneous: reset, ... ... Environment Variables printenv setenv saveenv
  • 13. 13© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Source Tree arch – Architecture dependent Code board – Board dependent Code common – Environment & Command Line Code doc – Documentation drivers – Device specific Drivers fs – File System support Code include – Headers lib – Compression, Encryption related Code net – Minimal Network Stack tools – U-Boot Utilities (mkimage is here)
  • 14. 14© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Compiling Preparing the Makefile Setup (ARCH,) CROSS_COMPILE for cross compilation Or, invoke make with these options Configuring for a particular board make <board>_config Compiling for the configured board make (Output would be u-boot.bin) Cleaning up make clean
  • 15. 15© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. U-Boot Porting Implies adding a new Board to U-Boot That entails Adding <board>_config for make Adding board specific code at the right places
  • 16. 16© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Adding <board>_config Adding an entry in the Makefile with Architecture CPU Board Vendor (May be NULL) SoC (May be NULL) Adding the new board directory under board/ with Makefile Initialization Code for the Board Configuration Makefile Adding the new board header under include/configs/ with Configuration for the Board Note: If a new architecture is added, a U-Boot architecture porting would be needed - though, that is uncommon
  • 17. 17© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Adding Board specific Code Highly depends on the Board CPU Architecture Clock Interfaces Console Interfaces LCD Interfaces Network Interfaces Peripherals … Should be added in the appropriate Folders With appropriate file names And following the U-Boot Coding Guidelines Existing Code may serve as the example for the same
  • 18. 18© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. What all have learnt? W's of Bootloaders Specifics of a U-Boot U-Boot Initialization Sequence U-Boot's argument passing to Kernel U-Boot Hands-On U-Boot Source Code Understanding the Source Structure Configuring for a Board Compiling the u-boot image U-Boot Porting for a New Board
  • 19. 19© 2010-15 SysPlay Workshops <[email protected]> All Rights Reserved. Any Queries?