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

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

  1. Keep bounded root-port scan and two-slot enumeration.
  2. Track slot2 interrupt ring physical address in HidDevice so the link TRB can be rewritten on wrap.
  3. When the shared event ring yields a Transfer Event for slot2, decode tablet/mouse reports by role.
  4. Forward pointer reports through OP_USB_MOUSE_REPORT to sexinput.
  5. Clear slot2 report bytes and queue the next slot2 interrupt-IN TRB.

New Proof Markers

MarkerMeaning
[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]