Login
Task 6.4b: Virtual interrupts on x86
Login

Branch: slice/6.4b. Commit only there; never to trunk. Two check-ins, in order: (i) the guest's x2APIC and its timer, then (ii) the 8259 and the PIT, with the virtio console's interrupt. Get (i)'s specs passing before starting (ii). Past ~400 non-spec lines in either, stop, commit nothing, and say so (rule 3).

Building: x86_64 outside BQ2's seed. aarch64 only inside it, exactly as docs/tasks/4.1a.md shows, only to show it's unchanged.

Read first:

Claim. An x86 guest gets the interrupt hardware PLAN's x86 row now names: a local APIC in x2APIC mode that it reaches through MSRs, an 8259 pair and a PIT on I/O ports. Glint injects interrupts through the VMCB behind one injection call, the same shape as 6.4a's, and the guest takes them through its own IDT, ends them, and is interrupted again. Glint never decodes a guest instruction.

Passage. Hailperin §7.5.2, as in 6.4a. Quote it if the text is in the workspace; otherwise paraphrase and say so.

Make, (i) the x2APIC and its timer:

Make, (ii) the 8259, the PIT and the virtio interrupt:

Specs.

Constraints. BQ2 tools only. No instruction decoder: every guest access here is a port or an MSR exit, reported with its operands. No start-up initialisers and no heap; the image check passes on both images. No new function over 2 KiB, and no existing one pushed over it, in the built image. About 300 non-spec lines in each check-in. Report every constraint you couldn't meet; never change one silently.

Demonstration. Each check-in: its host specs; outside the seed, the whole x86_64 boot suite and crystal spec with ZEPHYR_SRC set; in the seed, the whole aarch64 boot suite; crystal tool format --check.

Check-in comments. Rule 2's four parts, one per check-in.