Skip to content

Build: pin nightly-2026-02-18; fix json target spec + function pointer casts#2

Merged
emilf merged 1 commit intopci-refinement-workfrom
fix/build-json-target-spec
Feb 20, 2026
Merged

Build: pin nightly-2026-02-18; fix json target spec + function pointer casts#2
emilf merged 1 commit intopci-refinement-workfrom
fix/build-json-target-spec

Conversation

@emilf
Copy link
Owner

@emilf emilf commented Feb 20, 2026

No description provided.

@emilf emilf merged commit 6f4c097 into pci-refinement-work Feb 20, 2026
@emilf emilf deleted the fix/build-json-target-spec branch February 20, 2026 09:53
emilf pushed a commit that referenced this pull request Mar 23, 2026
…ession

Implements a zero-manual-steps GDB debug workflow. No address copying,
no probe-then-restart, works reliably regardless of UEFI load address.

## Rust: debug mailbox (bootloader/src/main.rs, shared/src/constants.rs)

efi_main now writes its own runtime address to a fixed physical page at
boot entry, before any other UEFI calls:

  physical 0x7000 + 0x00  u64  runtime efi_main address
  physical 0x7000 + 0x08  u64  magic sentinel 0xDEADBEEF_CAFEF00D

The page is reserved via UEFI AllocateType::Address so the firmware
records our ownership in the memory map. The address and sentinel
constants live in shared/src/constants.rs::debug_mailbox.

## GDB: theseus-auto command (debug.gdb)

New 'theseus-auto' GDB command that:
  1. Sets a hardware watchpoint on the magic sentinel at 0x7008
  2. Issues 'continue' — UEFI boots, efi_main writes address then magic
  3. Watchpoint fires: reads runtime efi_main from 0x7000
  4. Calls theseus-load with the captured address (correct section deltas)
  5. Returns to GDB prompt — execution is stopped inside efi_main with
     full Rust source-level symbols

No reset required. The watchpoint catches efi_main on its first
execution. The user is dropped exactly at efi_main+81 with symbols.

## Python: gdb-auto.py updated (scripts/gdb-auto.py)

Simplified to a single-run workflow:
  - Start QEMU running (not paused) with TCP GDB stub on :1251
  - Connect GDB, run theseus-auto, wait for watchpoint + symbol load
  - Drop into interactive GDB or report result (--no-interactive)

## Verified

Tested across multiple runs — efi_main loads at different addresses
each time (0x7d0e4873, 0x7d0d7873, 0x7d0d9873 etc.) and the watchpoint
correctly captures the address every run:

  Thread 1 hit Hardware watchpoint 1: *(u64*)0x7008 == 0xdeadbeefcafef00d
  theseus-auto: mailbox fired — runtime efi_main = 0x7d0e4873
  rip = 0x7d0e48c4 <theseus_efi::efi_main+81>
  #2  theseus_efi::efi_main at bootloader/src/main.rs:124

## Usage

  make debug-auto          # interactive session
  make debug-auto-ci       # CI smoke-test, exits after verify
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