mycroftsnm/UEFIGame
حول
UefiGamePkg: Collection of UEFI games
الألعاب والمحاكاةالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلSilly toy project made to learn about EDK II
Consists of multiple modules, each implementing a mini-game that can run in a UEFI environment and following the premise of " Win -> Boot, Lose -> Shutdown"
User Evaluation For Ineptness: Presents a simple math question, the sum of two random numbers from 0 to 99, if your answer is incorrect the system mocks you and shuts down.
Insult Sword Fighting: Monkey island inspired. Choose the correct comeback to continue booting.
Fall To Boot: Vertical scrolling procedurally generated tunnel. Reach the bottom or you'll Fail to Boot.
Age Verification: Leisure Suit Larry inspired. Answer 80s pop culture trivia to prove you're an adult. Get it wrong and the system decides you're too young to use this computer.
UEFI Says: A memory test... but not for the computer. Simon-like game implementation. Win to boot or fail and shutdown.
Demo videos
User Evaluation For Ineptness Running on QEMU
User Evaluation For Ineptness Running on Thinkpad X270
Fall To Boot Running on QEMU
UEFI Says Running on QEMU
Note
In this README, Insult Sword Fighting is used as the example module throughout. You can substitute any mention of it and its files with any other module.
Running
Real Hardware
1. Get the EFI Application
- Download
InsultSwordFighting.efifrom releases - Or build from source
2. Copy EFI Application and neccesary files to ESP
ESPis typically mounted at/bootor/efireference
# Create directory structure
sudo mkdir /boot/EFI/UEFIGame
# Copy the efi application
sudo cp InsultSwordFighting.efi /boot/EFI/UEFIGame/
# Copy extra file
sudo cp insults.txt /boot/EFI/UEFIGame/
Insult Sword Fighting needs
insults.txtto be present in/esp/EFI/UEFIGame, exampleinsults.txtprovided
User Evaluation For Ineptess needs
phrases.txtto be present in/esp/EFI/UEFIGame, examplephrases.txtprovided
Age Verification needs
questions.txtto be present in/esp/EFI/UEFIGame, examplequestions.txtprovided
3. Create EFI boot entry
Easiest way is to use efibootmgr
sudo efibootmgr --create --disk /dev/nvme0n1 --part 1 \
--loader '\EFI\UEFIGame\InsultSwordFighting.efi' \
--label "UEFIGame"
Adjust
--diskand--partto match your system
4. Reboot and run
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
QEMU + OVMF
1. Install Dependencies
# Arch Linux
sudo pacman -S qemu edk2-ovmf
# Debian/Ubuntu
sudo apt install qemu-system-x86 ovmf
# Fedora
sudo dnf install qemu edk2-ovmf
2. Prepare Virtual FAT Filesystem
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
3. Copy EFI Application and neccesary files
Get InsultSwordFighting.efi either from the release section or build it yourself and copy it on the virtual disk
# Copy the application
cp InsultSwordFighting.efi uefi_disk/EFI/Boot/BOOTX64.efi
# Optional: Copy phrases file (must be UTF-16)
cp phrases.txt uefi_disk/EFI/UEFIGame/
4. Launch QEMU
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.EFIfilename is required for automatic UEFI boot
Extra files
Extra files should be placed in the same directory as the .efi file.
User Evaluation For Ineptness
phrases.txt
This file is optional. If it is not present, the game will always use the same fallback phrase.
Example provided: phrases.txt
How it works
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.
Format
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)
Insult Sword Fighting
insults.txt
This file is mandatory and must be UTF-16.
Example provided: insults.txt
How it works
The game will choose a random insult and its responses.
Format
Insult
Correct comeback
incorrect comeback
another incorrect comeback
...
as many incorrects comebacks as you want
Another insult
Correct comeback
...
Age Verification
questions.txt
This file is optional. If not present, the game uses a fallback question.
Example provided: questions.txt
How it works
The game will choose a random trivia question (Reservoir Sampling) about 70s/80s pop culture.
Format
Question text
Correct answer
Wrong answer
Wrong answer
Wrong answer
Another question
Correct answer
...
- File must be UTF-16
- First answer after the question is always the correct one (answers are shuffled on display)
- Questions are separated by 1 empty line
failmessages.txt
This file is optional. Contains snarky messages shown when you fail.
Example provided: failmessages.txt
- File must be UTF-16
- Messages are separated by 1 empty line
Building
Instructions
1. Environment Setup
Follow the instructions to get a working EDK II build environment
All following commands should be run inside the
edk2directory
2. Clone
Clone this repo as UefiGamePkg
git clone https://github.com/mycroftsnm/UEFIGame.git UefiGamePkg
3. Build
First of all, run edksetup.sh (or edksetup.bat if using windows)
source edksetup.sh
Build command example
build -p UefiGamePkg/UefiGamePkg.dsc -a X64 -t GCC5 -b DEBUG -m UefiGamePkg/InsultSwordFighting.inf
The
-mpart is useful to avoid building allMdeModulePkgmodules.
This will generate a (hopefully) working efi binary at Build/UefiGame/DEBUG_GCC5/X64/InsultSwordFighting.efi
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…