code wiki / _hdl_build / nx_vfs_blockfs.nx
nx_vfs_blockfs.nx
buildroot/runtime/_hdl_build/nx_vfs_blockfs.nx
about
nx_vfs_blockfs.nx -- GATE: the hierarchical VFS MOUNTED ON the block filesystem (NSFS v2, nx_vfsblock_lib).
Closes the FILESYSTEM census gap half "block-backed VFS mount": the WHOLE namespace (dirs + files + hierarchy)
lives in the block image and survives save -> clear -> reload -> MOUNT. Grounded on the banked field research
(osb_vfs/osb_mount/osb_inode: mount = attach a validated on-disk FS into the namespace; inode = the on-disk
record). Research-grounded exceed kept honest: this is OUR OWN format (NSFS v2), not ext/FAT.
T1 format + mount (superblock magic+version validated, root dir valid, empty).
T2 build a REAL tree with nesting -- /docs /src /docs/sub + 3 files -- resolve + read + ls all correct.
T3 THE MOUNT PROOF: save image -> zero RAM -> load -> mount -> paths resolve + content byte-exact + ls intact.
T4 teeth: corrupt a data byte in the image -> per-file checksum DETECTS; restore -> clean again.
T5 teeth: corrupt the superblock magic -> mount REFUSED (-1); restore -> mounts again.
expect_exit: 0 Sovereign: nx_cc->nxasm via nx_syscalls. NEVER-BRICK: RAM + an image file, 0 firmware writes.
dependencies 2 imports · 0 importers
imports: nx_vfsblock_lib.nxnx_itoa_lib.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
| 15 | func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 20 | func g_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 21 | func ck(name: *u8, c: i64) -> i64 { if c==1 { g_puts(" PASS " as *u8) } else { g_puts(" FAIL " as *u8) } g_puts(name); g_puts("\n" as *u8); return c } |
| 22 | func streq_n(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 } called by 1: main |
| 23 | func wlog(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } called by 1: main |
| 25 | func main() -> i64 |