code wiki / _hdl_build / nx_nishios_browser_x86.nx

nx_nishios_browser_x86.nx

buildroot/runtime/_hdl_build/nx_nishios_browser_x86.nx

26761 B460 linesdepth 9pulls 31 transitivereach 0 importersview sourcekind tooltopic nishios
docsdependenciesstructsconstsfunctions

about

nx_nishios_browser_x86.nx -- BROWSER-ON-ALL-OS arc, rung N4: the browser's pixels land in the NishiOS framebuffer via EXECUTED x86 STORE INSTRUCTIONS (the draw-as-x86 seam, same move as nx_nishios_fb_x86). N1 proved the browser RENDERS on NishiOS and N2 proved INPUT -- but the window pixels were written by a NishiLang blit loop. This rung closes that seam one level deeper: after the boot gate, the page is laid out + painted by the browser core into an RGB buffer (the PREP), then an AUTHORED REAL-ENCODING x86 program (movabs imm64 / mov r32 load+store / add imm8 / mov rcx,imm32 / dec / jnz / hlt -- a 2-level strided copy loop) is EXECUTED on a sovereign mini-emu, and it is those executed `89 10` (mov [rax],edx) stores that write EVERY byte of the browser window region of the NishiOS framebuffer, row-strided into place. Byte-verified against a NishiLang oracle blit; the executed-store COUNT must equal the window byte count / 4 exactly. KAT: T1 booted off the persisted image; T2 LONG mode + banner; T3 page laid out; T4 the x86 program ran to a clean HLT; T5 executed 32-bit stores == 465*426 exactly (every window word written by x86); T6 window region byte-IDENTICAL to the oracle blit; T7 x86 never scribbled outside the window (chrome pixel intact); T8 BMP exported at the exact expected size. NEG/liar-kill: T9 a corrupted store opcode (0x89 -> 0x88, an encoding this emu does not implement) REFUSES execution and leaves the window unwritten; T10 a 0-sector-load sibling image never reaches long mode -> nothing is drawn at all. HONEST SEAM (stated, not hidden): layout/paint PREP is NishiLang (running the full render core as x86-on-emu = compiling the browser itself to the emu's ISA, a far deeper rung); what this rung proves is that the FRAMEBUFFER WRITES -- the pixels you see in the window -- were performed by real executed x86 stores, strides and all. NishiOS-native fetch (nx_nishios_net) remains the named next rung. NEVER-BRICK (Rule 26): writes FILE artifacts only; models INT 13h *reads*; no /dev. expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_browser_render.nx nx_itoa_lib.nx nx_fb.nx nx_nishios_browser_x86.nx

imports: nx_browser_render.nxnx_itoa_lib.nxnx_fb.nx

imported by: nobody (leaf or entry point)

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

main nb_puts nb_build_image nb_movrax nb_write_file sys_openat_wr sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close nb_boot_image nb_emu_boot_disk nb_mode nb_num nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write sys_munmap fb_nishi_font fb_gly fb_rect fb_setpx fb_text fb_char fb_rect ↻ fb_window fb_rect ↻ fb_text ↻ nb_str font8x8_table sys_mmap ↻ fg fb_setpx ↻ nx86_author nx86_movabs nx86_movrcx32

structs

none

consts

29const NB_MAGIC_200000: i64 = 200000
30const NB_MAGIC_32767: i64 = 32767
31const NB_MAGIC_65536: i64 = 65536
32const NB_MAGIC_3000000: i64 = 3000000
113const NB_IMG_SZ: i64 = 1024
193const NB_W: i64 = 640
194const NB_H: i64 = 480
195const NB_BW: i64 = 620
196const NB_BH: i64 = 426
197const NB_OX: i64 = 10
198const NB_OY: i64 = 38
200const NX86_SRC: i64 = 4096
201const NX86_FB: i64 = 1048576
203const NX86_ROWW: i64 = 465
204const NX86_ROWS: i64 = 426

functions

34func nb_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
39func nb_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
40func nb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
41func nb_contains(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64
called by 1: main
47func nb_mode(cr0: i64, efer: i64) -> i64 { let pe: i64=cr0&1; let pg: i64=(cr0>>31)&1; let lme: i64=(efer>>8)&1; if pe==0 { return 0 } if pg==1 { if lme==1 { return 2 } } return 1 }
called by 1: nb_emu_boot_disk
50func nb_emu_boot_disk(mem: *u8, disk: *u8, entry: i64, console: *u8, clen: *i64, st: *i64) -> i64
called by 1: nb_boot_image calls 1: nb_mode
115func nb_movrax(img: *u8, base: i64, o: i64, b0: i64, b1: i64, b2: i64, b3: i64) -> i64
called by 1: nb_build_image
120func nb_build_image(img: *u8) -> i64
called by 1: main calls 1: nb_movrax
159func nb_boot_image(img: *u8, console: *u8, clen: *i64, st: *i64, loaded: *i64) -> i64
called by 1: main calls 1: nb_emu_boot_disk
171func nb_str(fb: *u8, W: i64, H: i64, x: i64, y: i64, s: *u8, r: i64, g: i64, b: i64) -> i64
called by 1: main calls 2: font8x8_tablefb_setpx
185func nb_write_file(path: *u8, data: *u8, n: i64) -> i64
called by 1: main calls 1: sys_openat_wr
209func nx86_run(mem: *u8, memsz: i64, entry: i64, stores: *i64) -> i64
called by 1: main
265func nx86_movabs(code: *u8, p: i64, reg2: i64, v: i64) -> i64
called by 1: nx86_author
271func nx86_movrcx32(code: *u8, p: i64, v: i64) -> i64
called by 1: nx86_author
282func nx86_author(code: *u8, dst0: i64, src0: i64) -> i64
called by 1: main calls 2: nx86_movabsnx86_movrcx32
303func main() -> i64