← Back to Blog 0.7.0 · DRIVERS · KERNEL · USB · x86

xHCI USB-HID Keyboard Enumeration + Transfer Diagnostics

June 24, 2026 · Sigil-Docs · sigil-drivers f06240d · sigil-kernel fc0230e
driverskernelxhciusbhidx86real-metal0.7.0

Full x86 USB-HID keyboard enumeration and transfer diagnostics for real-metal debugging. The drivers commit (f06240d) is the canonical xHCI work; the kernel commit (fc0230e) banks a safety-net patch of the same changes against the submodule base.

Transfer ring fix

Proper circular transfer ring with Link TRB at slot 15 and a one-armed outstanding TRB model. The old code grew the index unbounded and always expected cycle==1 — once the ring wrapped after ~16 interrupt-IN reads, it read past the segment with the wrong cycle expectation, producing garbage TRBs and wild pointer crashes.

Diagnostic painting

On @grio's real hardware the HC freezes at Enable-Slot wait with no UART. The solution: paint register state directly to the framebuffer.

Status row
8-cell diagnostic row showing controller health — USBSTS, CRCR, DCBAAP, command ring state, event ring dequeue pointer.
Transfer state
Latched diagnostics: armed state, EP-state (color-coded), last completion code — green=success, yellow=txn-err, magenta=stall, cyan=short packet.
Report indicator
y=480 cell flashes green on each HID report received — confirms the periodic interrupt-IN transfer is actually delivering data.
VT-d verification
IOMMU state visible in the diagnostic — confirms DMA pass-through is active before transfers begin.

Kernel patch bank

The kernel commit (fc0230e) banks the full xHCI keyboard bring-up as a patch file (patches/sigil-drivers-x86-xhci-keyboard.patch, 487 lines) against submodule base 090082e. This is a safety net — if the machine transfers and the working tree is lost, the patch preserves the complete work. Canonical home remains sigil-drivers.