1

I know MBR bootloaders, the MBR bootloader must switch a computer to the protected mode (as rule) and pass the control to OS kernel, for example here. But what's UEFI bootloader? As I've read UEFI is a some microsystem (like BIOS but it does more stuffs). But what does bootloader do in UEFI case?
I tried to read about it on OSDev Wiki but I got almost nothing, unfortunately... Maybe due to my poor English.

Can someone explain me general steps of a trivial UEFI bootloader to load OS kernel and pass control to it? I couldn't find samples.

P.S. Of course, all operating systems are different same as computer architectures but I mean x86_64 architecture with 64-bit or 32-bit OS kernel.

9
  • 2
    rodsbooks.com/refind Commented Aug 3, 2020 at 21:22
  • @ArtemS.Tashkinov, thank you, I'll try to learn this source code Commented Aug 3, 2020 at 21:34
  • 1
    UEFI firmware is capable of reading from a FAT filesystem (the EFI System Partition) and can load EFI programs from it and execute them. So, by compiling the Linux kernel into a UEFI executable, the firmware can load and start it. End of story. Commented Aug 3, 2020 at 21:36
  • 1
    @oldfred I know this is not boot loader, I mean how does boot loader look with UEFI? Commented Aug 3, 2020 at 22:31
  • 1
    @Шах, здесь вовсю вылезает разница между boot loader (которым может выступать сама UEFI-прошивка) и boot manager (которым она обычно может и не выступать); вдобавок к ссылке на refind предложу свою любимую по этой теме: rodsbooks.com/efi-bootloaders/principles.html Commented Aug 4, 2020 at 4:31

1 Answer 1

1

There can be no extra bootloader (or bootmanager) with UEFI as the firmware itself plays bootloader role (at least to run some other bootloader/bootmanager); most of those I've seen so far lack bootmanager ("boot menu: ...") role -- or play it badly though.

A bootloader can load and run the next-stage executable (another bootloader, bootmanager, a kernel, or e.g. memtest86); in UEFI SecureBoot case it's also held responsible for running the binary's signature validation hooks within firmware.

A bootmanager can read some preconfigured menu or scan for available filesystems and boot targets (or do both like refind does) so as to present the user with a menu to choose from those.

In "trivial" case, one can start a Linux kernel compiled with CONFIG_EFI_STUB=y and placed as \EFI\BOOT\bootx64.efi into an x86_64 system's FAT32 EFI System Partition directly by UEFI firmware although distros don't seem to support that, leaning for grub2 instead.

Artem gave you almost the right link, the one you actually seem to need is Rod's excellent Managing EFI Boot Loaders for Linux: Basic Principles

PS: возможно, пригодится ALT Rescue :)

1

You must log in to answer this question.

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