Linux users working with unsupported hardware can deploy open-source AI harness tools to reverse-engineer device drivers, as demonstrated by a Red Hat engineering director using Claude Code to build functional code for a Plustek scanner and a Lenovo ThinkPad camera.
Building a Plustek Scanner Driver with Claude Code
Christian Schaller bought a Plustek OpticFilm 8200i scanner for a family digitization project only to find that a manufacturer chipset swap rendered the device unrecognizable to standard Linux drivers. After initial attempts stalled, Schaller returned to the project using an automated testing loop inspired by a post on X from Tom Crider, known as Glorious Eggroll. Claude Code ran the manufacturer software inside a Windows virtual machine while usbmon captured the USB traffic on the Linux host, allowing the AI to compare the operational Windows traffic against the failing Linux implementation. Within days, Schaller produced a working driver supporting infrared scanning, 16-bit color, and grayscale outputs ranging from 300 to 7,200 dpi.
– install codex on windows machine- install and enable ssh server on windows machine- open codex on linux, make it create a client that asks you once to authenticate for windows rdp and windows ssh- it uses xfreerdp and pipewire window capture to render the rdp session…
The resulting custom driver completed a single-frame full-resolution scan in 34.6 seconds, compared to 54.4 seconds for the upstream SANE version. Although upstream support for the newer Genesys GL128 chipset arrived in SANE in September courtesy of another developer, Schaller released his workflow as an open-source project called hw-harness under an MIT license. He also developed a companion Rust application named Negative Vibes, built with Claude, to manage 16-bit scan data and infrared channels without altering original files.
Fixing the Lenovo ThinkPad Camera with AI Code Generation
Turning to a Lenovo ThinkPad X1 Carbon Gen 14 Aura Edition laptop featuring a Sony IMX471 sensor and Intel IPU7 imaging system, Schaller encountered a built-in MIPI camera producing dark images, yellow-green tints, and shadowed corners under Linux. Because the internal MIPI interface lacked easily captured USB traffic, Schaller provided Claude with Windows configuration files, registry entries, ACPI tables, and device properties alongside a connected reference USB webcam.
Claude generated patches for the Linux kernel and libcamera that addressed multiple distinct hardware issues:
- A crop-selection bug causing libcamera to reference incorrect pixel areas.
- An incorrectly defined test-pattern register.
- An analog gain limit restriction that suppressed approximately 1.8 stops of camera sensitivity.
- Missing lens-shading correction that previously left image corners 2.7 stops darker than the center.
Following these patches, low-light frame brightness increased from 31.1 to 90.9, bringing color ratios significantly closer to the reference webcam. The kernel changes are currently under review by Nvidia AI developer technology engineer Kate Hsuan, while Red Hat principal software engineer Wim Taymans handles the libcamera updates.
Configuring the Open-Source hw-harness Tooling
The released hw-harness repository automates the reverse-engineering methodology across multiple modular utilities. The framework runs the manufacturer Windows driver inside a KVM virtual machine with physical device pass-through, while custom scripts manage the hardware environment:
- winctl: Controls the Windows virtual machine session remotely.
- usbcap: Captures USB traffic on the host system via usbmon.
- hostdev: Switches physical hardware devices dynamically between the host and guest operating systems.
- hwdbg: Provides debugging utilities on the Linux side.
PowerShell helper scripts simultaneously extract necessary device descriptors, registry entries, ACPI tables, and INF files to provide coding agents with the exact reference data required to generate merge-ready kernel drivers.
Frequently Asked Questions
What license governs the released hw-harness project?
Schaller published the hw-harness repository under an open-source MIT license on GitHub, bundling the tooling required to capture device behavior and compare implementations.
Which engineers are reviewing the ThinkPad camera patches?
Nvidia AI developer technology engineer Kate Hsuan is reviewing the Linux kernel changes, and Red Hat principal software engineer Wim Taymans is overseeing the libcamera adjustments.
How much faster was the AI-generated scanner driver in testing?
Schaller’s single-frame test completed a full-resolution scan in 34.6 seconds, compared to 54.4 seconds for the upstream SANE alternative.
Related reading