https://github.com/48cf/limine-zig-template
A simple template for building a Limine-compliant kernel in Zig.
https://github.com/48cf/limine-zig-template
amd64 bare-bones barebones kernel limine limine-bootloader template x86-64 zig ziglang
Last synced: about 1 month ago
JSON representation
A simple template for building a Limine-compliant kernel in Zig.
- Host: GitHub
- URL: https://github.com/48cf/limine-zig-template
- Owner: 48cf
- License: 0bsd
- Created: 2022-07-31T01:05:17.000Z (almost 3 years ago)
- Default Branch: trunk
- Last Pushed: 2025-03-12T22:19:02.000Z (2 months ago)
- Last Synced: 2025-04-05T08:43:53.449Z (about 1 month ago)
- Topics: amd64, bare-bones, barebones, kernel, limine, limine-bootloader, template, x86-64, zig, ziglang
- Language: Makefile
- Homepage:
- Size: 6.84 KB
- Stars: 30
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Limine Zig Template
This repository will demonstrate how to set up a basic kernel in Zig using Limine.
## How to use this?
### Dependencies
Any `make` command depends on GNU make (`gmake`) and is expected to be run using it. This usually means using `make` on most GNU/Linux distros, or `gmake` on other non-GNU systems.
A Zig compiler is required to build the kernel. Minimum supported version is 0.14.0. You can install Zig from the [official website](https://ziglang.org/download/).
Additionally, building an ISO with `make all` requires `xorriso`, and building a HDD/USB image with `make all-hdd` requires `sgdisk` (usually from `gdisk` or `gptfdisk` packages) and `mtools`.
### Architectural targets
The `ARCH` make variable determines the target architecture to build the kernel and image for.
The default `ARCH` is `x86_64`. Other options include: `aarch64`, `loongarch64`, and `riscv64`.
### Makefile targets
Running `make all` will compile the kernel (from the `kernel/` directory) and then generate a bootable ISO image.
Running `make all-hdd` will compile the kernel and then generate a raw image suitable to be flashed onto a USB stick or hard drive/SSD.
Running `make run` will build the kernel and a bootable ISO (equivalent to make all) and then run it using `qemu` (if installed).
Running `make run-hdd` will build the kernel and a raw HDD image (equivalent to make all-hdd) and then run it using `qemu` (if installed).
For x86_64, the `run-bios` and `run-hdd-bios` targets are equivalent to their non `-bios` counterparts except that they boot `qemu` using the default SeaBIOS firmware instead of OVMF.