summaryrefslogtreecommitdiffstats
path: root/rsdos/src/main.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-04 03:06:06 +0200
committersalmonik <salmonik@tuta.io>2026-08-04 03:06:06 +0200
commit5e1bdc12bd298a9751da4285b7e93c68b1314332 (patch)
treecc4ae9f256dda100477784a47cbc53373fce79b1 /rsdos/src/main.rs
parentv0.5.9: fix OptiPlex heap crash — EBS retry must not rebuild the free list (diff)
downloadrs-dos-5e1bdc12bd298a9751da4285b7e93c68b1314332.tar.gz
rs-dos-5e1bdc12bd298a9751da4285b7e93c68b1314332.zip
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.
Diffstat (limited to 'rsdos/src/main.rs')
-rw-r--r--rsdos/src/main.rs6
1 files changed, 4 insertions, 2 deletions
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
185 } else { 185 } else {
186 rsnix::serial_println!("gop: not found (0x{:x})", gop_result); 186 rsnix::serial_println!("gop: not found (0x{:x})", gop_result);
187 } 187 }
188 rsnix::gop::boot_marker("rsnix v0.5.9 booting.."); 188 rsnix::gop::boot_marker("rsnix v0.5.10 booting..");
189 rsnix::vt::init(); 189 rsnix::vt::init();
190 let (rows, cols) = rsnix::vt::size(); 190 let (rows, cols) = rsnix::vt::size();
191 rsnix::serial_println!("vt: terminal ready ({}x{})", rows, cols); 191 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
347 347
348 rsnix::serial_println!("boot: entering shell"); 348 rsnix::serial_println!("boot: entering shell");
349 rsnix::gop::boot_marker("rsnix: boot done — shell"); 349 rsnix::gop::boot_marker("rsnix: boot done — shell");
350 if rsnix::ps2::mouse_present() { 350 // USB (xHCI) mouse is polled; fall back to PS/2 if no USB mouse.
351 rsnix::usb::init();
352 if rsnix::ps2::mouse_present() || rsnix::usb::controller_up() {
351 rsnix::cursor::spawn(); 353 rsnix::cursor::spawn();
352 } else { 354 } else {
353 rsnix::serial_println!("cursor: no mouse — overlay disabled"); 355 rsnix::serial_println!("cursor: no mouse — overlay disabled");