A simple library for creating EFI applications/operating systems in Zig.
NOTE: Only Zig version 0.14.0-dev.2577+271452d22 is supported as of the latest commit. (Although you will not need zig to compile, as it uses docker by default).
- In your project containing your
build.zigfile:
zig fetch --save git+https://codeberg.org/Land/zig-efi-lib- Copy these files into your project:
- Dockerfile
- Makefile
- build.zig template (Rename to
build.zig)
- Done!
- Install Docker
- Run:
make docker name="name of OS"- Never have to call EFI functions manually
- Heap management
- Optional panic handler that enables partial debugging (depending on how far along the OS setup is)
- Graphics
- Text rendering
- 2D graphics (can make games)
- EFI Filesystem
- Read-only filesystem
- Files and directories
- Input/Output
- Experimental mouse input
- Hardware RNG
- Fallbacks to software RNG if hardware RNG fails
Automatically generated API Reference for the project can be found at https://landstander27.github.io/zig-efi-lib. Note that Zig autodoc is in beta; the website may be broken or incomplete.
To run these examples, excluding the last one, run make example example="dir" run, with dir being a directory in examples.
- Hello World: Quick "Hello World" example.
- Heap: Simple heap example.
- Panic: Showcases how to use the optional panic handler.
- Graphics: Text and 2D graphics.
- Advanced: Skeleton for an "advanced" project.
- Snake: A snake game. Showcases how to draw to screen with a framebuffer.
- AeroOS: Simple OS I created that originally gave me the idea for this project. Most of the code of this library is taken from here.
- When building with docker, why are the error messages not "pretty"?:
- Instead of running
make docker, runmake docker dockerflags="-it".
- Instead of running