The classic Snake game reimagined as a UEFI Application
Made for fun and showcasing knowledge of EDK2 and UEFI development
Install the necessary packages for building and testing:
sudo pacman -S edk2-ovmf qemu-full base-develsudo apt update
sudo apt install edk2-ovmf qemu-system-x86 build-essential uuid-devsudo dnf install edk2-ovmf qemu-system-x86 gcc make libuuid-develYou'll need a working EDK2 build environment. Follow the steps below.
- A UEFI-compliant device, with a USB port
- A FAT32-formatted USB storage device (thumbstick, disk, ...)
- Download the latest
SnakeX64.efi/SnakeIA32.efi(depending on your CPU architecture) from the Releases Tab - Rename
SnakeX64.efi/SnakeIA32.efitoBOOTX64.EFI/BOOTIA32.EFI(again, depending if your CPU is 32-bit or 64-bit) - Create a folder named
EFIat the root of your FAT32-formatted USB storage device - Inside that newly-created folder, create another folder named
BOOT - Move the
BOOT<ARCH>.EFIto theBOOTfolder- The file should be located at
USB Storage Device/EFI/BOOT/
- The file should be located at
- Reboot your PC, then mash the
F12key to go to the boot menu - Select your USB storage device from the list, and enjoy!
NOTE: If the application doesn't work, please open an issue and list your PC/Motherboard model, along with its BIOS version. Thanks!
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule update --init # cf. https://github.com/tianocore/edk2/tree/master?tab=readme-ov-file#submodules
git clone https://github.com/AstonishedLiker/SnakePkg.gitcd SnakePkg
cd ./Scripts
chmod +x run.sh snake_build.sh
# Examples
./run.sh RELEASE X64# Just compile without launching QEMU
cd ./Scripts
./build.sh RELEASE X64
./build.sh RELEASE IA32The compiled .efi file will be located at:
Build/SnakePkg/DEBUG_GCC5/X64/Snake.efi
./run.sh DEBUG X64 # Only X64 builds are supported for debuggingIn another shell instance:
lldb
# Once inside LLDB:
(lldb) gdb-remote localhost:1234 # QEMU gdb port
(lldb) command script import "<SNAKEPKG_PATH>/lldb_uefi_helper.py"
(lldb) continue
(lldb) auto_load_symbols <SNAKEPKG_PATH>/../Build/SnakePkg/DEBUG_GCC5/X64/debug.log # Will auto-scan for the `debug.log` file!- Install the LLVM DAP VS Code extension.
- Select the
64-bit UEFI Debug Applaunch target in the Debug Pane, which can be accessed in the VS Code sidebar. - The symbols should automatically resolve via
./lldb_uefi_helper.py.
NOTE: Breakpoints before the ImageBase is outputted to ConOut won't be hit!
This project uses a dual-license approach:
The Snake game application code written for this project is licensed under the MIT License.
See the License file for the full MIT License text.
This project builds upon and uses components from the EDK-II project, which is licensed under the BSD-2-Clause-Patent License. This includes:
- EDK2 libraries
- Build system and tooling
- The TianoCore bitmap (from
MdeModulePkg/Logo/Logo.bmp)
See the License.edk2 file for the full BSD-2-Clause-Patent License text.
- TianoCore EDK-II - The UEFI development framework
- UEFI Forum - UEFI specifications