SexOS · Handoff · 2026-06-06
Cursor Input Pipeline Fix
Current cursor-input handoff for the USB → sexinput → silk-shell → sexdisplay path. The active patch is bounded to servers/sexusb: slot2 HID pointer reports are demuxed, forwarded to sexinput, and re-armed on their own interrupt ring.
Status
- Domain touched:
servers/sexusb/src/main.rsonly for runtime code. - Boundary preserved: USB still only produces normalized HID reports for sexinput; shell/display policy remains untouched.
- Synthetic drag path: not used for this fix; proof bloat remains gated/off in sexusb.
- Headless limitation: QEMU does not generate host pointer movement in nographic mode, so slot2 forwarding is ready but requires SDL/interactive movement to observe live cursor deltas.
Root Cause
The old path was effectively single-device. The first enumerated HID device became the active interrupt endpoint, so a keyboard on port 1 could make the QEMU tablet on port 2 unreachable for live cursor input. Existing slot2 enumeration/configuration work addressed the second device but did not continuously forward/re-arm slot2 interrupt reports.
Fix Pattern
- Keep bounded root-port scan and two-slot enumeration.
- Track slot2 interrupt ring physical address in
HidDeviceso the link TRB can be rewritten on wrap. - When the shared event ring yields a Transfer Event for slot2, decode tablet/mouse reports by role.
- Forward pointer reports through
OP_USB_MOUSE_REPORTto sexinput. - Clear slot2 report bytes and queue the next slot2 interrupt-IN TRB.
New Proof Markers
| Marker | Meaning |
|---|---|
[sexusb.slot2.forward.mouse] | Slot2 pointer report decoded and forwarded to sexinput. |
[sexusb.slot2.poll.rearm] | Slot2 interrupt-IN TRB re-queued after a slot2 Transfer Event. |
Verification
./scripts/entrypoint_build.sh
# exit code: 0
# final marker: [SEXOS ENTRYPOINT] success
SEXUSB_QEMU_DEVICE=kbd+tablet timeout 55s ./dev.sh run-nographic
# exit code: 124 (expected timeout)
# faults: 0
# observed:
# [sexusb.slot2.enable.ok]
# [sexusb.slot2.address.ok]
# [sexusb.slot2.desc.config] ... hid_role=PointerTablet
# [sexusb.slot2.set_config.ok]
# [sexusb.slot2.configure_endpoint.ok]
# [usb.xhci.multiport.pass] ok=1
Next Interactive Proof
SEXUSB_QEMU_DEVICE=kbd+tablet ./dev.sh run
# move/click inside SDL window, then check serial for:
# [sexusb.slot2.forward.mouse]
# [sexusb.slot2.poll.rearm]
# [sexinput.mouse.live]
# [sexinput.hid.emit.rel]
# [shell.hid.rel.live]
# [sexdisplay.cursor.surface.update]