Hacker News new | ask | show | jobs
by Iolaum 2545 days ago
Not really. It is well known across the industry how you can get drivers in linux now. There many players, big (Dell, Lenovo) and small (system76, Entroware, etc) that sell linux supported devices.

Here's a great write up on the technical merits of linux's approach to drivers https://www.kernel.org/doc/html/latest/process/stable-api-no...

2 comments

I think OP was thinking about commercial players who do not like to upstream their driver code. This might be for copyright/GPL reasons, or for trade-secret / code obscurity reasons. This is impossible with linux drivers. To quote from your link:

So, if you have a Linux kernel driver that is not in the main kernel tree, what are you, a developer, supposed to do? Releasing a binary driver for every different kernel version for every distribution is a nightmare, and trying to keep up with an ever changing kernel interface is also a rough job.

Simple, get your kernel driver into the main kernel tree (remember we are talking about drivers released under a GPL-compatible license here, if your code doesn’t fall under this category, good luck, you are on your own here, -snip-).

Thing is, this excludes quite a lot of drivers from getting into the kernel. And that kind of sucks.

I’m noob what regards kernel specifics, so probably a stupid question: so basically if you want kernel to support all possible hardware in the world, you would need to add those drivers to main kernel ? seems like a bad idea because the kernel’s source code would not fit into terabyte size disk..
If you want your driver to run in kernel space you need that code to be in the main kernel. Anything that runs in user-space can be kept outside of the main kernel repo.

There is a bad middle version where you put some interface exposed to user-space into the mainline kernel and then dump in binary-blobs to interface with this. The bad part is doing this if you will be the only user of that interface, and if you do it to intentionally keep your driver out of the kernel. I believe there was/is an attempt by nvidea to essentially get a shim for their windows drivers into the kernel.

The good version of this is where the userspace interface evolves naturally, and in cooperation between multiple consumers. Or at least a case where in the end there are multiple consumers of the interface in the end.

There are a fewer drivers needed these days as interfaces become standardized. Most stuff uses a standard USB driver for example.
You can place a shim into the module and leave the rest in userland. Yes, it hurts performance, but that's the tradeoff.
That writeup does a good job at explaining the current situation, but it doesn't completely refute the validity of the demand. The primary people who are asking for stable driver APIs and ABIs are desktop folks who want to be able to run closed source drivers for their GPU, and other consumer peripherals. Which means its a very limited set of architectures, or maybe just one set of architectures - x86 and x64. The other thing is that linux has a non-modular monolithic kernel design which means that simply having a stable API for GPU drivers isn't enough. you'll probably also need a stable PNP API layer, and a stable IO API Layer, and a stable file system layer, and whatever other OS services a driver would use. The argument about deprecation of interfaces and fixing bugs is valid, but everything is a trade-off in OS design. Linux's implementation of a monolithic design turned out to be very stable, when in-theory, micro kernels have a vastly better design when it comes to stability. Whether theoretical benefits are realized at the ground level, depends on a LOT of factors. Personally, I think the effort required to create a stable API layer would be too enormous to undertake at this point..