
A minimalist, capability-based, C3 x86-64 kernel with a C UEFI bootloader, pre-emptive multitasking and soon-to-come modern features. Also an open-source personal and academic project.
-
Boson – UEFI bootloader
- Loads and parses ELF kernel binaries
- Initializes PML4 page tables and long-mode environment
-
Lepton – Pure-C OOP framework (bootloader only)
- Simulated classes, interfaces, and exceptions with minimal overhead
- Organized kernel modules with structured dispatch and lifecycle
- Java-like syntax with class and interfaces inheritance
-
Muon – Minimal and modern kernel written in C3
- Capability-based security and resource sharing via handles and IDs
- Pre-emptive round-robin scheduler via timer IRQs
- Modern set of syscalls
The full milestone breakdown is available here.
- 🚀 Milestone 0 – Bootloader
- 🏗️ Milestone 0.1 – Foundations
- 📗 Milestone 0.2 – Memory Management
- 🕹️ Milestone 0.3 – Interrupts and Timing
- 🐎 Milestone 0.4 – Kernel mode scheduler (cooperative round-robin)
- Task/Thread structure with context and stack
- Preemptive context switch via timer interrupt
- FPU context save and restore
- Process functions
create(),start()andterminate()/exit() - Cooperative task
yield()function -
sleep_ms()andsuspend()/resume()functions -
wait()anddetach()functions - Synchronization primitives via Semaphore object
- Basic shell to launch programs
- 👥 Milestone 0.5 - Userspace
- TBD
- 🔐 Milestone 0.6 - Capability System
-
HandleandObjectTableimplementations - Per-Task private capability space
- Kernel-wide capability implementation
- More TBD
-
- 📁 Milestone 0.7 - File System basics
- TBD
muon.kernel.shell.demo.webm
The video above shows muon kernel shell (mush) running on serial port COM3 on QEMU. The port is linked to PTY and available for minicom (or any other terminal emulator) on /dev/pts/X where X is chosen by QEMU based on available pseudo-terminal endpoints.
The shell itself is an independent process and recognizes many commands such as clear, help, time, sleep and more as shown in the help command output. Most notable commands are:
timethat demonstrates the internal wallclock being updated every secondrandthat generates a hardware-backed random number via therdrandinstructionspawnerthat creates up to 4 child processes that prints "Hello world" to the terminal output
After the shell starts a program (one of sleep, spawner or time) it waits for the new task to terminate and return before resuming execution, ensuring no time slices are assigned to it.
Note
While the shell is supposed to shutdown VirtualBox, it is not yet fully compatible with the kernel.
You can explore the shell code here.
C3 is a C evolution aiming to be safer and more powerful while being familiar to the old C. It provides several additions useful to kernel programming like more granular bitstructs, methods, semantic macros and zero-overhead error checks, being fully compatible with the C ABI.
A quick overview of the main differences from C development:
- no
include/dir and header.hfiles – files are logically grouped in modules; to keep source code tidy, module interface and implementation are split in*.c3iand*.c3files respectively - clearer functions – thanks to the module system, each function can be called via its module name using
module::functionthus having a code that is simpler to read. New and existing types can have methods when they represent a mutable object - semantic macros – enable powerful meta-programming stuff like defining a list of lambdas for IRQs at compile time
- runtime types and reflection – possibility to access types, enum and qualified method names, and much more