Silly toy project made to learn about EDK II
It throws you a simple math question — the sum of two random numbers.
Get it wrong, and you'll be mocked and the system shuts down.
Get it right, and the boot continues like nothing ever happened.
Running on QEMU
demo_qemu.mp4
Running on Thinkpad X270
demo_thinkpad.mp4
- Download
UserEvaluationForIneptness.efi
from releases - Or build from source
ESP
is typically mounted at/boot
or/efi
reference
Example
phrases.txt
are provided in repo root
# Create directory structure
sudo mkdir /boot/EFI/UEFIGame
# Copy the application
sudo cp UserEvaluationForIneptness.efi /boot/EFI/UEFIGame/
# Optional: Copy phrases file (must be UTF-16)
sudo cp phrases.txt /boot/EFI/UEFIGame/
Easiest way is to use efibootmgr
sudo efibootmgr --create --disk /dev/nvme0n1 --part 1 \
--loader '\EFI\UEFIGame\UserEvaluationForIneptness.efi' \
--label "UEFIGame"
Adjust
--disk
and--part
to match your system
Restart your system and enter the UEFI Setup
(formerly known as BIOS), look for the boot options section and select the EFI entry you just created
# Arch Linux
sudo pacman -S qemu edk2-ovmf
# Debian/Ubuntu
sudo apt install qemu-system-x86 ovmf
# Fedora
sudo dnf install qemu edk2-ovmf
Qemu can emulate a virtual drive with a FAT filesystem. It works by prepending fat: to a directory name. reference
# Create directory structure
mkdir -p uefi_disk/EFI/UEFIGame
Get UserEvaluationForIneptness.efi
either from the release section or build it yourself and copy it on the virtual disk
Example
phrases.txt
are provided in repo root
# Copy the application
cp UserEvaluationForIneptness.efi uefi_disk/EFI/Boot/BOOTX64.efi
# Optional: Copy phrases file (must be UTF-16)
cp phrases.txt uefi_disk/EFI/UEFIGame/
qemu-system-x86_64 \
-drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \
-drive file=fat:rw:./uefi_disk,format=raw,if=virtio \
-cpu qemu64,+rdrand
Notes:
- Replace OVMF path if needed (common alternatives:
/usr/share/OVMF/OVMF_CODE.fd
) - The
BOOTX64.EFI
filename is required for automatic UEFI boot
The game will choose a random phrase (Reservoir Sampling) from this file as response if the user fails the question. If the file is not available or something crashed the game falls back to a default phrase.
Nothing fancy, check the example phrases.txt
provided
- file must be UTF-16
- phrases can be multiline
- phrases are separated by 1 empty line (\n\n)
Follow the instructions to get a working EDK II build environment
All following commands should be run inside the
edk2
directory
Clone this repo as UefiGamePkg
git clone https://github.com/mycroftsnm/UEFIGame.git UefiGamePkg
Build command example
build -p UefiGamePkg/UefiGamePkg.dsc -a X64 -t GCC5 -b DEBUG -m UefiGamePkg/UserEvaluationForIneptness.inf
The
-m
part is useful to avoid building allMdeModulePkg
modules.
This will generate a (hopefully) working efi binary at Build/UefiGame/DEBUG_GCC5/X64/UefiGamePkg/UserEvaluationForIneptness/OUTPUT/UserEvaluationForIneptness.efi