This repository will demonstrate how to set up a basic kernel in C++ using Limine.
Anymake
command depends on GNU make (gmake
) and is expected to be run using it. This usually means usingmake
on most GNU/Linux distros, orgmake
on other non-GNU systems.
It is recommended to build this project using a standard UNIX-like system, using a Clang/LLVM toolchain capable of cross compilation.
Additionally, building an ISO withmake all
requiresxorriso
, and building a HDD/USB image withmake all-hdd
requiressgdisk
(usually fromgdisk
orgptfdisk
packages) andmtools
.
TheARCH
make variable determines the target architecture to build the kernel and image for.
The defaultARCH
isx86_64
. Other options include:aarch64
,loongarch64
, andriscv64
.
Runningmake all
will compile the kernel (from thekernel/
directory) and then generate a bootable ISO image.
Runningmake all-hdd
will compile the kernel and then generate a raw image suitable to be flashed onto a USB stick or hard drive/SSD.
Runningmake run
will build the kernel and a bootable ISO (equivalent to make all) and then run it usingqemu
(if installed).
Runningmake run-hdd
will build the kernel and a raw HDD image (equivalent to make all-hdd) and then run it usingqemu
(if installed).
For x86_64, therun-bios
andrun-hdd-bios
targets are equivalent to their non-bios
counterparts except that they bootqemu
using the default SeaBIOS firmware instead of OVMF.