code wiki / _hdl_build / nx_nishi_bootimg.nx
nx_nishi_bootimg.nx
buildroot/runtime/_hdl_build/nx_nishi_bootimg.nx
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
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
structs
| none |
consts
| none |
functions
| 13 | func 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 } |
| 14 | func 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 } |
| 15 | func bi_b(c: *u8, o: i64, b: i64) -> i64 { c[o]=(b & 0xff) as u8; return o+1 } called by 1: main |
| 17 | func main() -> i64 |