code wiki / _hdl_build / nx_nishi_bootimg.nx

nx_nishi_bootimg.nx

buildroot/runtime/_hdl_build/nx_nishi_bootimg.nx

4673 B67 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic nishi
docsdependenciesstructsconstsfunctions

about

nx_nishi_bootimg.nx -- x86 full-system ladder R9: a REAL BOOTABLE USB IMAGE (MBR boot sector). Authors a genuine 512-byte master boot record: 16-bit real-mode boot code that prints a banner via the BIOS teletype (INT 10h, AH=0x0E) then halts, padded to 510 bytes, ending in the 0x55AA boot signature. Written to knowledge/status/nishi_boot.img -- a real image you could dd if=nishi_boot.img of=/dev/sdX and boot on real x86 hardware (= R10). KAT verifies the MBR structure (size 512, 0x55AA signature, boot code + banner present). HONEST SCOPE: a minimal boot sector (print + halt via BIOS). A full loader (read more sectors, load the R8 kernel, switch to long mode, run it) is the next R9 rung; running it = real BIOS/hw (R10), since our sovereign emu does not model BIOS INT services. No persistent-hardware writes -- this writes a FILE, not a device (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_nishi_bootimg.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main bi_puts sys_write sys_mmap bi_b sys_openat_wr sys_exit sys_write ↻ sys_close bi_num sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

13func bi_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 calls 1: sys_write
14func bi_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 calls 2: sys_mmapsys_write
15func bi_b(c: *u8, o: i64, b: i64) -> i64 { c[o]=(b & 0xff) as u8; return o+1 }
called by 1: main
17func main() -> i64