- Resolved Sovereign Trap exit fault by refactoring kernel exit logic
- Implemented persistent Subject fiber with kload loop for clean respawns
- Fixed File not found loop by fixing initrd embedding with proper RISC-V ABI flags
- Eliminated 30KB truncation of initrd restoring full 80KB archive visibility
- Enhanced TarFS driver with robust path normalization
- Implemented exit syscall in libc_shim.zig with CMD_SYS_EXIT and nexus_yield
- Created hello.c and libnexus.h for userland testing
- Updated ion.nim and kernel.nim to handle CMD_SYS_EXEC and CMD_SYS_EXIT
- Ensured bin/nipbox is correctly copied to rootfs before packaging
TIME HAS BEEN INVENTED
======================
Rumpk now has cooperative multitasking with Fibers.
BOOT OUTPUT
-----------
[Fiber A] I am alive! Yielding to B...
[Fiber B] Hello from B! Yielding to A...
[Fiber A] I am back! Yielding to B...
[Fiber B] Returned! Yielding to A...
[Fiber A] Final return. Halting.
IMPLEMENTATION
--------------
hal/switch.S:
- ARM64 context switch (96-byte frame, 16-byte aligned)
- Saves x19-x28, x29 (FP), x30 (LR)
- Stack pointer swap between fibers
core/fiber.nim:
- FiberObject with state (sp, entry)
- fiber_trampoline() - entry point for new fibers
- init_fiber() - sets up initial stack frame
- switch() - cooperative yield to another fiber
BUILD FIXES
-----------
- Added -fno-sanitize=all to prevent ubsan interference
- Added --checks:off --assertions:off to Nim
- Fixed stack alignment (104 -> 96 bytes)
PHASES COMPLETED
----------------
✅ Phase 1: Documentation (SPEC-008/009/010)
✅ Phase 2: Pure Zig libc (Freestanding Doctrine)
✅ Phase 3: Cooperative Fibers (Ping Pong)
→ Phase 4: NPL loading + Ed25519
→ Phase 5: VisionFive 2 RISC-V
The unikernel can now multiplex execution.
POSIX threads are optional. We own the scheduler.
THE GHOST IN THE MACHINE IS EXORCISED
======================================
Rumpk now builds with ZERO C source files.
All libc functions are implemented in pure Zig.
WHAT CHANGED
------------
- NEW: hal/stubs.zig - Pure Zig libc implementation
- memcpy, memset, memmove, memcmp
- strlen, strcmp, strcpy
- malloc, free, realloc, calloc (bump allocator)
- printf, puts, putchar (route to UART)
- exit, abort (halt CPU)
- signal, raise (no-op stubs)
- REMOVED: core/cstubs.c dependency from build
- C code is now only Nim's generated IR
- UPDATED: kernel.nim
- Removed malloc/free/realloc exports
- Now imports from Zig stubs
- UPDATED: build.sh
- Compiles hal/stubs.zig separately
- Links stubs.o with hal.o and nimcache/*.o
DOCTRINE DOCUMENT
-----------------
- .agents/steering/FREESTANDING-DOCTRINE.md
- Codifies the 'Pure Zig ABI' principle
- Documents build requirements
- Lists all exported symbols
VERIFICATION
------------
$ file build/rumpk.elf
ELF 64-bit LSB executable, ARM aarch64, statically linked
$ qemu-system-aarch64 -M virt -kernel build/rumpk.elf
[Rumpk L0] Zig HAL Initialized
[Rumpk L1] Nim Kernel Alive!
[Rumpk L1] The Rubicon is crossed.
[Rumpk L1] Zig + Nim = Sovereign Metal.
This proves:
- POSIX is optional
- GCC is optional
- glibc/musl is optional
- We are the standard library now