AI NewsProductivityAnnouncement
Red Hat engineer uses Claude to write a Linux scanner driver
Christian Schaller, a Red Hat engineering director, used Claude Code and the manufacturer's Windows driver to build a working Linux driver for a photo scanner, then released the tool he built along the way as hw-harness.
Image: GitHub
Why it mattersA coding agent that can watch a working driver and copy how it talks to the chip turns a weekend into hours. A Linux team can take on hardware it would have skipped last year.
Buying a Linux-supported scanner is no help when the manufacturer silently swaps the chipset and forgets to mention it. That is what Christian Schaller found when a box of old family negatives sent him looking for a film scanner, and the Plustek OpticFilm 8200i he bought as a "supported" model turned out to ship a Genesys GL128 controller instead of the GL845 that SANE knew about. Schaller, a Red Hat engineering director, has now released the tool he built to work around it.
Schaller writes on his blog that he had tried getting Claude Code to write a SANE backend from scratch and got stuck for months. The agent had no working driver to compare against, so it was guessing at register values and control transfers from USB captures alone. When he came back to the project, Schaller set up a different arrangement. Claude ran the manufacturer's Windows driver inside a KVM virtual machine with the scanner passed through, captured the USB traffic the Windows driver was sending, and compared it to what his Linux driver was sending. "The AI is good at the tedium," Schaller writes. "That covers decoding captures, writing probes and cross-checking constants." The first recognisable scan came within hours. Infrared scanning worked a few days later.
What hw-harness is
Schaller released the setup as a GitHub project called hw-harness, under an MIT licence. He is clear that it is not the exact tooling he used on the scanner, but the generalised version. The repository bundles winctl for controlling the Windows virtual machine, usbcap for capturing traffic, hostdev for switching the device between the host and the guest, and hwdbg for Linux-side debugging. PowerShell scripts collect device descriptors, registry entries, ACPI tables and INF files from the Windows side. Schaller writes that the approach can produce a driver "a maintainer can actually merge", and adds that licensing questions remain open and the harness has not been tested across a wide range of hardware.
What it produced
Schaller put his finished driver through a single-frame test against the upstream SANE version that another developer had shipped in September. His version completed a full-resolution scan in 34.6 seconds against 54.4 seconds upstream. Both resolved the same detail at 3,600 dpi. He is not planning to maintain a competing driver and will switch to the upstream one when it has the features he needs. The method is the point, not the specific scanner.
He also pointed Claude at the camera on his Lenovo ThinkPad X1 Carbon Gen 14. The camera has no USB traffic to capture, so Schaller fed Claude the Windows driver's configuration files, registry entries, ACPI tables and device properties, and hooked up a USB webcam as a working reference. By the end of the day he had kernel and libcamera patches that fixed three bugs in the kernel driver and two in libcamera. The frame brightness in his low-light test rose from 31.1 to 90.9. The patches are with Kate Hsuan at Nvidia and Wim Taymans at Red Hat for review.
For a Linux platform team looking at a backlog of "no driver yet" hardware, hw-harness turns the question from "who has three weeks to spare" into "whose desk has the hardware on it". The caveats sit on the maintainer side: an AI-written patch still needs a human review, Schaller tested the approach on two devices, and one of his earlier Claude-generated kernel fixes recently hit a race condition during review.
Source
Using Artificial Intelligence to reverse engineer hardware by Christian Schaller. The New Stack also covered the project.
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.


