bootnim is a development environment for writing UEFI drivers/applications in Nim. It features a tiny libc written in Nim to support some of the Nim standard library within the UEFI runtime environment. It also features a Nim-based library that supports UEFI functionality.
- Nim 2.0+
- Zig 0.13.0
- Any C compiler can be substituted but Zig is lightweight, comes with a UEFI target, and includes out-of-the-box cross-compilation
In MacOS you can install the build dependencies with brew, for example:
$ brew install nim zigIn Arch Linux, you can use pacman, for example:
$ pacman -S nim zigSee installation details for zig and nim, and make sure they are added to your PATH
- Install the build requirements
- Clone this repository
$ git clone https://github.com/earowley/bootnim && cd bootnim- (Optional) If using QEMU, move OVMF.fd under images/
- Modify the main function under src/main.nim
# Must be exported by default
# You can modify the "Nim entry point" in stubs/app.nim
proc main* =
echo "Hello world"- Run desired nimble build
# Creates .efi binary under build/bin
$ nimble build
# Creates .efi binary and launches QEMU
$ nimble qemu