Master the fundamental concepts of bios & uefi programming through this focused micro-challenge.
UEFI boots PE/COFF .efi executables linked for the firmware subsystem, not DOS or Linux ELF. A minimal app locates EFI_SYSTEM_TABLE, then calls ConOut->OutputString to print text in UTF-16. For example, GNU-EFI's InitializeLib macro stores the table pointer your efi_main receives in registers per the calling convention.
cLoading…
-nostdlib -e efi_main against libefi/libgnuefiCHAR16 (wide) with L prefixExitBootServices is called.efi from the EFI System Partition (FAT32)GNU-EFI or EDK2-style builds produce a PE32+ image with subsystem EFI_APPLICATION. Copy the .efi to EFI/BOOT/BOOTX64.EFI on a FAT ESP for firmware to auto-run it. OVMF in QEMU boots that path when you point -drive at a vfat disk image. If the screen stays blank, confirm you passed wide strings to ConOut and returned EFI_SUCCESS so firmware does not hang waiting for exit.
You will build a UEFI application that prints a greeting through the ConOut protocol. This exercise requires using the system table's boot services instead of BIOS interrupts or libc printf.
Create a minimal UEFI Hello World application.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github