PHASE 14: THE FORGE IS LIT =========================== Implemented the Nexus Forge, a type-safe Nim-based build orchestrator that replaces fragile shell scripts with a compiled, structured build system. Core Components: - src/nexus/forge.nim: Main CLI orchestrator (STC-1 'tinybox' implementation) - src/nexus/builder/initrd.nim: Pure Nim TarFS writer with 512-byte alignment - src/nexus/builder/kernel.nim: Kbuild wrapper (placeholder for Phase 16) - blueprints/tinybox.kdl: First Standard Template Construct definition InitRD Builder: - Manual USTAR tar format implementation - Strict 512-byte block alignment enforcement - Correct checksum calculation and zero-padding - Eliminates dependency on external 'tar' command Build System Integration: - Modified build.sh to invoke './nexus build' for InitRD packaging - Forge-generated InitRD replaces legacy tar command - Maintains backward compatibility during transition PHASE 15: TARGET ALPHA - USERLAND UNIFICATION ============================================== Transformed the Forge from a passive bridge into an active compiler driver that fully controls NipBox (userland) compilation. NipBox Compiler Driver (src/nexus/builder/nipbox.nim): - 3-stage compilation pipeline: Nim → C → Object Files → Binary - Exact ABI matching with kernel objects (RISC-V lp64d) - Proper cross-compilation flags (-mcpu=sifive_u54 -mabi=lp64d) - Structured configuration via NipBoxConfig type Compilation Flow: 1. Nim transpilation with Sovereign Optimization flags 2. C compilation via zig cc with freestanding flags 3. Linking with membrane layer and userland entry point Forge Activation: - forge.nim now invokes build_nipbox() instead of using pre-built artifacts - Single command './nexus build' compiles entire userland from source - Eliminates dependency on build.sh for NipBox compilation Verified Artifacts: - core/rumpk/build/nipbox: 60KB RISC-V ELF with double-float ABI - core/rumpk/build/initrd.tar: 62KB USTAR archive with 512-byte alignment Status: ✅ Target Alpha Complete: Forge controls userland compilation ⏳ Target Bravo Pending: Kernel build still managed by build.sh ⏳ Target Charlie Pending: Registry integration deferred |
||
|---|---|---|
| .. | ||
| 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]