Remix.run Logo
petcat 9 hours ago

I feel like ubiquitous hardware support in every OS is going to be a solved problem soon. We're very close to just being able to set an AI coding agent to brute-force a driver for anything. The hardware designer would have to go well out of their way to obfuscate the interface if they really wanted to forbid it, instead of just not bothering to support an OS like BSD or Linux.

diath 8 hours ago | parent | next [-]

The primary reason why it worked is because Claude could rip off the Linux driver. Without any prior work to rely on, how will the AI figure out proprietary hardware?

WD-42 8 hours ago | parent | next [-]

He also mentioned it took 2 months. I’m actually wondering how long it would take to do the Linux to BSD port by eyeball, or at least ai assisted. Probably not that much longer? I guess it depends on wall time vs real time.

lich_king 6 hours ago | parent | next [-]

Most hardware drivers are simpler than people expect. The hardware is usually designed to do the sensible thing in a straightforward way, and you're just translating what the OS wants into a bunch of bits you need to write to the right hardware register.

On the flip side, the perceived barrier is high. Most folks don't have an intuitive sense of how the kernel or "bare metal" environment differs from userland. How do you allocate memory? Can you just printf() a debug message? How to debug if it freezes or crashes? All of these questions have pretty straightforward answers, but it means you need to set aside time to learn.

So, I wouldn't downplay the value of AI for the same reason I wouldn't downplay it with normal coding. It doesn't need to do anything clever to be useful.

That said, for the same reasonss, it's harder to set up a good agent loop here, and the quality standard you're aiming for must be much higher than with a web app, because the failure mode isn't a JavaScript error, but possibly a hard hang.

fragmede 6 hours ago | parent [-]

Harder, but not impossible. You 3d print a jig for a solenoid and a relay so you can warm/cold reboot the laptop, get a pizerow setup and configured to be a keyboard you can control over SSH, a webcam watching the screen, a hardwired Ethernet port, a second computer to manipulate the Device Under Test (aka the MacBook/laptop with a missing whatever driver). Even though waiting on Claude Code doesn't hit flow state if you've only got one project going, setting things up so it can run with it is still fun, for specific and rather nerdy definitions of fun.

bot403 an hour ago | parent [-]

Or, for many things, a VM with hardware passthrough could work.

lstodd 7 hours ago | parent | prev [-]

I estimate two weeks from having never seen kernel source to something reasonably stable based on experience with block devices/raid controllers. But I knew a bit of C (had patches merged into SVN, Exim4, etc).

05 8 hours ago | parent | prev | next [-]

- have AI write a windows filter driver to capture all hardware communications

- have AI reverse engineer Windows WiFi driver and make a crude prototype

- have AI compare registers captured by filter driver with linux driver version and iterate until they match (or at least functional tests pass)

not exactly rocket surgery, and windows device drivers generally don't have DRM/obfuscation, so reverse engineering them isn't hard for LLMs.

wingmanjd 8 hours ago | parent | next [-]

So we send an AI agent to the French cafe instead of us?

https://download.samba.org/pub/tridge/misc/french_cafe.txt

neocron 6 hours ago | parent [-]

Shouldn't AI be able to take this one step further and just analyze the binary (of the samba server in this case) and create all kinds of interface specs from it?

toomuchtodo 6 hours ago | parent [-]

Make the LLM operate the hypervisor VM so it can observe a binary as it executes to write specs for it?

manofmanysmiles 5 hours ago | parent [-]

I'm working on this. It's wild.

8 hours ago | parent | prev [-]
[deleted]
Nextgrid 8 hours ago | parent | prev | next [-]

Trial and error?

Just like it does when given an existing GPL’d source and dealing with its hallucinations, the agent could be operated on a black box (or a binary Windows driver and a disassembly)?

The GPL code helped here but as long as the agent can run in a loop and test its work against a piece of hardware, I don’t see why it couldn’t do the same without any code given enough time?

dotancohen 8 hours ago | parent | next [-]

Presumably one would like to use the laptop before the million years it would take the million monkeys typing on a million typewriters to produce the Shakespearean WiFi driver.

