code wiki / _hdl_build / _dxg_enum_probe.nx
_dxg_enum_probe.nx
buildroot/runtime/_hdl_build/_dxg_enum_probe.nx
about
_dxg_enum_probe.nx -- the REAL minimal-call confirmation for the SOVEREIGN-GPU foundation.
Raw openat("/dev/dxg") + raw ioctl LX_DXENUMADAPTERS2 against the real dxgkrnl thunk -> reads
the RTX 5080's REAL adapter count + LUID. NO libvulkan/libcuda/libdxcore, NO libc. Raw syscalls.
ABI (pinned from WSL2-Linux-Kernel linux-msft-wsl-6.6.y, include/uapi/misc/d3dkmthk.h):
#define LX_DXENUMADAPTERS2 _IOWR(0x47, 0x14, struct d3dkmt_enumadapters2)
struct d3dkmt_enumadapters2 { __u32 num_adapters; __u32 reserved; __u64 *adapters; } // 16 bytes
struct d3dkmt_adapterinfo { d3dkmthandle handle(4); winluid luid(8); u32 num_sources;
u32 present_move_regions_preferred; } // 20 bytes
_IOWR(0x47,0x14,16) = (3<<30)|(16<<16)|(0x47<<8)|0x14 = 0xC0104714
PROTOCOL (two-step): call #1 with num_adapters set to a CAPACITY and adapters -> a buffer of
d3dkmt_adapterinfo; the kernel writes back the actual count into num_adapters and fills the
array. (LX_DXENUMADAPTERS2 fills up to num_adapters entries and returns the real count.)
TAMPER: a magic-0x99 ioctl must return a real errno (-ENOTTY) != the 0x47 result -> no-false-green.
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| none |
functions
| 19 | func dp_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 20 | func dp_n(v: i64) -> i64 { let bb: *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;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{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 21 | func dp_x(v: i64) -> i64 { dp_p("0x" as *u8); let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;k=1}; while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } var i:i64=0; let o:*u8=sys_mmap(20); while i<k{o[i]=bb[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 23 | func main() -> i64 |