Add HIDTime stub driver - #4
Conversation
Assisted-by: GitHub Copilot:claude-opus-4.8
There was a problem hiding this comment.
🟡 Not ready to approve
The SET-style IOCTL paths currently succeed without validating required input buffers, which can violate the IOCTL contract and mask client-side bugs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR introduces a new KMDF “HIDTime” stub driver intended to expose the ACPI Time and Alarm Device (TAD) interface and respond to TAD IOCTLs with recognizable fake data, enabling user-mode clients to validate end-to-end communication on QEMU. It adds the driver’s build project, INF template, version resource, and the driver implementation itself. The driver is installed as a root-enumerated System-class device and publishes the GUID_DEVICE_ACPI_TIME device interface. .gitignore is updated to ignore the driver’s ARM64 build output folder.
Changes:
- Add a new
drivers/hid/HIDTimeKMDF driver project (vcxproj) with INF packaging and version resource. - Implement a minimal IOCTL handler that returns fixed fake values for TAD “get” IOCTLs and stubs the “set” IOCTLs.
- Update
.gitignoreto ignoredrivers/hid/HIDTime/arm64build output.
File summaries
| File | Description |
|---|---|
| drivers/hid/HIDTime/HIDTime.c | Implements the stub KMDF driver, publishes the TAD device interface, and handles TAD IOCTLs with fake responses. |
| drivers/hid/HIDTime/HIDTime.inx | Adds an INF for root-enumerated installation and KMDF service registration. |
| drivers/hid/HIDTime/HIDTime.rc | Adds version/resource metadata for the HIDTime driver binary. |
| drivers/hid/HIDTime/HIDTime.vcxproj | Adds the Visual Studio KMDF driver project and INF wrapping/packaging configuration. |
| .gitignore | Ignores HIDTime ARM64 build output directory. |
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Give each IOCTL its own named handler with a TODO marking the real HID work, and validate the SET input buffers before accepting the writes. Assisted-by: GitHub Copilot:claude-opus-4.8
This adds a very simple stub driver for the eventual
HIDTIme.sysdriver (which should ultimately communicate withHIDClass.sys).The idea is to get this stub in which implements the IOCTLs from OpenDevicePartnership/odp-platform-qemu-arm-virt#44 but only returns fake values, to verify the ratatui app can successfully talk to the driver.
I tested this by injecting it into the VHDX, booting it on our qemu-arm platform, and running the modified ratatui app with HID support (see: OpenDevicePartnership/odp-platform-common#168) which talks to the driver.
Note: Also injected
devgen.exeinto the VHDX and on first boot randevgen.exe /add /instanceid HIDTIME01 /hardwareid Root\HIDTimeto load the driver. In the future will likely want to modify the ACPI tables on qemu-arm-virt to present it so its loaded automatically?