Consider that even with the Linux driver available to study, this project took two months to produce a viable BSD driver.

ssl-3 5 hours ago | parent [-]

This process took two months, including re-appraisals of the process itself, and it isn't clear that the calendar on the wall was a motivator.

The next implementation doesn't have to happen in a vacuum. Now that it has been done once, a person can learn from it.

They can discard the parts that didn't work well straight away, and stick to only the parts of the process that have good merit.

We'll collectively improve our methods, as we tend to do, and the time required will get shorter with each iteration.

vitorsr 6 hours ago | parent | prev [-]

Seems very promising but then you realize the LLM behind said agent was trained on public but otherwise copyright encumbered proprietary code available as improperly redistributed SDKs and DDKs, as well as source code leaks and friends.

In fact most Windows binaries have public debug symbols available which makes SRE not exactly a hurdle and an agent-driven SRE not exactly a tabula rasa reimplementation.

josephg 4 hours ago | parent | prev | next [-]

The Linux driver in this case is ISC licensed. There’s no legal or ethical problem in porting it. This is open source working as intended.

I feel like the jury is still out on whether this is acceptable for GPL code. Suppose you get agent 1 to make a clear and detailed specification from reading copyrighted code (or from reverse engineering). Then get agent 2 to implement a new driver using the specification. Is there anything wrong with that?

Barbing 4 hours ago | parent [-]

>anything wrong with that?

Wonder if the courts will move fast enough to generally matter.

josephg 2 hours ago | parent [-]

As I understand it, reverse engineering for the purpose of interoperability is allowed under the law. The only thing subject to copyright is your code. So long as a separate implementation (made by an AI model or made by hand) doesn't use any of your actual code, you have no claim over it. Only the code is yours.

AI models make the process of reversing and reimplementing drivers much cheaper. I don't understand the problem with that - it sounds like a glorious future to me. Making drivers cheaper and easier to write should mean more operating systems, with more higher quality drivers. I can't wait for asahi linux to support Apple's newer hardware. I'm also looking forward to better linux and freebsd drivers. And more hobbyist operating systems able to fully take advantage of modern computing hardware.

I don't see any downside.

dev_l1x_be 8 hours ago | parent | prev | next [-]

Combine AI + genetic algo?

https://www.reddit.com/r/learnmachinelearning/comments/1665d...

bootwoot 8 hours ago | parent | prev | next [-]

True. But also -- how do humans do it? There are docs and there's other similar driver code. I wouldn't be surprised if Claude could build new driver code sight-unseen, given the appropriate resources

slopinthebag 8 hours ago | parent | next [-]

> But also -- how do humans do it?

Probably a mix of critical thinking, thinking from first principles, etc. You know, all things that LLM's are not capable of.

jacobr1 8 hours ago | parent [-]

Except it often is the case that when you break down what humans are doing, there are actual concrete tasks. If you can convert the tacit knowledge to decision trees and background references, you likely can get the AI to perform most non-creative tasks.

slopinthebag 8 hours ago | parent [-]

If you have to hold the LLM's hand to accomplish a task, using human intelligence to do so, you can't consider the task performed by AI.

jacobr1 7 hours ago | parent [-]

I half agree. But two points: 1) if you can formalize your instructions ... then future instances can be fully automated. 2) You are still probably having the AI perform many sub-tasks. AI-skeptics regularly fall into this god-of-the-gaps trap. You aren't wrong that human-augmented AI isn't 100% AI ... but it still is AI-augmentation, and again, that sets the stage for point 1 - to enable later future full automation on long enough timecycles.

skydhash 6 hours ago | parent [-]

> if you can formalize your instructions

Isn't that...code?

deaux 5 hours ago | parent [-]

No. Think of all engineering disciplines that aren't software. Those all depend on human-language formal instructions.

okanat 5 hours ago | parent | next [-]

Formal instructions paired by tables are almost as rigid as code. Btw normal engineering disciplines have a lot of strict math and formulas. Neither electrical nor mechanical engineering runs on purely instructions.

ThrowawayR2 3 hours ago | parent | prev [-]

