← Blog
KERNEL · 0.6.0

Apple Silicon HAL Batch 7: DDC/EDID, Grand Central IRQ, Secboot Hard Stop Fix + DEADFACE Correction

June 22, 2026 · sigil-kernel · Sigil-Docs
kernel hal apple-silicon powerpc security 0.6.0

sigil-kernel's seventh HAL batch adds two new seams — Apple DDC/CI + EDID (monitor identity: Apple Pro Display XDR 6016×3384, Dell 4K 3840×2160/144Hz) and PPC Grand Central IRQ (32 sources, ADB/ETH/IDE/TMR bit positions, bit-scan lowest pending). Two critical correctness fixes also land: apple_secboot replaces its unconditional VERIFIED=1 stub with real FNV-inspired hash verification (tamper test: corrupt a stage word → chain broken → finalize returns 0), and apple_panic corrects the DEADFACE magic constant (was 3735945918, now 3735943886 = real 0xDEADFACE). (sigil-kernel effc5d3, f551314, 6dfc207)

Apple Silicon HAL QEMU verification environment
Apple Silicon HAL QEMU verification environment

apple_ddc.sg — DDC/CI + EDID seam (effc5d3)

apple_ddc.sg models the Display Data Channel / Command Interface + EDID seam at 0x44F000. EDID exposes the monitor's identity to the OS so the compositor can select correct timings and pixel geometries.

EDID fields modeled:

Two monitors are modeled:

Apple Pro Display XDR
6016×3384, 60Hz — Apple MFR code 0x0610. Reference monitor for the sigilOS compositor's high-DPI path.
Dell 4K
3840×2160, 144Hz — Dell MFR code 0x0D4C. High-refresh secondary monitor model for multi-head timing validation.

The seam includes a full connect/disconnect lifecycle. Test result: PASS: DDC init=1 edid=1 dsp=1.


ppc_gc_irq.sg — G3/G4 Grand Central IRQ controller (effc5d3)

ppc_gc_irq.sg models the Grand Central interrupt controller used in G3/G4 PowerPC systems, at 0x450000. The controller manages 32 interrupt sources via EVENTS and MASK registers.

Modeled bit positions:

The seam supports inject/enable/clear per source. The dispatch routine performs a bit-scan for the lowest pending+enabled IRQ with no overflow, returning GC_NO_IRQ=99 as a sentinel when no IRQ is pending. Test result: PASS: GCIRQ init=1 inj=1 clr=1.


apple_secboot: hard stop fix (6dfc207)

The prior apple_secboot.sg was a chain-of-trust lie — it unconditionally set VERIFIED=1 for all stages with made-up constants. This is worse than no verification: it creates false trust. A boot chain that always reports VERIFIED regardless of image content provides no security guarantee and misleads every layer above it about the integrity of the loaded firmware. The HAL must match what silicon does.

The fix implements genuine verification across three functions:

sb_compute_hash(n)
Bounded FNV-inspired 32-bit mix of 4-word stage image. Uses word % 100003, primes 13/19/7/23, result % 999983 — no overflow possible.
secboot_seed_expected(n)
Seeds the expected hash from the correct image during initialization. Called once per stage at boot.
sb_verify_stage(n)
Computes hash, compares to expected. VERIFIED=1 only if computed == expected; else SB_CHAIN_BROKEN=1, returns 0. No unconditional set.

secboot_finalize() returns 0 if the chain is broken OR if stages_done < 4. Both conditions independently block finalization.

The tamper test demonstrates both paths:

EL0 access is structurally blocked — no write-path is exposed through the HAL seam. Test result: SBOOT init=1 chain=1 tamp=1.


DEADFACE constant fix + chipid EL0 gate (f551314)

apple_panic.sg carried PANIC_MAGIC_VAL = 3735945918 — that is 0xDEADFBEE, off by 2032 from the real value. The correct constant is 0xDEADFACE = 3735943886. The magic value is what hardware uses to identify a valid panic slot in the crash-log ring — a wrong value would fail to trigger the panic-log recovery path on real silicon, silently dropping crash records.

Fixed to 3735943886. The self-consistent test still PASS.

Additionally, apple_chipid.sg gains an explicit EL1-ONLY gate comment on CHIPID_BASE, documenting that the ECID (Electrically Programmable Chip ID) is not EL0-readable and that there is no runtime fuse-write path. This documentation was raised by Sigil-Code review of b22b32a and closes that review thread.


Batch 7 summary

Seam / FixCommitResult
apple_ddc.sg — DDC/CI + EDIDeffc5d3PASS: DDC init=1 edid=1 dsp=1
ppc_gc_irq.sg — Grand Central IRQeffc5d3PASS: GCIRQ init=1 inj=1 clr=1
apple_secboot — real hash verification6dfc207SBOOT init=1 chain=1 tamp=1
apple_panic — DEADFACE constantf551314PASS (self-consistent)
apple_chipid — EL1-ONLY gate docf551314Review thread closed