nx_nishios_fb_x86.nx
buildroot/runtime/nx_nishios_fb_x86.nx
about
nx_nishios_fb_x86.nx -- NishiOS GUI rung-7: the kernel draws the framebuffer with REAL x86 EXECUTION.
Closes the seam I kept flagging: until now the desktop was drawn by nx_fb (a NishiLang driver) called
AFTER boot. Here the booted kernel's draw is REAL x86 INSTRUCTIONS executed on the sovereign emu: an
authored fill loop (mov-imm / store [rax],rcx / add / cmp / jne / syscall) writes a computed value into
every framebuffer word. The emu runs it; afterward we read the framebuffer straight out of the emu's
memory -- the pixels were written by x86 the CPU model executed, not by a NishiLang call. Then export
to BMP via nx_fb (now ONLY the encoder, not the renderer).
KAT: the framebuffer holds EXACTLY what the x86 loop computed (mem[fb+8*w] low byte == w&0xFF) at the
start, middle and END of the loop (proving it ran to completion), clean exit, BMP exported.
HONEST SCOPE: the loop fills a computed ramp (proves per-pixel x86 writes); richer desktop chrome drawn
purely in x86 (rects/text via x86) is the continuation. No hw writes (Rule 26). expect_exit: 0 tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_fb.nxnx_itoa_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
| 14 | const K_MAGIC_4096: i64 = 4096 |
| 15 | const K_MAGIC_18432: i64 = 18432 |
| 16 | const K_MAGIC_2304: i64 = 2304 |
| 17 | const K_MAGIC_32768: i64 = 32768 |
functions
| 21 | func ek_i32(code: *u8, off: i64) -> i64 { var v: i64=(code[off] as i64)|((code[off+1] as i64)<<8)|((code[off+2] as i64)<<16)|((code[off+3] as i64)<<24); if (v & 0x80000000)!=0 { v=v-(1<<32) } return v } called by 1: ek_emu |
| 22 | func ek_st64(mem: *u8, addr: i64, v: i64) -> i64 { var i: i64=0; while i<8 { mem[addr+i]=((v>>(i*8))&0xff) as u8; i=i+1 } return 0 } called by 1: ek_emu |
| 23 | func ek_ld64(mem: *u8, addr: i64) -> i64 { var v: i64=0; var i: i64=0; while i<8 { v=v|((mem[addr+i] as i64)<<(i*8)); i=i+1 } return v } called by 1: ek_emu |
| 24 | func ek_emu(code: *u8, len: i64, mem: *u8) -> i64 |
| 61 | func fx_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 |
| 66 | func fx_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 67 | func fx_b(c: *u8, o: i64, b: i64) -> i64 { c[o]=(b & 0xff) as u8; return o+1 } called by 1: main |
| 68 | func fx_i32(c: *u8, o: i64, v: i64) -> i64 { c[o]=(v&0xff) as u8; c[o+1]=((v>>8)&0xff) as u8; c[o+2]=((v>>16)&0xff) as u8; c[o+3]=((v>>24)&0xff) as u8; return o+4 } called by 1: main |
| 70 | func main() -> i64 |