Go to file
2024-03-02 16:30:50 +13:00
kernel update 2024-03-02 16:30:50 +13:00
.gitignore Update 2023-03-27 01:53:14 +02:00
.gitmodules update 2024-03-02 16:30:50 +13:00
LICENSE Update copyright years and update LICENSE format 2024-01-02 22:41:41 +01:00
limine.cfg update 2024-03-02 16:30:50 +13:00
Makefile update 2024-03-02 16:30:50 +13:00
README.md Specify that the kernel is in C in README.md 2023-10-22 00:30:26 +02:00

Limine C Template

This repository will demonstrate how to set up a basic x86-64 kernel in C using Limine.

It is recommended to cross reference the contents of this repository with the Limine Bare Bones OSDev wiki page.

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.

All make all* targets depend on a GNU-compatible C toolchain capable of generating x86-64 ELF objects. Usually gcc/binutils or clang/llvm/lld provided by any x86-64 UNIX like (including Linux) distribution will suffice.

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.

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).

The run-uefi and run-hdd-uefi targets are equivalent to their non -uefi counterparts except that they boot qemu using a UEFI-compatible firmware.