From be868a43185826b02bf6d091019bb779678525bb Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 17 Aug 2026 14:53:52 +0200 Subject: USB2/1.1 (EHCI/UHCI) drivers + real-hardware bring-up hardening - Add polled EHCI (USB2) and UHCI (USB1.1) host-controller drivers with HID boot mouse support, wired into cursor polling and the 'usb' shell cmd - Add USB Legacy ownership handoff (claim_usb_legacy) plus config_write_byte - Harden boot: verify the PIT/timer ticks before shell entry, EOI stray interrupts in the LAPIC to stop interrupt storms, bound PS/2 controller waits, and INTx-disable AHCI (polled driver) - Add boot stage markers, klog screen echo, and QR lock; scheduler mark_shell_running; NO_USB stopgap to keep BIOS USB-Legacy input alive - alloc_pages_above for DMA buffers that must avoid low conventional memory - Expand DEBUG_NOTES with EHCI/QEMU bring-up findings --- rsnix/src/ahci.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'rsnix/src/ahci.rs') diff --git a/rsnix/src/ahci.rs b/rsnix/src/ahci.rs index a77b341..543bb21 100644 --- a/rsnix/src/ahci.rs +++ b/rsnix/src/ahci.rs @@ -230,9 +230,12 @@ pub fn init() -> bool { let Some((dev, func)) = find_ahci() else { return false; }; - // Enable memory space + bus mastering so MMIO and DMA work. + // Enable memory space + bus mastering so MMIO and DMA work, plus INTx + // disable (bit 10): the driver polls command completion (no ISR, no + // MSI), so the HBA must not assert INTx — a stray SATA interrupt would + // re-fire forever on real hardware. let cmd_reg = pci::config_read(0, dev, func, 0x04); - pci::config_write(0, dev, func, 0x04, cmd_reg | 0x7); + pci::config_write(0, dev, func, 0x04, cmd_reg | 0x7 | 0x400); let Some(abar) = pci::bar64(0, dev, func, 5) else { return false; -- cgit v1.2.3