Christian F.K. Schaller used Claude to develop Linux drivers for a Plustek scanner and a MIPI camera. He released 'hw-harness' to help others automate the process of diffing USB traffic between Windows and Linux.
NouGen Intelligence
Strategic Report
Strategic Implications
The story focuses on the application of AI in hardware reverse engineering, which is a technical topic.
Market Verdict
— The Bottom LineAI agents transform the tedious process of hardware reverse engineering into a rapid iterative cycle of capture and diffing.
What happened
Christian F.K. Schaller successfully used AI tooling, specifically Claude, to reverse engineer hardware drivers for Linux. The project began when Schaller purchased a Plustek 8200i negative photo scanner and discovered the chipset had changed to a version unsupported by Linux. After initial failures, he adopted a method inspired by Tom Crider (Glorious Eggroll), which involved giving an AI agent control over a Windows instance to capture necessary hardware data.
Using this approach, Schaller developed a working SANE driver for the Plustek scanner within a few hours. He later applied the same methodology to fix MIPI camera support on his laptop, producing patches for both the kernel driver and libcamera in a single day. To enable others to replicate these results, he created and documented a generic tool called
hw-harness.How it works
Reverse engineering undocumented hardware typically involves capturing bus traffic, analyzing hex dumps, and forming hypotheses about register or control transfer functions. This process is traditionally tedious, requiring weeks of manual testing. AI models are well-suited for this because they can analyze thousands of lines of USB capture, identify repeating sequences with single-byte variations, and propose the meaning of those bytes without fatigue.
The
hw-harness workflow follows a specific technical path:- Reference Recording: The vendor's official Windows driver is run inside a KVM virtual machine. The physical hardware device is passed through to the guest VM.
- External Capture: Traffic is recorded from the Linux host using
usbmon. Because this happens below the passthrough layer, the guest VM cannot detect the capture. - Linux Testing: The user runs their own experimental driver on Linux and captures the traffic using the same
usbmonmethod. - Trace Diffing: Because both captures use the same instrument, the AI can directly diff the two traces. The differences between the Windows reference and the Linux attempt serve as a precise list of driver bugs.
For internal hardware without a tappable bus, such as MIPI cameras, the harness shifts to Windows-side inspection. This involves extracting data from INF files, registry entries, ACPI tables, and device properties.
The catch
While the AI accelerates the "slog" of data analysis, it does not replace the engineer. A human must still decide what to build and verify that the code works on physical hardware.
Additionally, the process is subject to the redundancies of open-source development. In Schaller's case, by the time he perfected his Plustek driver, he discovered that another developer had already committed support for the scanner to the upstream SANE project.
There is also a performance trade-off depending on the implementation. Schaller compared his AI-generated driver to the upstream SANE genesys backend. While his version was faster at full resolution (34.6 seconds versus 54.4 seconds) and supported infrared dust removal, the upstream version offered more resolution steps.
Verdict
AI agents can significantly reduce the time required to write drivers for undocumented hardware by automating the analysis of bus traffic and configuration data.
End of DispatchRead Original Coverage on nougen
NouGen Intelligence Analysis
Key Points
- AI can analyze thousands of lines of USB captures to identify register patterns.
- The hw-harness method uses KVM passthrough and usbmon to diff Windows and Linux traffic.
- The approach avoids copying code, instead observing hardware behavior and extracting constants.
- AI reduced the timeline for MIPI camera patches from weeks of manual work to a single day.
Strategic Implications
The story focuses on the application of AI in hardware reverse engineering, which is a technical topic.