Skip to content

test: Observe EE interrupt context without preempting GDB - #13

Open
fjtrujy wants to merge 5 commits into
masterfrom
feat/ee-preemptive-interrupt-research
Open

fjtrujy wants to merge 5 commits into
masterfrom
feat/ee-preemptive-interrupt-research

Conversation

@fjtrujy

@fjtrujy fjtrujy commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Scope

Standalone, observation-only EE interrupt diagnostics. This PR does not implement preemptive Ctrl-C or change the GDB stub.

  • Observe application instruction addresses from a VBlank callback while the EE runs a CPU-bound loop without debugger polling or scheduler yields.
  • Compare callback-side CP0 EPC/Cause/Status with the address argument. These are observations, not a restorable register frame.
  • Exercise a labeled branch/delay-slot loop and verify its arithmetic result.
  • Model an incomplete 128-bit EE register frame in an unlinked, compile-only assembly candidate, with native tests that reject incomplete context.
  • Add a read-only bootstrap-vector audit for user-supplied local BIOS references; its result must not be generalized to the live RAM vector.
  • Cross-compile probes in CI, verify isolation, and clean generated binaries. No CI job runs an ELF on the PS2.

Validation

On a real PS2, both VBlank probes passed (2026-11-02): 12 interrupts, 11 in the busy loop; and 42 interrupts, 41 in the branch-loop range, with 120,000,000 delay-slot increments. VBlank is disabled before its handler is removed; PS2Link ping succeeded afterward. The callback's address argument reflected application code, while CP0 EPC sampled inside the callback reflected handler context.

The full local build, native tests, GDB/RSP checks, installation check, and cross-compiled probe checks pass. CI covers the same scope, including strict warning flags on the standalone probes.

Deliberate limitations

The callback argument is not a documented writable context pointer. There is no proven interrupted-thread identity, full register snapshot, general BD/EPC recovery, or asynchronous stop/resume. This PR is reviewable as an isolated diagnostic; the separate experimental preemptive implementation remains out of scope.

@fjtrujy fjtrujy changed the title WIP: Investigate preemptive EE Ctrl-C interrupt context test: Observe EE interrupt context without preempting GDB Nov 3, 2026
@fjtrujy
fjtrujy marked this pull request as ready for review November 3, 2026 19:34
Add a standalone C VBlank interrupt observer, with no network calls or register manipulation in the handler. The first real-PS2 run recorded twelve interrupts during a CPU-bound uninstrumented loop and observed application instruction addresses in the extended interrupt callback while CP0 EPC belonged to the kernel. Add a stricter busy-loop address-range assertion for the next hardware run, build it in CI without execution, and document the register-context and instruction-replay requirements for true preemptive Ctrl-C.
@fjtrujy
fjtrujy force-pushed the feat/ee-preemptive-interrupt-research branch from 11b68dd to 2dd4b8d Compare November 3, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant