Markus Maiwald
e8b58f375a
chore: add operational notes and test shell source
2026-02-15 20:00:00 +01:00
Markus Maiwald
84c3345595
feat(userland): NipBox LITE subject binary, ARM64 init support
2026-02-15 19:59:30 +01:00
Markus Maiwald
8d4b581519
feat(hal): ARM64 port, VirtIO MMIO, dual-arch HAL (M3.1-M3.3)
2026-02-15 19:58:51 +01:00
Markus Maiwald
eaf753c70c
feat(membrane): Hardened LwIP memory manager & stabilized DHCP/DNS
...
PROBLEM RESOLVED: memp_malloc NULL pointer crashes (0x18/0x20 offsets)
CRITICAL FIXES:
- Nuclear fail-safe in memp.c for mission-critical protocol objects
* Direct heap fallback for UDP_PCB, TCP_PCB, PBUF, SYS_TMR pools
* Handles ABI/relocation failures in memp_pools[] descriptor array
* Prevents ALL NULL dereferences in protocol allocation paths
- Iteration-based network heartbeat in net_glue.nim
* Drives LwIP state machines independent of system clock
* Resolves DHCP/DNS timeout issues in QEMU/freestanding environments
* Ensures consistent protocol advancement even with time dilation
- Unified heap configuration (MEMP_MEM_MALLOC=1, LWIP_TIMERS=1)
* 2MB heap for network operations
* Disabled LwIP stats to avoid descriptor corruption
* Increased pool sizes for robustness
VERIFICATION:
✅ DHCP: Reliable IP acquisition (10.0.2.15)
✅ ICMP: Full Layer 2 connectivity confirmed
✅ DNS: Query enqueuing operational (secondary crash isolated)
✅ VirtIO: 12-byte header alignment maintained
NEXT: Final DNS request table hardening for complete resolution
Signature: CORRECTNESS > SPEED
2026-01-07 23:47:04 +01:00
Markus Maiwald
0949ea1187
test(network): added DNS resolution verification and extended test script
...
- Updated init.nim with post-fix DNS resolution test (google.com).
- Added test_network_extended.sh with 120s timeout to allow full DHCP/DNS cycle.
- Validates the fix for the UDP PCB pool exhaustion crash.
2026-01-07 21:28:18 +01:00
Markus Maiwald
49dd5382b9
feat(network): established full bidirectional IP connectivity via LwIP
...
Established stable network link between NexusOS and QEMU/SLIRP gateway.
Resolved critical packet corruption and state machine failures.
Key fixes:
- VIRTIO: Aligned header size to 12 bytes (VIRTIO_NET_F_MRG_RXBUF modern compliance).
- LWIP: Enabled LWIP_TIMERS=1 to drive internal DHCP/DNS state machines.
- KERNEL: Adjusted NetSwitch polling to 10ms to prevent fiber starvation.
- MEMBRANE: Corrected TX packet offset and fixed comment syntax.
- INIT: Verified ICMP Echo Request/Reply (10.0.2.15 <-> 10.0.2.2).
Physically aligned. Logically sovereign.
Fixed by the & kernel Forge.
2026-01-07 20:19:15 +01:00
Markus Maiwald
77b4cb55c7
feat(hal/core): implement heartbeat of iron (real-time SBI timer driver)
...
- Implemented RISC-V SBI timer driver in HAL (entry_riscv.zig).
- Integrated timer into the Harmonic Scheduler (kernel.nim/sched.nim).
- Re-enabled the Silence Doctrine: system now enters low-power WFI state during idle.
- Confirmed precise nanosecond wakeup and LwIP pump loop stability.
- Updated kernel version to v1.1.2.
2026-01-06 20:54:22 +01:00
Markus Maiwald
068fc732a6
feat(core): fix userland network init, implement syscalls, bump v1.1.1
...
- Fix init crash by implementing SYS_WAIT_MULTI and valid hex printing.
- Fix Supervisor Mode hang using busy-wait loop (bypassing missing timer).
- Confirm LwIP Egress transmission and Timer functionality.
- Update kernel version to v1.1.1.
2026-01-06 18:31:32 +01:00
Markus Maiwald
bf427290f1
feat(kernel): implement Sv39 fiber memory isolation and hardened ELF loader
2026-01-05 16:36:25 +01:00
Markus Maiwald
4cec2d8c25
feat(rumpk): Achieve interactive Mksh shell & formalize Sovereign FSH
...
CHECKPOINT 7: Nuke LwIP, Fix Stack
🎯 PRIMARY ACHIEVEMENTS:
- ✅ Interactive Mksh shell successfully boots and accepts input
- ✅ Kernel-side LwIP networking disabled (moved to userland intent)
- ✅ C-ABI handover fully operational (argc, argv, environ)
- ✅ SPEC-130: Sovereign Filesystem Hierarchy formalized
🔧 KERNEL FIXES:
1. **Nuked Kernel LwIP**
- Disabled membrane_init() in kernel.nim
- Prevented automatic DHCP/IP acquisition
- Network stack deferred to userland control
2. **Fixed C-ABI Stack Handover**
- Updated rumpk_enter_userland signature: (entry, argc, argv, sp)
- Kernel prepares userland stack at 0x8FFFFFE0 (top of user RAM)
- Stack layout: [argc][argv[0]][argv[1]=NULL][envp[0]=NULL][string data]
- Preserved kernel-passed arguments through subject_entry.S
3. **Fixed Trap Return Stack Switching**
- Added sscratch swap before sret in entry_riscv.zig
- Properly restores user stack and preserves kernel stack pointer
- Fixes post-syscall instruction page fault
4. **Rebuilt Mksh with Fixed Runtime**
- subject_entry.S no longer zeros a0/a1
- Arguments flow: Kernel -> switch.S -> subject_entry.S -> main()
📐 ARCHITECTURAL SPECS:
- **SPEC-130: Sovereign Filesystem Hierarchy**
- Tri-State (+1) Storage Model: /sysro, /etc, /run, /state
- Declarative Stateless Doctrine (inspired by Clear Linux/Silverblue)
- Ghost Writer Pattern: KDL recipes -> /etc generation
- Bind-Mount Strategy for legacy app grafting
- Database Contract for /state (transactional, encrypted)
🛠️ DEVELOPER EXPERIENCE:
- Fixed filesystem.nim to fallback to .nexus/ for local builds
- Prevents permission errors during development
🧪 VERIFICATION:
Syscalls confirmed working: write (0x200, 0x204), read (0x203)
NEXT: Implement proper TTY/PTY subsystem for full job control
Co-authored-by: <voxis@nexus-os.org>
2026-01-05 01:14:24 +01:00
Markus Maiwald
6e78b7f458
Rumpk Stability, NipBox Boot, and Repository Cleanup
...
- Fixed Rumpk RISC-V Trap Handler (SSCRATCH swap, align(4), SUM bit) to prevent double faults.
- Stabilized Userland Transition (fence.i, MMU activation) allowing NipBox execution.
- Restored Forge pipeline to build NipBox from source.
- Documented critical RISC-V trap mechanics in .agent/tips.
- Committed pending repository cleanup (obsolete websites) and new core modules.
2026-01-04 21:39:06 +01:00
Markus Maiwald
1b4facd86b
Phase 37: The Glass Cage - Memory Isolation Complete
...
VICTORY: All page faults (Code 12, 13, 15) eliminated. NipBox runs in isolated userspace.
Root Cause Diagnosed:
- Kernel BSS (0x84D5B030) was overwritten by NipBox loading at 0x84000000
- current_fiber corruption caused cascading failures
Strategic Fixes:
1. Relocated NipBox to 0x86000000 (eliminating BSS collision)
2. Expanded DRAM to 256MB, User region to 64MB (accommodating NipBox BSS)
3. Restored Kernel GP register in trap handler (fixing global access)
4. Conditionally excluded ion/memory from userspace builds (removing 2MB pool)
5. Enabled release build optimizations (reducing BSS bloat)
Results:
- Kernel globals: SAFE
- User memory: ISOLATED (Sv39 active)
- Syscalls: OPERATIONAL
- Scheduler: STABLE
- NipBox: ALIVE (waiting for stdin)
Files Modified:
- core/rumpk/apps/linker_user.ld: User region 0x86000000-0x89FFFFFF (64MB)
- core/rumpk/hal/mm.zig: DRAM 256MB, User map 32-256MB
- core/rumpk/hal/entry_riscv.zig: GP reload in trap handler
- core/rumpk/core/ion.nim: Conditional memory export
- core/rumpk/libs/membrane/ion_client.nim: Local type declarations
- core/rumpk/libs/membrane/net_glue.nim: Removed ion import
- core/rumpk/libs/membrane/compositor.nim: Stubbed unused functions
- src/nexus/builder/nipbox.nim: Release build flags
Next: Fix stdin delivery to enable interactive shell.
2026-01-04 02:03:01 +01:00
Markus Maiwald
c8a679b067
feat(rumpk): dignified exit & sovereign vfs
...
- 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
2025-12-31 21:54:44 +01:00
Markus Maiwald
2a1af03e28
feat(rumpk): Phase 8 - The Summoning (ELF Loader) - 95% Complete
...
## 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: <ai@voxisforge.dev>
2025-12-31 20:18:49 +01:00
Markus Maiwald
30fa024367
feat(rumpk): Sovereign Core Stabilization & Membrane IPC Hardening
...
- NexShell: Hardened command transmission via atomic ION packets, fixed fragmentation issues.
- NipBox: Expanded 'Sovereign Coreutils' with 'ls' and enhanced 'matrix' control.
- GPU/Retina: Optimized VirtIO-GPU driver, improved polling and framebuffer synchronization.
- Membrane: Stabilized libc shims (clib.c, libc.nim) and ION client logic.
- Kernel: Refined fiber scheduler and watchdog metrics.
- Forge: Cleanup and optimization of build scripts and manifests.
2025-12-31 20:18:49 +01:00
Markus Maiwald
b3d9c2a49d
feat(rumpk): Phase 2 Complete - The Entropy Purge & Sovereign Alignment
...
- Rumpk Core: Complete exorcism of LwIP/NET ghosts. Transitioned to ION nomenclature.
- ABI Sync: Synchronized Zig HAL and Nim Logic Ring Buffer layouts (u32 head/tail/mask).
- Invariant Shield: Hardened HAL pipes with handle-based validation and power-of-2 sync.
- Immune System: Verified Blink Recovery (Self-Healing) with updated ION Control Plane.
- NexShell: Major refactor of Command Plane for Sovereign Ring access.
- Architecture: Updated SPEC files and Doctrines (Silence, Hexagonal Sovereignty).
- Purge: Removed legacy rumk and nip artifacts for a clean substrate.
- Web: Updated landing page vision to match Rumpk v1.1 milestones.
2025-12-31 20:18:48 +01:00
Markus Maiwald
46e7be6837
feat(rumpk): Phase 7 Verified - Subject Zero Launch
...
- Implemented Sovereign Syscall Table at 0x801FFF00
- Added cooperative yielding (s_yield) for Guest/Kernel concurrency
- Initialized Guest RX Ring and flows in Kernel
- Bridged LwIP in Guest via net_glue and ion_client overrides
- Validated TCP handshake and data transmission (Subject Zero -> Host)
- Confirmed 'Hello from the Membrane!' via UART and Network
2025-12-31 20:18:48 +01:00