Repository navigation
fix(kernel): move kernel data exports out of the XBE image - #153
Conversation
The kernel data block and synthetic thread objects sat at 0x00740000, inside DOA3 .data BSS (0x00219640-0x00C27F5C), so the runner overwrote zeroed game globals before startup. They now live at XBOX_KERNEL_DATA_BASE (0x00F80000), above the main stack and below the heap, and the runner rejects an image that reaches the block.
0x00740000 sits in DOAXBV .data BSS (0x003b2224-0x00eeb29c), the same overlap doa3-re found in DOA3.
Mira PR WalkthroughThis PR moves the synthetic kernel data exports (KeTickCount and others) and the startup thread object. They used to sit at 0x00740000, inside the .data BSS of both DOAXBV and DOA3. They now sit at a new XBOX_KERNEL_DATA_BASE of 0x00f80000, just above the main stack top. The runner, kernel thread, and D3D frame adapter code now read the base from xbox_memory_layout.h, and the runner refuses any XBE image that reaches the kernel data area. Unit tests pass, but the change has not been run against a game build. sequenceDiagram
participant Runner
participant Layout as xbox_memory_layout.h
participant XBE as XBE Image
participant Kernel as Kernel Data (0x00f80000)
Runner->>Layout: read XBOX_KERNEL_DATA_BASE
Runner->>XBE: compute image end
alt image reaches kernel data base
Runner-->>Runner: refuse to load
else no overlap
Runner->>Kernel: place KeTickCount & exports
Runner->>Kernel: place startup thread object (+0x500)
end
Confidence: 4/5 ◉◉◉◉○ Safe with minor verification
7 files reviewed
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
The runner placed kernel data exports (
KeTickCountand the other synthetic exports) and the startup thread object at0x00740000. That address is inside the.dataBSS of both DOAXBV (0x003b2224-0x00eeb29c) and DOA3, so the kernel data shared memory with the game's own variables.runner.cpp,kernel_thread.c,d3d_frame_adapter.cand their tests now take the base fromxbox_memory_layout.h. The runner also refuses an XBE image that reaches the kernel data area. The research doc'sKeTickCountaddress is updated to match.This replaces the older
codex/kernel-data-basebranch, which was never merged and is 411 commits behind. The two kernel commits are rebased onto current main; the only conflict was an include ind3d_frame_adapter.c.Verification
ctest: 47 of 47 pass. llvm-mingw clangctest: 45 of 45 pass.python tools/public_export.py verify --require-public-treepasses.tools/build_game.py --importedat7042289(theBuildGame.cmdpath, reusing an extracted import) and launched the wayrun_game.pydoes, for 75 s. Build identity: lifter7adaf21, recipe307fc3d3780166b14063de686db7a6536aaba20b65589a5900f6944049870c09, program manifesta063777b8fad7d6c0fb5473c8a716941cc96d30fdaec3b0e727a586876f8c688,generation_parity: exact-local-match, receipt statusbuilt-unverified. The runner started with the kernel data at0x00f80000, played through the logo and opening movie sequence, then read asset archives. It presented 4,180 frames at 60.00 fps with 0 late frames in the last window; the worst frame (286 ms) was during startup. No crash, stop or kernel error in the log.main. Merged at the maintainer's request without a separate play test of this change.Contribution checklist
AGENTS.mdandCONTRIBUTING.md.