The non-software engineering disciplines I'm thinking of rely on blueprints, schematics, diagrams, HDLs, and tables much more than human language formal instructions. More so than software engineering.

deaux 2 hours ago | parent [-]

Disagree, they rely on both equally, not much more on one of them. Consider the process of actually building a large structure with only a set of such diagrams. The diagrams primarily cover nouns (what, where, using what), whereas the human language formal instructions cover the verbs (how, why, when). You can't build anything with only one of the two.

And sure, the human language formal instructions often appear inside tables or diagrams, that doesn't make them anything less so.

This is based on having worked with companies that do projects in the 10 figure range.

jwatte 6 hours ago | parent | prev | next [-]

Humans do it with access to the register-level data sheets, which are only available under NDA, and usually with access to a logic analyzer for debugging.

Usually, the problem with developing a driver isn't "writing the code," it's "finding documentation for what the code should do."

okanat 5 hours ago | parent [-]

... and then figuring out where the hardware company cheapened out and created a whole unfixable mess (extra fun when you first ship your first 10k batch and things start failing after the vendor made a "simple revision"). Then finding a workaround.

chrisjj 8 hours ago | parent | prev | next [-]

> But also -- how do humans do it?

Intelligence.

deadbabe 6 hours ago | parent | prev [-]

Scientific method. There are many small discoveries humans make that involve forming a hypothesis, trying something out, observing the results, and coming to a conclusion that leads to more experimentation until you get to what you actually want. LLMs can’t really do that very well as the novel observations would not be in their training data.

cryptonector 8 hours ago | parent | prev | next [-]

GPL is not a patent. It covers the work and _derivatives_; it does not cover ideas or general knowledge. The chip in question has docs.

I fully expect that Claude wrote code that does not resemble that of the driver in the Linux tree. TFA is taking on some liability if it turns out that the code Claude wrote does largely resemble GPL'ed code, but if TFA is not comfortable with the code written by Claude not resembling existing GPL'ed code then they can just post their prompts and everyone who needs this driver can go through the process of getting Claude to code it.

In court TFA would be a defendant, so TFA needs to be sure enough that the code in question does not resemble GPL'ed code. Here in the court of public opinion I'd say that claims of GPL violation need to be backed up by a serious similarity analysis.

Prompts cannot possibly be considered derivatives of the GPL'ed code that Claude might mimic.

shakna 8 hours ago | parent | next [-]

From the file headers:

SPDX-License-Identifier: ISC

Copyright (c) 2010-2022 Broadcom Corporation

Copyright (c) brcmfmac-freebsd contributors

Based on the Linux brcmfmac driver.

I'm going to ahead and say there are copyright law nightmares, right here.

throwaway2037 6 hours ago | parent [-]

That headers looks pretty reasonable to me. I don't see anything misleading or ambiguous about it. Whenever I am heavily modifying some licensed code, I always make sure to include a similar header.

    > I'm going to ahead and say there are copyright law nightmares, right here.
I am confused. My first thought was maybe the original Linux driver was GPL'd, but it is not. It is ISC'd. Look here: https://github.com/torvalds/linux/blob/master/drivers/net/wi...

    // SPDX-License-Identifier: ISC
    /*
     * Copyright (c) 2010 Broadcom Corporation
     */
shakna 4 hours ago | parent [-]

It adds a contributor.

To add a contributor, you need "significant" _human_ input. The output of models has so far not been deemed copyrightable.

As it acknowledges the original source, it needs to show the human effort that allows it to be bound to the new contributors.

ssl-3 8 hours ago | parent | prev [-]

Except...

In this case, they didn't really work from the chip's published documentation. They instead ultimately used a sorta-kinda open-book clean-room method, wherein they generated documentation using the source code of the GPL'd Linux driver and worked from that.

That said: I don't have a dog in this race. I don't really have an opinion of whether this is quite fine or very-much not OK. I don't know if this is something worthy of intense scrutiny, or if it should instead be accepted as progress.

(It is interesting to think about, though.)

throwaway2037 6 hours ago | parent [-]

