code wiki / _hdl_build / nx_nishi_diskimg_test.nx

nx_nishi_diskimg_test.nx

buildroot/runtime/_hdl_build/nx_nishi_diskimg_test.nx

3897 B53 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic nishi
docsdependenciesstructsconstsfunctions

about

nx_nishi_diskimg_test.nx -- x86 ladder R9 rung-2: the LOADER PIPELINE (disk image -> load -> run). A real loader's job: read the kernel off disk into memory and jump to it. This builds a multi- sector image (sector 0 = MBR with the 0x55AA signature; sector 1 = the kernel payload), MODELS the load (copy the kernel sector from the image into a load buffer = what BIOS INT 13h / a real loader does), and RUNS the loaded kernel on the sovereign emu (emu_x86_run_k) -- proving the whole image->load->execute pipeline sovereignly (no BIOS, no qemu). KAT: MBR signature, byte-faithful load, and the loaded kernel exits 42. HONEST SCOPE: the 16-bit BIOS disk-read code itself + real boot = R10 (hardware); this proves the load+run model. No persistent-hardware writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_emu_x86_k.nx nx_nishi_diskimg_test.nx

imports: nx_emu_x86_k.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main di_puts di_b di_i32 emu_x86_run_k k_i32 k_st64 k_ld64 di_num di_beq

structs

none

consts

none

functions

12func di_b(c: *u8, o: i64, b: i64) -> i64 { c[o]=(b & 0xff) as u8; return o+1 }
called by 1: main
13func di_i32(c: *u8, o: i64, v: i64) -> i64 { c[o]=(v&0xff) as u8; c[o+1]=((v>>8)&0xff) as u8; c[o+2]=((v>>16)&0xff) as u8; c[o+3]=((v>>24)&0xff) as u8; return o+4 }
called by 1: main
14func di_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
15func di_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
called by 1: main
16func di_beq(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
18func main() -> i64