nx_smoke_sim.nx
buildroot/runtime/nx_smoke_sim.nx
about
nx_smoke_sim.nx -- end-to-end smoke test of the off-C run-loop.
Hand-builds a minimal RV64 Linux ELF that exits with code 42,
loads it via nx_loader, runs it via nx_rv64_sim, asserts the
exit code matches. Proves the OFF-C verification path works
without docker / qemu.
This is the smallest possible end-to-end demonstration of the
sovereign run-loop:
1. Bytes shaped like an ELF -> nx_loader places PT_LOAD
segment at vaddr 0x10000.
2. Entry pc = 0x10000 + 120; PC walks 3 instructions:
addi a0, zero, 42 -- a0 = 42
addi a7, zero, 93 -- a7 = sys_exit
ecall -- syscall(93, 42, ...)
3. nx_rv64_sim's syscall handler sees nr=93, halts cpu,
records exit_code = 42.
4. We assert cpu.halted=1 + cpu.exit_code=42.
Run: produces a 0 exit code on success, non-zero on any failure.
Pairs with bootstrap_native.sh as the proof-of-concept that the
in-NishiLang sim is a viable qemu replacement.
dependencies 3 imports · 0 importers
imports: syscalls.nxnx_loader.nxnx_rv64_sim.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 37 | func main() -> i64 |