diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-17 14:53:52 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-17 14:53:52 +0200 |
| commit | be868a43185826b02bf6d091019bb779678525bb (patch) | |
| tree | 586988c15f1d700b1621c7f0208584b30878a56c /rsnix/src/ahci.rs | |
| parent | v0.5.10: change em-dashes to dashes (diff) | |
| download | rs-dos-be868a43185826b02bf6d091019bb779678525bb.tar.gz rs-dos-be868a43185826b02bf6d091019bb779678525bb.zip | |
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
Diffstat (limited to 'rsnix/src/ahci.rs')
| -rw-r--r-- | rsnix/src/ahci.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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 { | |||
| 230 | let Some((dev, func)) = find_ahci() else { | 230 | let Some((dev, func)) = find_ahci() else { |
| 231 | return false; | 231 | return false; |
| 232 | }; | 232 | }; |
| 233 | // Enable memory space + bus mastering so MMIO and DMA work. | 233 | // Enable memory space + bus mastering so MMIO and DMA work, plus INTx |
| 234 | // disable (bit 10): the driver polls command completion (no ISR, no | ||
| 235 | // MSI), so the HBA must not assert INTx — a stray SATA interrupt would | ||
| 236 | // re-fire forever on real hardware. | ||
| 234 | let cmd_reg = pci::config_read(0, dev, func, 0x04); | 237 | let cmd_reg = pci::config_read(0, dev, func, 0x04); |
| 235 | pci::config_write(0, dev, func, 0x04, cmd_reg | 0x7); | 238 | pci::config_write(0, dev, func, 0x04, cmd_reg | 0x7 | 0x400); |
| 236 | 239 | ||
| 237 | let Some(abar) = pci::bar64(0, dev, func, 5) else { | 240 | let Some(abar) = pci::bar64(0, dev, func, 5) else { |
| 238 | return false; | 241 | return false; |
