From 5e1bdc12bd298a9751da4285b7e93c68b1314332 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 4 Aug 2026 03:06:06 +0200 Subject: v0.5.10: USB HID mouse via polled xHCI (rsnix/src/usb.rs) Polled xHCI driver (mouse-only): controller bring-up, port reset, enable-slot -> address-device -> config-descriptor walk -> HID boot mouse IN endpoint, one outstanding IN TRB drained on poll. Cursor task polls usb first, PS/2 second. New 'usb'/'usb rescan' shell cmds. Verified in QEMU (q35 + OVMF + qemu-xhci + usb-mouse): movement and all three buttons tracked exactly; heap stays clean. Fixes en route: MaxPorts=HCSPARAMS1[31:24]; operational regs CRCR=0x18 DCBAAP=0x30 CONFIG=0x38; pass input-context ptr in Address-Device; Input Control Context DW0=Drop DW1=Add; HID walker bInterfaceClass at +5; async discovery from cursor task. --- rsdos/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rsdos') diff --git a/rsdos/src/main.rs b/rsdos/src/main.rs index e40098d..27dab06 100644 --- a/rsdos/src/main.rs +++ b/rsdos/src/main.rs @@ -185,7 +185,7 @@ pub unsafe extern "efiapi" fn efi_main(image_handle: Handle, system_table: *mut } else { rsnix::serial_println!("gop: not found (0x{:x})", gop_result); } - rsnix::gop::boot_marker("rsnix v0.5.9 booting.."); + rsnix::gop::boot_marker("rsnix v0.5.10 booting.."); rsnix::vt::init(); let (rows, cols) = rsnix::vt::size(); rsnix::serial_println!("vt: terminal ready ({}x{})", rows, cols); @@ -347,7 +347,9 @@ pub unsafe extern "efiapi" fn efi_main(image_handle: Handle, system_table: *mut rsnix::serial_println!("boot: entering shell"); rsnix::gop::boot_marker("rsnix: boot done — shell"); - if rsnix::ps2::mouse_present() { + // USB (xHCI) mouse is polled; fall back to PS/2 if no USB mouse. + rsnix::usb::init(); + if rsnix::ps2::mouse_present() || rsnix::usb::controller_up() { rsnix::cursor::spawn(); } else { rsnix::serial_println!("cursor: no mouse — overlay disabled"); -- cgit v1.2.3