## Major Features ### 1. Dynamic ELF64 Binary Loading - Implemented ELF parser with full header validation (core/loader/elf.nim) - Created kexec() loader supporting PT_LOAD segment mapping - Added BSS initialization and data copying from VFS - Assembly trampoline (rumpk_enter_userland) for userland entry ### 2. Syscall Infrastructure - Added CMD_SYS_EXEC (0x400) for consciousness swapping - Integrated exec command in NipBox shell - Implemented syscall routing through command ring - Added provenance tracking via SipHash ### 3. Test Binary & Build System - Created hello.c test program for alien binary execution - Automated compilation and initrd inclusion in build.sh - Added libnexus.h header for standalone C programs ### 4. VFS Integration - Implemented TarFS file cursor system for sequential reads - Fixed infinite loop bug in cat command - Added debug logging for VFS mount process ## Technical Improvements ### Memory Management - Fixed input ring null pointer dereference - Implemented CMD_ION_FREE syscall for packet reclamation - Resolved memory leak in input/output pipeline - Added FileHandle with persistent offset tracking ### ABI Stability - Split kprint into 1-arg (Nim) and kwrite (C ABI) - Fixed cstring conversion warnings across codebase - Corrected RISC-V assembly (csrw sie, zero) ### Documentation - Comprehensive Phase 8 documentation (docs/PHASE-8-ELF-LOADER.md) - Detailed implementation notes and debugging status ## Current Status ✅ ELF parser, loader, and syscall infrastructure complete ✅ Test binary compiles and embeds in VFS ✅ Shell integration functional 🔧 Debugging command ring communication (syscall not reaching kernel) ## Files Changed Core: - core/loader.nim, core/loader/elf.nim (NEW) - core/kernel.nim, core/ion.nim (syscall handling) - core/fs/tar.nim (file cursor system) - hal/arch/riscv64/switch.S (userland trampoline) Userland: - npl/nipbox/nipbox.nim (exec command) - libs/membrane/libc_shim.zig (syscall implementation) - libs/membrane/ion.zig (command ring API) Build & Test: - build.sh (hello.c compilation) - rootfs/src/hello.c, rootfs/src/libnexus.h (NEW) - apps/subject_entry.S (NEW) ## Next Steps 1. Debug SysTable and command ring communication 2. Verify ION fiber polling of chan_cmd 3. Test full ELF loading and execution flow 4. Add memory protection (future phase) Co-authored-by: Forge <ai@voxisforge.dev> |
||
|---|---|---|
| .. | ||
| fs | ||
| include | ||
| ion | ||
| loader | ||
| README.md | ||
| channel.nim | ||
| cstubs.c | ||
| fiber.nim | ||
| invariant.nim | ||
| ion.nim | ||
| kernel.nim | ||
| loader.nim | ||
| loader.zig | ||
| overrides.c | ||
| panicoverride.nim | ||
| re-symbol.txt | ||
| ring.nim | ||
| watchdog.nim | ||
README.md
Rumpk Core (L1)
Language: Nim
Purpose: Architecture-agnostic kernel logic
Module Index
| File | Purpose |
|---|---|
kernel.nim |
Main Orchestrator (kmain) |
ion.nim |
ION Control Plane & Channel API |
fiber.nim |
Cooperative fiber abstraction |
watchdog.nim |
Autonomous Immune System (Healer) |
ring.nim |
Lock-free Sovereign ring buffers |
panicoverride.nim |
Freestanding panic handler |
Architecture Independence
This folder contains no architecture-specific code. All platform-specific
details are handled by the HAL layer (../hal/).
Compile-time architecture selection uses Nim's when defined():
when defined(amd64):
const CONTEXT_SIZE = 56
elif defined(arm64):
const CONTEXT_SIZE = 96
elif defined(riscv64):
const CONTEXT_SIZE = 112
Dependencies
- Imports
console_write,rumpk_haltfrom HAL (Zig L0) - Imports
cpu_switch_tofrom arch-specific assembly - Uses
mm:arcmemory management (no GC)
Build
Built via ../build.sh [aarch64|x86_64|riscv64]