5

I'm reading a book (Mastering Embedded Linux Programming, 2nd ed). In the chapter on bootloaders it explains the booting process with U-Boot and with UEFI firmware.

It looks like the booting steps are exactly the same, with exception that at the last step either U-Boot or UEFI firmware takes over and loads a Linux image in RAM.

So what is the exact difference? Why would one choose U-Boot over UEFI or vica versa?

3
  • 1
    It's probably got a lot to do with how much user configurability you want in your bootloader. Uboot would hardcode a lot of boot configuration items such as kernel location and parameters and so on while full UEFI bootloader may need to be a bit more dynamic and be able to scan for disks and boot locations.
    – Mokubai
    Mar 23, 2018 at 14:59
  • It really depends on what you define as the “last step”. UEFI does a lot. U-Boot does not.
    – Daniel B
    Mar 23, 2018 at 15:05
  • @DanielB Can you get into more details?
    – flashburn
    Mar 23, 2018 at 15:28

2 Answers 2

12

The UEFI specification describes an API that a firmware may expose. This API can be used by applications and drivers loaded by the firmware.

The open source firmware Das U-Boot contains a partial implementation of the UEFI specification. A complete open source implementation is offered by TianoCore EDK II. Companies like Phoenix offer closed source UEFI firmware.

On the 64-bit ARM architecture the Linux distributions Suse and Fedora use U-Boot to load GRUB as a UEFI application from U-Boot which in turn loads and starts the Linux kernel via UEFI API calls. Linux itself has an UEFI stub so it can be started as a UEFI application.

The UEFI specification defines a runtime that stays in memory until the system is rebooted. The UEFI runtime offers services including changing UEFI variables, uploading new firmware, and rebooting the system. Compliant to the UEFI specification U-Boot also contains a UEFI runtime. But as of today the functionality is limited to rebooting the system.

3

The biggest difference is that UEFI is essentially an operating system, while U-Boot is just a bootloader. U-Boot does just enough to make the system bootable and provides a bit extra to simplify debugging of the boot problems. UEFI on the other hand provides a large set of runtime API's that make MS-DOS seem simple by comparison, and unlike U-Boot, which largely gets out of your way once it's handed off execution, UEFI sticks around.

Beyond that, there are licensing differences (U-Boot is a bit more open than UEFI), file format differences (U-Boot uses a custom, minimalistic image file format, UEFI uses PE32+ executables), and differences in the actual state of the system at the execution handoff, and the means of configuration (UEFI often has integrated firmware configuration options, while U-Boot typically requires rebuilding the firmware and re-flashing it).

3
  • UEFI is an API and not an operating system. Both EDK II and U-Boot are bootloaders implementing this API. Both are licensed under GPL 2.
    – Xypron
    Aug 1, 2019 at 18:08
  • @Xypron UEFI is indeed an API, but so is an OS in the purest sense. The simple fact is that UEFI provides most of the functionality that any modern OS does, so it is functionally an operating system. Also, last I checked, U-Boot does not implement UEFI in any way (some of the functionality they provide is similar,, but it's not the same API's). Aug 1, 2019 at 18:40
  • @austin-hemmelgam The UEFI implementation in U-Boot is based on the official specification. Since 2017 GRUB can be started as an UEFI payload. See events17.linuxfoundation.org/sites/events/files/slides/…
    – Xypron
    Aug 14, 2019 at 21:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .