TanOS 0.1 - from-scratch Rust microkernel: ring-3 isolation, synchronous IPC, fault isolation (QEMU/KVM)
Posted: Sat Jun 13, 2026 3:32 pm
TanOS is a from-scratch x86-64 microkernel in Rust. It boots under QEMU/KVM and demonstrates:
4-level paging - each process gets its own address space
Ring 3 userspace - loads ELF binaries from an initrd via iretq
Synchronous IPC - cross-address-space call/receive/reply rendezvous
Fault isolation + restart-on-crash - a ring-3 crash kills only that process; the kernel can restart it from its image while others keep running. (Restart-from-image, not full reincarnation - clients aren't transparently re-bound to the restarted process.)
IPC latency - ~3,800 cycles/round-trip under KVM (unoptimized; two CR3 reloads, no PCID, spinlocks per trip)
Design decisions worth knowing:
Single kernel stack - every int 0x80 syscall saves the full register frame onto one reused kernel stack. Context switching copies that frame into the current PCB, restores another process's frame + CR3, and iretqs. This works safely because the syscall gate clears IF, preventing nested entries, so one stack always suffices.
Memory layout puts the kernel identity-mapped in the low 1 GB (2 MB huge pages) reachable from every address space, userspace starting at 0x40000000, and the user stack at 0xC0000000 - chosen specifically to avoid non-canonical address faults (we hit that bug; it's documented in the README).
What to look for when testing: build and boot per the README, then check /tmp/s.txt - you should see the driver crash, reincarnate, and the survivor confirm it stayed alive throughout.
No disk image yet - builds from source via cargo +nightly-2024-01-15. Full instructions in the README.
Disclosure: built with heavy AI assistance (Claude). Judge the output, not the prose.
GitHub: https://github.com/hawkaiglai/tanos
-----
EDITED
4-level paging - each process gets its own address space
Ring 3 userspace - loads ELF binaries from an initrd via iretq
Synchronous IPC - cross-address-space call/receive/reply rendezvous
Fault isolation + restart-on-crash - a ring-3 crash kills only that process; the kernel can restart it from its image while others keep running. (Restart-from-image, not full reincarnation - clients aren't transparently re-bound to the restarted process.)
IPC latency - ~3,800 cycles/round-trip under KVM (unoptimized; two CR3 reloads, no PCID, spinlocks per trip)
Design decisions worth knowing:
Single kernel stack - every int 0x80 syscall saves the full register frame onto one reused kernel stack. Context switching copies that frame into the current PCB, restores another process's frame + CR3, and iretqs. This works safely because the syscall gate clears IF, preventing nested entries, so one stack always suffices.
Memory layout puts the kernel identity-mapped in the low 1 GB (2 MB huge pages) reachable from every address space, userspace starting at 0x40000000, and the user stack at 0xC0000000 - chosen specifically to avoid non-canonical address faults (we hit that bug; it's documented in the README).
What to look for when testing: build and boot per the README, then check /tmp/s.txt - you should see the driver crash, reincarnate, and the survivor confirm it stayed alive throughout.
No disk image yet - builds from source via cargo +nightly-2024-01-15. Full instructions in the README.
Disclosure: built with heavy AI assistance (Claude). Judge the output, not the prose.
GitHub: https://github.com/hawkaiglai/tanos
-----
EDITED