A simple template for building an x86-64 Limine-compliant kernel in DC.
  • Makefile 79.5%
  • Linker Script 20.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-07 21:49:28 +02:00
.vscode convert the C template into a DC template 2026-09-13 17:42:04 +02:00
kernel use libdcext, runtime checks, and compile_commands.json 2026-10-07 21:49:28 +02:00
.gitignore use libdcext, runtime checks, and compile_commands.json 2026-10-07 21:49:28 +02:00
compile_commands.json use libdcext, runtime checks, and compile_commands.json 2026-10-07 21:49:28 +02:00
GNUmakefile convert the C template into a DC template 2026-09-13 17:42:04 +02:00
LICENSE Update LICENSE copyright for 2026 2026-01-02 14:41:00 +01:00
limine.conf Use limine.h API revision 2 2024-12-05 10:46:51 +01:00
README.md convert the C template into a DC template 2026-09-13 17:42:04 +02:00

Limine DC Template

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

DC is a small freestanding-first systems language; see Personne-admin/dcc for the compiler, language spec, and installation instructions.

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 the dcc DC compiler (see the DCC make variable) capable of targeting x86_64-elf, and a GNU-compatible linker (ld by default, see the LD make variable) capable of linking x86-64 ELF objects.

Building also requires curl, used to download the Limine release and the EDK2 OVMF firmware images, and a C compiler for the host (cc by default, see the HOST_CC make variable), used to build the limine host utility.

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. The run targets require qemu.

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.