Skip to content

Add virtio-input driver crate#322

Open
owenarden wants to merge 1 commit into
mainfrom
feature/virtio-input
Open

Add virtio-input driver crate#322
owenarden wants to merge 1 commit into
mainfrom
feature/virtio-input

Conversation

@owenarden

Copy link
Copy Markdown
Contributor

Summary

  • New src/lib/virtio-input/ crate wrapping VirtIOInput from virtio-drivers 0.12, using the same transport/HAL pattern as virtio-gpu and virtio-net
  • Discovers VirtIO input devices via PCI class 9/0 (vendor 0x1AF4, device 0x1052) and provides InputDevice with pop_event() for raw evdev-format events
  • Adds -device virtio-keyboard-pci to QEMU so the keyboard device is present on boot
  • devmgr confirms discovery as KeyboardController (9 0) at PCIe enumeration

Test plan

  • cargo build-all --profile release compiles cleanly
  • QEMU boot confirms devmgr discovers KeyboardController (9 0)
  • Driver initializes successfully ([input] virtio-input device initialized)
  • Existing WASI test suite passes (32/32, no regression)
  • Verify keyboard events are received via pop_event() when typing in QEMU window

Add a new virtio-input library crate that wraps the VirtIOInput device
from virtio-drivers 0.12, following the same transport/HAL pattern used
by virtio-gpu and virtio-net. The driver discovers VirtIO input devices
via PCI class 9/0 (keyboard controllers) and provides an InputDevice
wrapper with pop_event() for polling raw input events (Linux evdev
format: event_type, code, value).

Also adds -device virtio-keyboard-pci to the QEMU configuration so
the keyboard device is available on boot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@dbittman dbittman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I'll merge once I fix the CI machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants