code wiki / _hdl_build / nx_nishios_docview.nx
nx_nishios_docview.nx
buildroot/runtime/_hdl_build/nx_nishios_docview.nx
about
nx_nishios_docview.nx -- DOC-OMNITOOL-ON-ALL-OS, rung N-DOC-1: NishiOS OPENS DOCUMENTS.
Operator (2026-07-08): "i want nishi browser and os to support rendering these different docs ... the
browser is becoming the workhorse of systems." The Linux browser side shipped (nx_browser + nx_doc_view
fork-dispatch, gate 7/7, live PNG proof). This rung puts the same capability on NISHIOS, following the
proven nx_nishios_browser idiom: boot the persisted NishiOS image on the sovereign x86 emu, and ONLY
because the disk-loaded kernel reached LONG mode does the OS app layer open a DOCUMENT -- a persisted
.md file read back off disk -> the ON-OS VIEWER REGISTRY (ext -> renderer id; NishiOS has no process
fork yet, so renderers LINK as libs (nx_md_lib) and are invoked at ONE dispatch point; adding a format =
one registry row + one lib import, the dispatch core never changes) -> md_to_html -> br_layout ->
br_draw_fb -> composited into the NishiOS desktop as a "NISHI DOCS" window. Export = knowledge/status/
nishios_docview.bmp + .html = one picture of "boot NishiOS -> open report.md natively".
KAT: T1 booted off the persisted image; T2 LONG mode; T3 UART banner 'NishiOS'; T4 registry routes .md
AND refuses .xyz; T5 conversion real (h1/bold/link/blockquote/pre markers in the produced HTML);
T6 REAL layout (ok, boxes>=15, page_h>=100); T7 heading ink pixels; T8 link-blue pixels; T9 body-text
pixels; T10 BMP exact size; T11 NEG 0-sector image never reaches long mode -> viewer never fires;
T12 NEG empty document collapses the box count vs the real document (content-sensitive evidence).
HONEST SEAM (same as nx_nishios_browser): the emu EXECUTES the MBR loader + real->protected->long
transition off the on-disk bytes; the doc pipeline then runs in NishiLang as the OS's app layer painting
nx_fb. Renderers as x86-on-emu processes via nx_nxe_loader, on-OS networking, and live input remain
future rungs -- named, not claimed. MEASURED (BMP palette probe, 07-09): on this author-styled page the
render core paints its DEFAULT ink palette -- headings #14142b (20,20,43), body #202124 (32,33,36) --
author-CSS text colors (link-blue, pre backgrounds) are NOT yet applied; that render-core CSS-color rung
is likewise named, not claimed. The pixel KATs below assert the MEASURED palette, not a wished one.
NEVER-BRICK (Rule 26): FILE artifacts only; models INT 13h *reads*.
expect_exit: 0 license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_browser_render.nxnx_itoa_lib.nxnx_fb.nxnx_md_lib.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
| 33 | const ND_MAGIC_200000: i64 = 200000 |
| 34 | const ND_MAGIC_32767: i64 = 32767 |
| 35 | const ND_MAGIC_65536: i64 = 65536 |
| 36 | const ND_MAGIC_1048576: i64 = 1048576 |
| 118 | const ND_IMG_SZ: i64 = 1024 |
| 205 | const ND_W: i64 = 640 |
| 206 | const ND_H: i64 = 480 |
| 207 | const ND_BW: i64 = 620 |
| 208 | const ND_BH: i64 = 426 |
| 209 | const ND_OX: i64 = 10 |
| 210 | const ND_OY: i64 = 38 |
functions
| 38 | func nd_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 |
| 43 | func nd_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 44 | func nd_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 45 | func nd_contains(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64 called by 1: main |
| 51 | func nd_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: nd_emu_boot_disk |
| 55 | func nd_emu_boot_disk(mem: *u8, disk: *u8, entry: i64, console: *u8, clen: *i64, st: *i64) -> i64 |
| 120 | func nd_movrax(img: *u8, base: i64, o: i64, b0: i64, b1: i64, b2: i64, b3: i64) -> i64 called by 1: nd_build_image |
| 128 | func nd_build_image(img: *u8) -> i64 |
| 168 | func nd_boot_image(img: *u8, console: *u8, clen: *i64, st: *i64, loaded: *i64) -> i64 |
| 182 | func nd_str(fb: *u8, W: i64, H: i64, x: i64, y: i64, s: *u8, r: i64, g: i64, b: i64) -> i64 |
| 197 | func nd_write_file(path: *u8, data: *u8, n: i64) -> i64 |
| 212 | func nd_count_rgb(desk: *u8, r: i64, g: i64, b: i64) -> i64 |
| 228 | func nd_count_rgb_full(desk: *u8, r: i64, g: i64, b: i64) -> i64 |
| 246 | func nd_ext_of(name: *u8, ext: *u8) -> i64 called by 1: main |
| 255 | func nd_reg_lookup(ext: *u8) -> i64 called by 1: main |
| 259 | func nd_reg_render(id: i64, src: *u8, slen: i64, out: *u8) -> i64 |
| 264 | func main() -> i64 |