Files
xboxrecomp/tools/kernel_audit
sp00nz 828058fded kernel: per-title ordinal remap -- one kernel serves any XDK
Phase 2 routing. The kernel bridge routes ordinals with one hardcoded
table, the ordinal ABI of the XDK it was written against. Titles built
with a different XDK number the same kernel functions differently, so
swapping such a title onto the shared kernel misroutes it -- Burnout 3
(XDK 5849) exited via HalReturnToFirmware during engine setup, where its
ordinal 49 is actually HalRequestSoftwareInterrupt.

Rather than refactor the three hardcoded tables (dispatch, arg-size,
data-export), this adds one translation layer. xbox_kernel_set_ordinal_remap
takes map[title_ordinal] = canonical_ordinal; xbox_kernel_bridge_init
applies it the moment it reads the ordinal, so all three lookups see the
canonical number. Identity by default -- a title that sets no remap, or
whose XDK already matches, is byte-identical. Verified: Halo still exits
3 at render_cameras.c:458, unchanged.

tools/kernel_audit/gen_ordinal_remap.py builds a title's map by matching
each function it imports to the ordinal the kernel's own table gives that
name. Halo (3911) and Crimson (5659) remap nothing -- they ARE the
canonical XDK. Burnout 3 remaps 47 and leaves 3 its parser could not name
as identity.

Result on Burnout 3, on xboxrecomp's kernel: it no longer exits during
engine setup. Ordinal 49 resolves to HalRequestSoftwareInterrupt (benign
stub), xbe_entry_point returns normally, the title enters its host loop
and begins loading crash-mode HUD textures. The specific routing blocker
is fixed.

One layer remains, and it is not routing: the init worker
PsCreateSystemThreadEx spawns runs but does not advance game state (zero
kernel calls from the worker stack region), even though xboxrecomp's
bridge_thread_main and Burnout 3's thread wrapper set the thread up
almost identically. That is a narrow threading-execution integration
difference, the next thing to chase.

This also corrects the record: Burnout 3's table is not "buggy", it is a
different XDK's correct table. xboxrecomp is ahead on kernel code, not on
the routing table, and the reunification keeps both titles' tables.

test_gen_ordinal_remap.py covers the generator; all kernel audit tests
pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 12:53:59 -07:00
..