A hobbyist monolithic kernel written in c++. Trying to be posix style.
Limine-c++-template: https://codeberg.org/Limine/limine-cxx-template/src/branch/trunk/limine.conf
- Limine config + base revision check
- C++ global constructor invocation
-
hcfhalt routine - Linker script
- Framebuffer driver
- Flanterm-backed TTY
-
klogprintf-style kernel logger - Minimal libc (memset/memcpy/strlen, etc.)
- GDT load
- IDT + ISR stubs
- Exception handlers
- PIC remap + IRQ mask scaffolding
- PMM with free-list allocator
- VMM: 4-level paging, kernel HHDM mapping, kernel section mapping with NX, EFER.NX, CR3 load
- Reclaim
bootloader_reclaimablememory after VMM init (stub exists, not wired intokmain)
-
Thread/Taskstruct (registers, kernel stack, state) - Context switch in asm (save/restore GPRs, RFLAGS, RIP, RSP)
- Ready queue + round-robin scheduler
- Timer-driven preemption (PIC timer ISR →
schedule()) -
sleep/wait queues, blocking primitives - Idle thread
- User CS/DS/TSS in GDT, IST stacks
- Per-process address space (clone kernel-half PML4 entries into new pagemap)
- User page mapping flags (USER bit) in VMM
- ELF64 loader (program headers → mmap into address space)
-
iretq-based ring 3 entry - Syscall entry: SYSCALL/SYSRET, MSR setup (STAR/LSTAR/SFMASK)
- Initial syscall set (write, exit, getpid, mmap, brk)
- Kernel heap (
kmalloc/kfree, slab or bump-then-free-list on top of PMM) -
unmapshould also free intermediate page tables when empty + INVLPG / TLB shootdown - Replace PIC with APIC + LAPIC timer (or HPET) — needed for preemptive scheduling
- ACPI table parsing (RSDP/MADT) — feeds APIC/SMP
- PS/2 keyboard or serial input for interactive debugging
- Pipes or message ports
- Shared memory regions (VMM API for shared mappings)
- Signals or equivalent async notification
- Synchronization primitives exposed to userspace (futex-like)
- VFS node abstraction (
vnode/inode, ops table) - Mountpoint + path resolution
- In-memory
tmpfsas first backend - File descriptor table per process
-
open/read/write/close/statsyscalls - A real disk FS (FAT32 or ext2) and a block driver (AHCI/virtio-blk) when ready