As I mentioned in another comment, the original referenced source code from the Linux kernel is ISC'd, not GPL'd. See here: https://github.com/torvalds/linux/blob/master/drivers/net/wi...

I don't work on the Linux kernel, but I do poke around the sources from time to time. I was genuinely surprised to see that some hardware drivers are not GPL'd. That is news to me, but makes commercial sense to when I think deeper about it. When these manufacturers donate a driver to Linux, I don't think GPL is a priority to them. In the case of Broadcom, they probably want their WiFi hardware to more compatible with SBCs to drive sales (of future SBCs that use their WiFi hardware and run Linux). If anything, choosing a more liberal license (ISC) increases the likelihood that their Linux driver will be ported to other operating systems. From Broadcom's commercial view, that is a win to sell more SBCs (free labour from BSDers!).

Also, if the original driver was GPL'd, I am pretty sure it is fair game (from US copyright and software license perspective) to use one LLM to first reverse engineer the GPL'd driver to write a spec. Then use a different LLM to implement a new driver for FreeBSD that is ISC'd. You can certainly do that with human engineers, and I see no reason to believe that US courts would object to separate LLMs being used in the two necessary steps above. Of course, this assumes good faith on the part of the org doing the re-write. (Any commercial org doing this would very carefully document the process, expecting a legal challenge.)

I do think this blog post introduces a genuinely (to me!) novel way to use LLMs. My favourite part of that blog post was talking about all of the attempts that did not work, and new approaches that were required. That sounds pretty similar to my experience as a software engineer. You start with preconceived notions that frequently shattered after you walk down a long and arduous path to discovering your mistakes. Then you stop, re-think things, and move in a new intellectual (design) direction. His final solution of asking LLMs to write a spec, then asking other LLMs to proof-read it is highly ingenious. I am really impressed. Please don't view that "really impressed" as my thinking that the whole world will move to vibe coding; rather I think this is a real achievement that deserves some study by us human engineers.

toast0 8 hours ago | parent | prev | next [-]

Repurposing NDIS drivers is a time honored tradition. No source, but oh well.

ranger_danger 7 hours ago | parent | prev | next [-]

It could be given reference material like documentation/datasheets and/or just be prompted as to how it should work.

rustyhancock 8 hours ago | parent | prev [-]

I haven't read the article but my first question was, install wifibox?

It's a bhyve VM running alpine Linux and you pass through your WiFi adaptor and get a bridge out on the freebsd host.

WD-42 8 hours ago | parent | next [-]

Literally explained in the post, that’s why you read first.

8 hours ago | parent | prev [-]
[deleted]
Gigachad 8 hours ago | parent | prev | next [-]

Maybe one day, but it doesn't look like we are very close yet. From the OP article, they handed it the working linux driver and asked it to just make this FreeBSD compatible, but it could not. Looks like it took OP a significant amount of work over 2 months to get something that seems to work.

What is interesting is it seems like the work resembles regular management, asking for a written specification, proof reading, etc.

ssl-3 8 hours ago | parent | next [-]

> What is interesting is it seems like the work resembles regular management, asking for a written specification, proof reading, etc.

That's how I've been using the bot for years. Organize tasks, mediate between them, look for obvious-to-me problems and traps as things progress, and provide corrections where that seems useful.

It differs from regular management, I think, in that the sunk costs are never very significant.

Find a design issue that requires throwing out big chunks of work? No problem: Just change that part of the spec and run through the process for that and the stuff beneath it again. These parts cost approximately nothing to produce the first time through, and they'll still cost approximately nothing to produce the second time.

I'm not building a physical structure here, nor am I paying salaries or waiting days or weeks to refactor: If the foundation is wrong, then just nuke it and start over fresh. Clean slates are cheap.

(I don't know if that's the right way to do it, or the wrong way. But it works -- for me, at least, with the things I want to get done with a computer.)

plagiarist 8 hours ago | parent | prev | next [-]

To make these things work you do need to write a spec and figure out what unit tests will prove it actually did what you want. Even then it will take a bunch of shortcuts so it's best if you're a domain expert anyway.

