Skip to content

Add HIDTime stub driver - #4

Merged
kurtjd merged 2 commits into
OpenDevicePartnership:mainfrom
kurtjd:hidtime-stub
Aug 4, 2026
Merged

Add HIDTime stub driver#4
kurtjd merged 2 commits into
OpenDevicePartnership:mainfrom
kurtjd:hidtime-stub

Conversation

@kurtjd

@kurtjd kurtjd commented Aug 4, 2026

Copy link
Copy Markdown
Member

This adds a very simple stub driver for the eventual HIDTIme.sys driver (which should ultimately communicate with HIDClass.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.exe into the VHDX and on first boot ran devgen.exe /add /instanceid HIDTIME01 /hardwareid Root\HIDTime to 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?

Assisted-by: GitHub Copilot:claude-opus-4.8
@kurtjd kurtjd self-assigned this Aug 4, 2026
Copilot AI lite review requested due to automatic review settings August 4, 2026 18:04
@kurtjd
kurtjd requested a review from a team as a code owner August 4, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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/HIDTime KMDF 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 .gitignore to ignore drivers/hid/HIDTime/arm64 build 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.

Comment thread drivers/hid/HIDTime/HIDTime.c
Comment thread drivers/hid/HIDTime/HIDTime.c
philgweber
philgweber previously approved these changes Aug 4, 2026
RobertZ2011
RobertZ2011 previously approved these changes Aug 4, 2026
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
@kurtjd
kurtjd dismissed stale reviews from RobertZ2011 and philgweber via af46840 August 4, 2026 21:26
@kurtjd
kurtjd merged commit 9ed11b3 into OpenDevicePartnership:main Aug 4, 2026
8 checks passed
@kurtjd
kurtjd deleted the hidtime-stub branch August 4, 2026 21:59
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.

5 participants