code wiki / _hdl_build / nx_nishios_browser.nx

nx_nishios_browser.nx

buildroot/runtime/_hdl_build/nx_nishios_browser.nx

21901 B351 linesdepth 9pulls 31 transitivereach 0 importersview sourcekind tooltopic nishios
docsdependenciesstructsconstsfunctions

about

nx_nishios_browser.nx -- BROWSER-ON-ALL-OS arc, rung N1: the Nishi browser renders ON NishiOS. Operator (2026-07-02): "finish getting our nishi browser to s class exceed on all OSs including our future nishi os." The browser already runs on Linux (nx_browser, X11/WSLg) and native Windows (nishi.exe PE). This rung puts the SAME OS-agnostic render core (nx_browser_render: br_layout -> CSS cascade -> box layout -> br_draw_fb paint) onto NISHIOS: it boots the persisted NishiOS image on the sovereign x86 emu (same unified boot-disk emu proven in nx_nishi_usb_longmode/_desktop), and ONLY because the disk-loaded kernel reached LONG mode does the browser render a real HTML page and composite it into the NishiOS desktop framebuffer (nx_fb). Export = knowledge/status/ nishios_browser.bmp + .html = one picture of "boot NishiOS -> open the Nishi browser". KAT: T1 booted off the persisted image (INT 13h: 0x8000 0->0xBE); T2 disk-loaded kernel reached LONG mode (mode==2); T3 UART banner == 'NishiOS'; T4 REAL layout (page.ok, box count, page height); T5 h1 background bar pixels present in the composited desktop; T6 link-blue pixels present; T7 body-text pixels present; T8 BMP exported at the exact expected size. NEG/liar-kill: T9 a 0-sector-load sibling image never reaches long mode -> the browser gate never fires (window region of a fresh desktop stays zero); T10 a tampered EMPTY page collapses the box count below the T4 threshold (the layout evidence is content-sensitive, not a constant). HONEST SEAM (no overclaim, same as every nx_nishi_usb_* rung): the emu EXECUTES the MBR loader + real->protected->long CR0/EFER transition as real x86 off the on-disk bytes; the browser render then runs in NishiLang (the same sovereign language the kernel compiles from) as the OS's app layer, painting the nx_fb framebuffer. Running the render loop itself as x86-on-emu, NishiOS-native networking (fetch on-OS), and live input are the next rungs (N2/N3) -- named, not claimed. NEVER-BRICK (Rule 26): writes FILE artifacts only (.img/.bmp/.html); 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.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_rect fb_setpx nb_str font8x8_table sys_mmap ↻ fg fb_setpx ↻ fb_cursor sys_mmap ↻ fb_setpx ↻ fb_bmp_save sys_mmap ↻ fb_p32 fb_p16 sys_openat_wr ↻ sys_write ↻ sys_close ↻ nb_slen

structs

none

consts

30const NB_MAGIC_200000: i64 = 200000
31const NB_MAGIC_32767: i64 = 32767
32const NB_MAGIC_65536: i64 = 65536
33const NB_MAGIC_202124: i64 = 202124
115const NB_IMG_SZ: i64 = 1024
203const NB_W: i64 = 640
204const NB_H: i64 = 480
205const NB_BW: i64 = 620 // browser page framebuffer width (blit interior of the OS window)
206const NB_BH: i64 = 426 // browser page framebuffer height
207const NB_OX: i64 = 10 // blit origin in the desktop
208const NB_OY: i64 = 38

functions

35func 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
40func nb_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
41func nb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
42func nb_contains(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64
called by 1: main
48func 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
52func 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
117func nb_movrax(img: *u8, base: i64, o: i64, b0: i64, b1: i64, b2: i64, b3: i64) -> i64
called by 1: nb_build_image
125func nb_build_image(img: *u8) -> i64
called by 1: main calls 1: nb_movrax
165func nb_boot_image(img: *u8, console: *u8, clen: *i64, st: *i64, loaded: *i64) -> i64
called by 1: main calls 1: nb_emu_boot_disk
179func 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
194func nb_write_file(path: *u8, data: *u8, n: i64) -> i64
called by 1: main calls 1: sys_openat_wr
211func nb_count_rgb(desk: *u8, r: i64, g: i64, b: i64) -> i64
called by 1: main
226func main() -> i64