lazide 8 hours ago | parent | prev [-]

Aka, the hard part.

ahoka 8 hours ago | parent | prev | next [-]

That pesky GPL does not stop us anymore, cool.

petcat 8 hours ago | parent | next [-]

What would the GPL have to do with this?

tokyobreakfast 8 hours ago | parent | next [-]

In the mid-2000s there was a bit of drama when Linux wireless driver code ended up in BSD (or maybe the other way around). The Internet was angry that day my friend; a bunch of nerds sperging out over licenses and which license is more "free". Ultimately the code was removed.

It sure seems like AI agents can sidestep all that by claiming ignorance on license matters.

stanac 8 hours ago | parent | prev | next [-]

AI written driver could be a rip off Linux driver.

IshKebab 8 hours ago | parent | prev [-]

If the Linux driver is GPL and he made the new driver using AI to essentially copy it then claim that the result wasn't covered by the GPL... It's an area not settled by law yet.

Still not as bad as the guy who paid for a commercial license for some Linux driver, fed it into Claude to get it to update it to the latest Linux, and then released it as GPL! That's definitely not a grey area.

https://youtu.be/xRvi3k8XV8E

Absolutely mental behaviour for a business. What were they thinking?

heffer 5 hours ago | parent [-]

It's clickbait. The "driver" is actually a rather comprehensive kernel patch that modifies existing GPLv2 kernel code, so by its very nature it is at least GPLv2 (original parts may be dual licensed by the vendor if they want to, but they can't not make it GPLv2).

What this person paid $40,000 for is access to development kits for certain hardware, which with chip vendors like that usually also comes with support. The vendor cannot prevent you from exercising your GPLv2 rights after they hand you the code. In fact, if you manufacture and distribute a device that uses these kernel patches it becomes your obligation to enable your customers to exercise their GPLv2 rights. Chip manufacturers know this and (if they are somewhat reputable) usually license their code appropriately.

melagonster 5 hours ago | parent | prev [-]

I do not know why people do not just add GPL license to their generated code.

estimator7292 8 hours ago | parent | prev | next [-]

Drivers can be anywhere from so trivial you can throw it together by hand in an afternoon to so complex that it requires an entire engineering team six months of concentrated effort.

8 hours ago | parent [-]
[deleted]
rvz 9 hours ago | parent | prev | next [-]

> We're very close to just being about to set an AI coding agent to brute-force a driver for anything.

That sounds quite naive and it isn't that simple. Even the author expressed caution and isn't sure about how robust the driver is since he hasn't seen the code himself nor does he know if it works reliably.

Even entertaining the idea, someone would have already have replaced those closed source Nvidia drivers that have firmware blobs and other drivers that have firmware blobs to be open replacements. (Yes Nouveau exists, but at the disadvantage of not performing as well as the closed source driver)

That would be a task left to the reader.

calmbonsai 8 hours ago | parent | next [-]

> We're very close to just being about to set an AI coding agent to brute-force a driver for anything.

This is false. To "brute force" a driver, you'd need a feedback loop between the hardware's output and the driver's input.

While, in theory, this is possible for some analog-digital traducers (e.g WI-FI radio), if the hardware is a human-interface system (joystick, monitor, mouse, speaker, etc.) you literally need a "human in the loop" to provide feedback.

Additionally, many edge-cases in driving hardware can irrevocably destroy it and even a domain-specific agent wouldn't have any physics context for the underlying risks.

ssl-3 7 hours ago | parent [-]

Strictly speaking, I don't think we need a human to run repetitive tests. We just need the human to help with the physical parts of the testing jig.

For instance: A microphone (optionally: a calibrated microphone; extra-optionally: in an isolated anechoic chamber) is a simple way to get feedback back into the machine about the performance of a speaker. (Or, you know: Just use a 50-cent audio transformer and electrically feed the output of the amplifier portion of the [presumably active] speaker back into the machine in acoustic silence.)

