Bootloaders

Anil Kumar Pugalia
Anil Kumar PugaliaLinux Geek and Open Source Hardware & Software Freak, Corporate Trainer, Entrepreneur in Automation
© 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?
1 of 19

Recommended

Board Bringup by
Board BringupBoard Bringup
Board BringupAnil Kumar Pugalia
28.7K views16 slides
BeagleBone Black Bootloaders by
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black BootloadersSysPlay eLearning Academy for You
4.6K views24 slides
Linux Porting by
Linux PortingLinux Porting
Linux PortingAnil Kumar Pugalia
17.5K views29 slides
Block Drivers by
Block DriversBlock Drivers
Block DriversAnil Kumar Pugalia
38.4K views21 slides
Embedded_Linux_Booting by
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
513 views30 slides
BeagleBone Black Booting Process by
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting ProcessSysPlay eLearning Academy for You
18.3K views29 slides

More Related Content

What's hot

USB Drivers by
USB DriversUSB Drivers
USB DriversAnil Kumar Pugalia
42.9K views31 slides
U-Boot - An universal bootloader by
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader Emertxe Information Technologies Pvt Ltd
3K views46 slides
Embedded Linux BSP Training (Intro) by
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
778 views29 slides
Uboot startup sequence by
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
33.7K views17 slides
Kernel Debugging & Profiling by
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & ProfilingAnil Kumar Pugalia
18.8K views14 slides
linux device driver by
linux device driverlinux device driver
linux device driverRahul Batra
11.4K views37 slides

What's hot(20)

Uboot startup sequence by Houcheng Lin
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
Houcheng Lin33.7K views
linux device driver by Rahul Batra
linux device driverlinux device driver
linux device driver
Rahul Batra11.4K views
Basics of boot-loader by iamumr
Basics of boot-loaderBasics of boot-loader
Basics of boot-loader
iamumr8.3K views
U-Boot presentation 2013 by Wave Digitech
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
Wave Digitech18.7K views
U boot porting guide for SoC by Macpaul Lin
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin11.9K views
RISC-V Boot Process: One Step at a Time by Atish Patra
RISC-V Boot Process: One Step at a TimeRISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a Time
Atish Patra1.5K views

Viewers also liked

Linux User Space Debugging & Profiling by
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingAnil Kumar Pugalia
6.5K views36 slides
Functional Programming with LISP by
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISPAnil Kumar Pugalia
6.1K views23 slides
Mobile Hacking using Linux Drivers by
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversAnil Kumar Pugalia
6K views33 slides
Shell Scripting by
Shell ScriptingShell Scripting
Shell ScriptingAnil Kumar Pugalia
6.2K views27 slides
Embedded Software Design by
Embedded Software DesignEmbedded Software Design
Embedded Software DesignAnil Kumar Pugalia
7K views29 slides
Synchronization by
SynchronizationSynchronization
SynchronizationAnil Kumar Pugalia
9K views21 slides

Similar to Bootloaders

BeagleBoard-xM Booting Process by
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessSysPlay eLearning Academy for You
3.8K views25 slides
BeagleBone Black Bootloaders by
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black BootloadersSysPlay eLearning Academy for You
4K views27 slides
BeagleBoard-xM Bootloaders by
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersSysPlay eLearning Academy for You
7.3K views17 slides
Armboot process zeelogic by
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogicAleem Shariff
2.3K views22 slides
C C N A Day2 by
C C N A  Day2C C N A  Day2
C C N A Day2darulquthni
1.8K views131 slides
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx by
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docxLynellBull52
4 views412 slides

Similar to Bootloaders(20)

Armboot process zeelogic by Aleem Shariff
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
Aleem Shariff2.3K views
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx by LynellBull52
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
LynellBull524 views
SESI 7 RouterTroubleshooting.pptx by FirmanAFauzi1
SESI 7 RouterTroubleshooting.pptxSESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptx
FirmanAFauzi15 views
5 p9 pnor and open bmc overview - final by Yutaka Kawai
5 p9 pnor and open bmc overview - final5 p9 pnor and open bmc overview - final
5 p9 pnor and open bmc overview - final
Yutaka Kawai2.1K views
Id. 01 router (computing) by Rawa KirKuKi
Id. 01 router (computing)Id. 01 router (computing)
Id. 01 router (computing)
Rawa KirKuKi517 views
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?" by Piotr Król
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"
Piotr Król455 views
Ch3 v70 project_structure_en by confidencial
Ch3 v70 project_structure_enCh3 v70 project_structure_en
Ch3 v70 project_structure_en
confidencial 821 views
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood by EmbeddedFest
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hoodEmbedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
EmbeddedFest421 views
Ansible part for_po_c(w dellos9 dellos10)_ext_v1.0 by Jo Hoon
Ansible part for_po_c(w dellos9 dellos10)_ext_v1.0Ansible part for_po_c(w dellos9 dellos10)_ext_v1.0
Ansible part for_po_c(w dellos9 dellos10)_ext_v1.0
Jo Hoon416 views

More from Anil Kumar Pugalia

File System Modules by
File System ModulesFile System Modules
File System ModulesAnil Kumar Pugalia
21K views37 slides
Kernel Debugging & Profiling by
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & ProfilingAnil Kumar Pugalia
6K views14 slides
Processes by
ProcessesProcesses
ProcessesAnil Kumar Pugalia
7K views33 slides
System Calls by
System CallsSystem Calls
System CallsAnil Kumar Pugalia
4.2K views17 slides
Introduction to Linux by
Introduction to LinuxIntroduction to Linux
Introduction to LinuxAnil Kumar Pugalia
4K views33 slides
Playing with R L C Circuits by
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C CircuitsAnil Kumar Pugalia
2.8K views17 slides

Recently uploaded

Kyo - Functional Scala 2023.pdf by
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdfFlavio W. Brasil
298 views92 slides
Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
55 views21 slides
Vertical User Stories by
Vertical User StoriesVertical User Stories
Vertical User StoriesMoisés Armani Ramírez
12 views16 slides
Data-centric AI and the convergence of data and model engineering: opportunit... by
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...Paolo Missier
39 views40 slides
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院IttrainingIttraining
41 views8 slides

Recently uploaded(20)

Data-centric AI and the convergence of data and model engineering: opportunit... by Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier39 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang37 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada135 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker33 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma31 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10237 views
DALI Basics Course 2023 by Ivory Egg
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023
Ivory Egg16 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software257 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb13 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Lilypad @ Labweek, Istanbul, 2023.pdf by Ally339821
Lilypad @ Labweek, Istanbul, 2023.pdfLilypad @ Labweek, Istanbul, 2023.pdf
Lilypad @ Labweek, Istanbul, 2023.pdf
Ally3398219 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson66 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptxBlack and White Modern Science Presentation.pptx
Black and White Modern Science Presentation.pptx
maryamkhalid291616 views

Bootloaders

  • 1. © 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Bootloaders
  • 2. 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. 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. 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. 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. 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. 7© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Check Name the Stage 1 & Stage 2 bootloaders Desktops Embedded Systems
  • 8. 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. 9© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. U-Boot Specifics
  • 10. 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. 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. 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. 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. 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. 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. 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. 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. 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. 19© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?