This repo contains examples about how to use Zig to build UEFI apps.
Recommended reading order:
Run zig build in any of the subdirectories to build.
Then you can copy the output file to a FAT32 formatted device to efi/boot/bootx64.efi.
Alternatively you can use QEMU with qemu-system-x86_64 -bios /usr/share/edk2-ovmf/OVMF_CODE.fd -hdd fat:rw:. -serial stdio.
At least 128 KiB before calling exitBootServices().
After calling exitBootServices() you have to provide at least 4 KiB.
By default, your firmware’s watchdog reboots your system after 5 minutes if your application does not call exitBootServices().
You can disable the watchdog timer using boot_services.setWatchdogTimer(0, 0, 0, null).
Read the spec. It’s really well written.