And I don't have to stray too far into the world of imagination to notice that the hairy, custom Cartesian printer in the corner of the workshop quite clearly resembles a machine that can move a mouse over a surface in rather precise ways. (The worst that can happen is probably not as bad as many of us have seen when using printers in their intended way, since at least there's no heaters and molten plastic required. So what if it disassembles itself? That's nothing new.)

Whatever the testing jig consists of, the bot can write the software part of the tests, and the tests can run as repetitiously as they need to.

pmontra 8 hours ago | parent | prev | next [-]

I'm not so sure that Nouveau is slower than the proprietary Nvidia driver. I didn't run benchmarks on my personal use case but my subjective experience is that Nouveau might be faster. It's a Debian 11, X11, NVIDIA driver vs Debian 13, X11, Nouveau on the same laptop with a Quadro K1100mq. The desktop of the newer system seems to be faster. Of course it could be the sum of the individual improvements of kernel, GNOME, etc. I only move windows around my desktop, no games, so it's a very limited scenario.

WD-42 8 hours ago | parent | next [-]

Absolutely not. Nouveau might give you a usable desktop but the second you need to do any 3d rendering or decoding it’s atrocious.

ranger_danger 6 hours ago | parent | prev [-]

In my experience, the proprietary driver has always blown away nouveau at 3D rendering performance and featureset.

ineedasername 8 hours ago | parent | prev | next [-]

someone would have already have replaced those closed source Nvidia drivers that have firmware blobs

This isn’t quite a fair example, these are so massively complex with code path built explicitly for so many individual applications. Nvidia cards are nearly a complete SoC.

Though then again, coding agents 1 year ago of the full autonomous sort were barely months old, and now here we are in one year. So, maybe soon this could be realistic? Hard to say. Even if code agents can do it, it still costs $ via tokens and api calls. But a year ago it would have cost me at least a few dollars and a lot more time to do things I get done now in a prompt and 10 minutes of Opus in a sandbox.

8 hours ago | parent | prev [-]
[deleted]
octoberfranklin 8 hours ago | parent | prev | next [-]

Hardware driver bugs frequently manifest as concurrency flakiness or heisenbugs.

AI is notoriously bad at dealing with bugs that only cause problems every few weeks.

bluGill 6 hours ago | parent | next [-]

I've found ai really good at the rare problems. The code hangs 1 out of 200 times - it spends half an hour and finds a race condition and a proposed fix - something complex that is really difficult for humans to figure out. Now grated the above problem took a dozen rounds over a couple days to completly solve (and it happend more often than every two weeks), but it was able to find an answer given symptoms.

jomohke 8 hours ago | parent | prev | next [-]

I've thought for a while now that we'll end up moving to stricter languages that have safer concurrency, etc, partly for this reason. The most prominent resistance against such languages was the learning curve, but humans like OP aren't looking at the code now.

8 hours ago | parent | prev | next [-]
[deleted]
hahn-kev 6 hours ago | parent | prev [-]

So are people

mschuster91 6 hours ago | parent | prev | next [-]

> We're very close to just being able to set an AI coding agent to brute-force a driver for anything.

Yeah, but that only works for so long as the AI doesn't brute force a command that hard-bricks the device. Say, it causes a voltage controller to give out way too high voltages by a command, burns e-fuses or erases vital EEPROM data (factory calibration presets come to my mind here).

skydhash 8 hours ago | parent | prev | next [-]

The driver used as inspiration is fully opensource

https://github.com/torvalds/linux/tree/v6.18/drivers/net/wir...

I don't know why it has not been brought in the BSDs (maybe license), but they do are a bit more careful with what they include in the OS.

wangzhongwang 6 hours ago | parent | prev | next [-]

I think we're closer than most people realize, but the hard part isn't generating the code — it's testing it. Drivers need to handle edge cases that only show up under specific hardware conditions, timing issues, power states, etc. An AI can write a first draft pretty fast, but validating it still requires actual hardware in the loop. The FreeBSD case worked because brcmfmac is well-documented and the author could test on real hardware. For more obscure chipsets with no public datasheets, we're still stuck.

jwatte 6 hours ago | parent | prev [-]

Tell me you've never developed a driver, without telling me you've never developed a driver.