nx_pabi.nx
buildroot/runtime/nx_pabi.nx
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
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
| 21 | const PABI_MAGIC_4096: i64 = 4096 |
| 22 | const PABI_MAGIC_65536: i64 = 65536 |
| 24 | const PABI_LINUX: i64 = 0 |
| 25 | const PABI_NISHIOS: i64 = 1 |
| 143 | const PABI_EXEC_K: i64 = 100 |
functions
| 28 | func pabi_basename(path: *u8, out: *u8) -> i64 |
| 41 | func pabi_write(be: i64, vimg: *u8, path: *u8, data: *u8, dlen: i64) -> i64 |
| 66 | func pabi_read(be: i64, vimg: *u8, path: *u8, out: *u8, cap: i64) -> i64 |
| 96 | func pabi_mkdir(be: i64, vimg: *u8, path: *u8) -> i64 |
| 113 | func pabi_exists(be: i64, vimg: *u8, path: *u8) -> i64 |
| 145 | func pabi_exec(be: i64, arg: i64) -> i64 |
| 186 | func pabi_judge(be: i64, vimg: *u8, arg: i64, expected: *u8, elen: i64) -> i64 |
| 212 | func pabi_spawn(be: i64, vimg: *u8, argv: *i64, envp: *i64, outpath: *u8) -> i64 called by 4: lg_runlg_runxmainmain calls 10: sys_forksys_openat_wrsys_dup3sys_execvesys_wait4vb_resolve+4 |
| 250 | func pabi_nishios_new() -> *u8 |
| 257 | func pabi_backend_name(be: i64) -> *u8 called by 1: main |