code wiki / (root) / nx_pabi.nx

nx_pabi.nx

buildroot/runtime/nx_pabi.nx

11090 B261 linesdepth 6pulls 8 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_pabi.nx -- THE PORTABLE SYSCALL ABI SEAM (operator 2026-07-16: "don't defer, eat our debt, build the tools we need; target the OS on rv64 AND x86 AND all hardware mobile+non-mobile so the forge works on them too, as resources permit locally/forest/cloud"). This is R1 (the FOUNDATIONAL rock from nx_forge_os_readiness) STARTED, not deferred. THE DEBT: every forge organ imports nx_syscalls hard-wired to Linux-x86-64 (raw `syscall` insn). That binds the forge to ONE OS. THE FIX: an ABI INDIRECTION -- the forge's file/mem/etc. surface as a stable interface with PLUGGABLE BACKENDS selected at call time: PABI_LINUX -> the host kernel via sys_* (today's path; any Linux/arch) PABI_NISHIOS -> NishiOS-native via the sovereign block-VFS (nx_vfsblock_lib) -- no Linux kernel It is ARCH-AGNOSTIC by construction (NishiLang source -> whatever nx_cc backend: x86-64 today, RV64/ARM as the compiler gains backends), so the SAME forge code runs on x86 laptops, RV64, and mobile/non-mobile targets. The swarm admission plane (nx_swarm_admit/queue) then PLACES the forge where resources permit (local / forest / cloud). This module ships the FILE subset (the deterministic core's need: the byte-exact judge reads/writes candidates+store+ledger); mem/proc/ clock backends are the next increments on the same seam. license_tier: ORIGINAL

dependencies 3 imports · 4 importers

nx_vfsblock_lib.nx nx_nxe_lib.nx nx_lib_std.nx nx_pabi.nx nx_linux_guest_gate.nx nx_osbench_micro.nx nx_pabi_gate.nx nx_pabi_native_core_gate.nx

imports: nx_vfsblock_lib.nxnx_nxe_lib.nxnx_lib_std.nx

imported by: nx_linux_guest_gate.nxnx_osbench_micro.nxnx_pabi_gate.nxnx_pabi_native_core_gate.nx

structs

none

consts

21const PABI_MAGIC_4096: i64 = 4096
22const PABI_MAGIC_65536: i64 = 65536
24const PABI_LINUX: i64 = 0
25const PABI_NISHIOS: i64 = 1
143const PABI_EXEC_K: i64 = 100

functions

28func pabi_basename(path: *u8, out: *u8) -> i64
41func pabi_write(be: i64, vimg: *u8, path: *u8, data: *u8, dlen: i64) -> i64
66func pabi_read(be: i64, vimg: *u8, path: *u8, out: *u8, cap: i64) -> i64
96func pabi_mkdir(be: i64, vimg: *u8, path: *u8) -> i64
113func pabi_exists(be: i64, vimg: *u8, path: *u8) -> i64
called by 4: mainob_roundmainmain calls 1: vb_resolve
145func pabi_exec(be: i64, arg: i64) -> i64
186func pabi_judge(be: i64, vimg: *u8, arg: i64, expected: *u8, elen: i64) -> i64
212func pabi_spawn(be: i64, vimg: *u8, argv: *i64, envp: *i64, outpath: *u8) -> i64
250func pabi_nishios_new() -> *u8
257func pabi_backend_name(be: i64) -> *u8
called by 1: main