Active #osdev #kernel #C #x86-64

OS-R

A POSIX-compliant operating system for x86-64, written from scratch.

LanguageC / C++ / Assembly
RoleAuthor
Stack CC++x86-64 assemblyLLVMLimineMultiboot2

OS-R is a POSIX-compliant operating system for x86-64, written from scratch in C, C++ and assembly. It started because I wanted to know what a kernel actually does at boot, and reading about it was not getting me there.

Booting from anything #

Multiboot2 hands you a machine in 32-bit protected mode. Limine hands you one already in long mode with paging enabled. U-Boot does something else again. The obvious approach is a separate entry path per bootloader, which means three versions of the earliest and least testable code in the kernel.

Instead every bootloader enters through the same ELF trampoline, which normalises the machine state before any kernel code runs. I wrote that up in Bootloader-Agnostic Kernels.

The rest #

The kernel is higher-half, with virtual memory management and a syscall layer. I have ported a libc and the LLVM toolchain, so userland programs can be compiled on the system itself rather than cross-compiled from my laptop.