code wiki / _hdl_build / nx_nishios_net.nx

nx_nishios_net.nx

buildroot/runtime/_hdl_build/nx_nishios_net.nx

26830 B448 linesdepth 9pulls 30 transitivereach 0 importersview sourcekind tooltopic nishios
docsdependenciesstructsconstsfunctions

about

nx_nishios_net.nx -- BROWSER-ON-ALL-OS arc, rung N3: the Nishi browser FETCHES over a NishiOS NIC. N1 rendered a disk page on NishiOS; N2 navigated by click; N4 wrote the window with executed x86. The remaining NishiOS gap is the network. This rung builds the hardware-up NIC path: a MODELED network interface (TX/RX descriptor registers + a doorbell) lives in the x86 RAM; the kernel driver programs the TX descriptor and RINGS THE DOORBELL via EXECUTED x86 STORE instructions on the sovereign mini-emu; the emu intercepts the doorbell store and runs the device, which reads the request out of the TX buffer and delivers an HTTP 200 into the RX buffer. Crucially the response body is DERIVED FROM the request (it echoes the requested path), so a hardcoded constant response cannot pass -- the liar-kill. The browser then parses the HTTP headers and lays out the fetched body into the NishiOS desktop. KAT: T1 booted off the persisted image; T2 LONG mode + banner; T3 the executed x86 rang the doorbell (device fired exactly once); T4 the device delivered (RX_STATUS==1) AND the x86 read that status back (scratch==1); T5 the response is a real HTTP 200; T6 the body is CONTENT-DERIVED (contains the exact requested path, and a decoy path is absent -- not a constant); T7 the browser laid out the fetched body (ok, boxes); T8 the browser rendered it into the desktop (h1 bar pixels); T9 BMP exported at the exact expected size. NEG/liar-kill: T10 a driver that programs the descriptor but NEVER rings the doorbell gets NO delivery (RX_STATUS stays 0 -- delivery is caused by the executed doorbell store, not a constant); T11 a 0-sector-load sibling image never reaches long mode. HONEST SEAM (stated, not hidden): the boot chain + the doorbell store execute as real x86 on the sovereign emu; the device's peer is a HERMETIC loopback (it answers from the request) so the gate is deterministic -- bridging the NIC's TX to the live sovereign TLS/HTTP stack for the REAL internet is the named next rung (nx_nishios_net_wire). What this rung proves: the NIC descriptor/doorbell driver path is real + executed, and the browser renders whatever the device delivers. NEVER-BRICK (Rule 26): writes FILE artifacts only; models INT 13h *reads* + a loopback NIC; no /dev. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_browser_render.nx nx_fb.nx nx_nishios_net.nx

imports: nx_browser_render.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 nn_appz nn_author nn_movabs nn_movrdx nn_store nn_load nn_run nn_wr32 nn_device nn_rd32 nn_appz ↻ nn_wr32 ↻ nn_rd32 ↻ nn_rd32 ↻ nb_contains br_layout br_slen sys_mmap ↻ rh_extract_styles sys_mmap ↻ nx_html_cursor_init nx_html_next_token _scan_name _is_name

structs

none

consts

30const NB_MAGIC_200000: i64 = 200000
31const NB_MAGIC_32767: i64 = 32767
32const NB_MAGIC_65536: i64 = 65536
33const NB_MAGIC_100000: i64 = 100000
110const NB_IMG_SZ: i64 = 1024
189const NB_W: i64 = 640
190const NB_H: i64 = 480
191const NB_BW: i64 = 620
192const NB_BH: i64 = 426
193const NB_OX: i64 = 10
194const NB_OY: i64 = 38
198const NN_NICREG: i64 = 0x2000
199const NN_TXOFF: i64 = 0x3000
200const NN_RXOFF: i64 = 0x5000
201const NN_MEMSZ: i64 = 0x10000
202const NN_DOORBELL: i64 = 0x2008 // NN_NICREG + 8

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
36func nb_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
37func nb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
38func nb_contains(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64
called by 1: main
44func 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
47func 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
111func nb_movrax(img: *u8, base: i64, o: i64, b0: i64, b1: i64, b2: i64, b3: i64) -> i64
called by 1: nb_build_image
116func nb_build_image(img: *u8) -> i64
called by 1: main calls 1: nb_movrax
155func nb_boot_image(img: *u8, console: *u8, clen: *i64, st: *i64, loaded: *i64) -> i64
called by 1: main calls 1: nb_emu_boot_disk
167func nb_str(fb: *u8, W: i64, H: i64, x: i64, y: i64, s: *u8, r: i64, g: i64, b: i64) -> i64
181func nb_write_file(path: *u8, data: *u8, n: i64) -> i64
called by 1: main calls 1: sys_openat_wr
204func nn_rd32(mem: *u8, off: i64) -> i64 { return (mem[off] as i64)|((mem[off+1] as i64)<<8)|((mem[off+2] as i64)<<16)|((mem[off+3] as i64)<<24) }
called by 3: nn_devicenn_runmain
205func nn_wr32(mem: *u8, off: i64, v: i64) -> i64 { mem[off]=(v&0xFF) as u8; mem[off+1]=((v>>8)&0xFF) as u8; mem[off+2]=((v>>16)&0xFF) as u8; mem[off+3]=((v>>24)&0xFF) as u8; return 0 }
called by 2: nn_devicenn_run
206func nn_appz(mem: *u8, p: i64, s: *u8) -> i64 { var q: i64=p; var i: i64=0; while s[i]!=(0 as u8) { mem[q]=s[i]; q=q+1; i=i+1 } return q }
called by 2: nn_devicemain
210func nn_device(mem: *u8) -> i64
called by 1: nn_run calls 3: nn_rd32nn_appznn_wr32
239func nn_run(mem: *u8, memsz: i64, entry: i64, fired: *i64) -> i64
called by 1: main calls 3: nn_wr32nn_devicenn_rd32
273func nn_movabs(code: *u8, p: i64, v: i64) -> i64
called by 1: nn_author
279func nn_movrdx(code: *u8, p: i64, v: i64) -> i64
called by 1: nn_author
284func nn_store(code: *u8, p: i64) -> i64 { code[p]=0x89 as u8; code[p+1]=0x10 as u8; return p+2 }
called by 1: nn_author
285func nn_load(code: *u8, p: i64) -> i64 { code[p]=0x8B as u8; code[p+1]=0x10 as u8; return p+2 }
called by 1: nn_author
289func nn_author(code: *u8, txlen: i64, ring: i64) -> i64
301func nn_draw_desktop(desk: *u8, page: *Page, url: *u8, ulen: i64) -> i64
333func main() -> i64