P1.5: local APIC timer at 1 kHz, PIT calibration, legacy PICs masked #77
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 333 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.348
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #77"
general
weight: 0.35
garrickdabbs
Summary
Plan task P1.5: the local APIC is enabled and its timer ticks at 1 kHz; the legacy PICs are out of the way.
Design
arch::x86_64::pic): both 8259s are remapped to vectors 0xE0–0xEF and fully masked; those 16 vectors get no-op IDT handlers so a spurious IRQ7/IRQ15 is swallowed (a spurious IRQ must not be acknowledged) instead of hitting an empty gate or looking like a CPU exception.arch::x86_64::pit): channel 2 in mode 0 as a one-shot stopwatch polled through port 0x61 (busy_wait_ms, chained in ≤50 ms chunks). It is the calibration reference until ACPI/HPET land in P1.6, and the timer test's independent clock.arch::x86_64::apic): the register page fromIA32_APIC_BASE(0xFEE00000) is device memory, which Limine's direct map does not cover (the first attempt page-faulted athhdm + 0xFEE000F0). It is now mapped uncached/write-through atpaging::KERNEL_MMIO_BASE(512 MiB into the dynamic region) through a newpaging::map_mmio(unsafe: the caller vouches the frame is a device page, since the frame allocator never owns MMIO). SVR enables the APIC with spurious vector 0xFF; the timer counts down fromu32::MAXfor a PIT-timed 10 ms to measure ticks/ms (÷16 divider), then runs periodic on vector 32 at 1 kHz. The handler increments a counter and writes EOI; the spurious handler does nothing.kmainenables interrupts, counts ticks over a PIT-timed 100 ms, requires 90–110 (panics otherwise) and printstimer: LAPIC timer ticking at 1 kHz (N ticks in 100 ms); theuefiandbiossmoke scenarios require that success line, so a dead timer cannot pass. Test builds keep interrupts off around the tests.Tests (AC: timer ticks at 1 kHz; test counts ticks over a busy wait)
lapic_timer_ticks_at_one_khz: enables interrupts, PIT-waits 100 ms, requires 90–110 ticks, disables interrupts again.LAPIC timer ticking at 1 kHz (99 ticks in 100 ms)on both.Verification
fmt, clippy (host + kernel), docs-gate clean. PLAN §11 updated (P1.5 done, next P1.6).
Closes #51
task: P1.5
🤖 Generated with Claude Code