A very insightful talk: “Marrying U-Boot, uEFI and grub2 – Alexander Graf – openSUSE…”
Booting is hard. Booting in the ARM world is even harder. State of the art are a dozen different boot loaders that may or may not deserve that name. Each gets configured differently and each has its own pros and cons.
As a distribution this is a nightmare. Configuring each and every one of them complicates code that really should be very simple.
To solve the problem, we can just add another layer of abstraction (grub2) on top of another layer of abstraction (uEFI) on top of another layer of abstraction (u-boot). Follow me on a journey on how all those layers can make life easier for the distribution and how much fun uEFI really is.
After this talk, you will know how ARM systems boot, what uEFI really means, how uEFI binaries interact with firmware and how we are going to move to uEFI based boot on openSUSE for ARM.
Usually known as agraf on-line, [WayBack] Alexander Graf – Open IoT & ELC 2017 is an impressive guy:
Alexander Graf
SUSE
KVM Wizard
Nürnberg Area, GermanyAlexander started working for SUSE about 9 years ago. Since then he worked on fancy things like SUSE Studio, QEMU, KVM and openSUSE on ARM. Whenever something really useful comes to his mind, he tends to implement it. Among others he did Mac OS X virtualization using KVM, nested SVM, KVM on PowerPC and a lot of work in QEMU for openSUSE on ARM. He is the upstream maintainer of KVM for PowerPC, QEMU for PowerPC and QEMU for S390x.
Slides: [WayBack] Marrying U-Boot, UEFI and grub.pdf
There are 2 videos on YouTube (view them below):
- a half hour from 2016 at [WayBack] media.ccc.de – uEFI grub2 on Raspberry Pi
- a full hour from 2017 at [WayBack] Open IoT & ELC 2017: Marrying U-Boot, uEFI and grub2 – Alexander Graf – openSUSE…
A few things I learned
Boot sequence:
- Raspberry Pi has a tiny boot ROM
- It loads the firmware in the GPU (for Raspberry this is a Raspberry Foundation provided binary)
- The firmware loads U-Boot
- U-Boot loads grub2
- grub2 can have many modules (like file system drivers) and loads the kernel
Alexander pushed the U-Boot stuff up stream, but the FreeBSD team was the first to actually boot a full OS from it.
Relations:
- uEFI/EFI is a set of specs that define the API
- U-Boot is the firmware implementing uEFI, so your machine behaves as a PC making booting a lot more standardised, starting at handing off to a regular grub2 boot process
- U-Boot loads grub2
U-boot:
- There is a command-line interface for U-boot: [WayBack] UBootCommandLineInterface < DULG < DENX.
- Example commands:
md.b
(shows bytes starting at memory address for a certain length)
- Example commands:
- You do not need to use the command-line as by default there is “autoboot” (which you can set the time out for or disable with an environment variable: [WayBack] UBootEnvVariables < DULG < DENX)
- Since Raspberry Pi does not have a BIOS, the
config.txt
is used for that; specs at [WayBack] config.txt – Raspberry Pi Documentation
–jeroen
References:
Images