Linked by Thom Holwerda on Sun 22nd Jul 2007 00:33 UTC, submitted by liquidat
Linux Linus Torvalds included patches into the mainline tree which implement a stable userspace driver API into the Linux kernel. The stable driver API was already announced a year ago by Greg Kroah-Hartman. Now the last patches were uploaded and the API was included in Linus' tree. The idea of the API is to make life easier for driver developers: "This interface allows the ability to write the majority of a driver in userspace with only a very small shell of a driver in the kernel itself. It uses a char device and sysfs to interact with a userspace process to process interrupts and control memory accesses."
Thread beginning with comment 257137
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: I wonder...
by kaiwai on Sun 22nd Jul 2007 02:26 UTC in reply to "I wonder..."
kaiwai
Member since:
2005-07-06

I wonder what all the pundits that have proclaimed that stable APIs are evil for years will say now that their beloved Linux kernel is providing one?


They will claim that there is a difference between a stable API for drivers in user space and one for kernel space.

For me, I think the real reason why they don't have a stable driver API is that it would require them to actually knuckle down and design something rather than merely just throwing at a wall to see what sticks.

When things like the USB stack have been rewritten 3 times, people here point to 'ooh, they're optimising' when in reality it has to do with a lack of planning - Linux kernel developers seem to ignore the cardinal rule that all programmers are taught regarding system design and analysis.

Edited 2007-07-22 02:40

Reply Parent Score: 5

RE[2]: I wonder...
by Almafeta on Sun 22nd Jul 2007 02:36 in reply to "RE: I wonder..."
Almafeta Member since:
2007-02-22

You seem to left out an important verb. They seem to what the cardinal rule? ^^;

Reply Parent Score: 1

RE[3]: I wonder...
by kaiwai on Sun 22nd Jul 2007 02:42 in reply to "RE[2]: I wonder..."
kaiwai Member since:
2005-07-06

You seem to left out an important verb. They seem to what the cardinal rule? ^^;


Design, design, design, document, document, document - rinse and repeat until you're confident enough that the design is robust enough to be forwards compatible and allow future development without needing to continuously throw out old code because the original design was flawed.

Reply Parent Score: 5

RE[2]: I wonder...
by TBPrince on Sun 22nd Jul 2007 03:03 in reply to "RE: I wonder..."
TBPrince Member since:
2005-07-06

Completely agree. A stable API would require a better design while it appears that development mostly run in a semi-occasional way.

However, this is good news. If they will be able to keep it stable as promised, this could be a good evolution.

Reply Parent Score: 4

RE[2]: I wonder...
by aent on Sun 22nd Jul 2007 03:31 in reply to "RE: I wonder..."
aent Member since:
2006-01-25

That kind of is the whole argument of why no stable API is better. By just sticking to one design and not trying anything else or allowing that design to evolve with a stable API, they may be stuck with the original poor design as they are seeing how it is used. If they can redo the design a couple of times, then they can have a better design.

Taking the USB stack as an example, if they tried to keep the original design and make it a stable API, would that be better then the evolutionized and better API that they replaced it with as the USB technology progressed with stuff like USB 2.0 coming out? There are tradeoffs on both sides, and the argument was that for Linux's architecture and development process, they thought that a stable API would hinder the development they wanted, being able to correct any API issues that weren't well thoughtout the first time around without having to worry about any obsolete or deprecated APIs.

Reply Parent Score: 5

RE[3]: I wonder...
by kaiwai on Sun 22nd Jul 2007 04:50 in reply to "RE[2]: I wonder..."
kaiwai Member since:
2005-07-06

That kind of is the whole argument of why no stable API is better. By just sticking to one design and not trying anything else or allowing that design to evolve with a stable API, they may be stuck with the original poor design as they are seeing how it is used. If they can redo the design a couple of times, then they can have a better design.


On what basis - you design a stable on the basis of future development; if you design it based solely on todays specifications, of course you're doomed to failure!

Take a look at Sun's own USB stack, for instance - it didn't need to be re-written three times and performs the same if not better than Linux's.

Heck, look at Sun's new network infrastructure for instance, nothing stopped them from pushing some great ideas such as the new network infrastructure - Nemo.

What you're saying to me is that progress without complete breakage is impossible. 25 years of commercial development by way of Windows and various UNIX's says otherwise.

Taking the USB stack as an example, if they tried to keep the original design and make it a stable API, would that be better then the evolutionized and better API that they replaced it with as the USB technology progressed with stuff like USB 2.0 coming out? There are tradeoffs on both sides, and the argument was that for Linux's architecture and development process, they thought that a stable API would hinder the development they wanted, being able to correct any API issues that weren't well thoughtout the first time around without having to worry about any obsolete or deprecated APIs.


And if they had their act together they would have written their code modular enough so that the calls exposed to developers are written in such a way that their call isn't based on some arbitrary condition on based on decisions made further down.

For example; if you expose an API, if you write it correctly, what the heck is being done behind the scenes should not matter a donkey's diddle to the programmer concerned. He throws his request to the API, and lets the appropriate libraries to sort out the low level work then regurgitating it back to the developer again. What happens inside that blackbox is none of the programmers concern.

To say that some how if you change the internal processes, you're forced to change the external outcomes of each call is completely ignoring the basic understanding of programming.

Reply Parent Score: 5

RE[2]: I wonder...
by butters on Sun 22nd Jul 2007 04:31 in reply to "RE: I wonder..."
butters Member since:
2005-07-08

For me, I think the real reason why they don't have a stable driver API is that it would require them to actually knuckle down and design something rather than merely just throwing at a wall to see what sticks.

So you're one of those intelligent design people. Still not convinced that biology works by random chance and natural selection?

I think it's understandable to believe that your deity of choice had the insight to create existence, sit back, pop open a cold one, and watch it play out exactly as He (She?) intended. But attributing the same level of insight to humans, and software developers in particular, is stretching beyond the realm of my ability to understand different points of view.

Certainly there's more standing in the way of human prescience than our failure to knuckle down. It could have something to do with our shockingly arrogant assertion of greatness in spite of our historical failure to achieve mere civility.

We have to keep throwing stuff at the wall, because not everything sticks. To settle for anything less is to squander whatever potential we actually have.

If we're going to do this free software thing, let's not leave any good idea untried. Let's challenge our preconceptions and give it everything we've got. Let's have no regrets and no apologies. Let's throw the notion of meritocracy at the wall and see if it sticks.

Edited 2007-07-22 04:46

Reply Parent Score: 4

RE[3]: I wonder...
by SReilly on Sun 22nd Jul 2007 06:58 in reply to "RE[2]: I wonder..."
SReilly Member since:
2006-12-28

That is without a doubt the most elegant way of putting our shared goal into words that I have ever read. Bravo!

Reply Parent Score: 1

RE[3]: I wonder...
by PlatformAgnostic on Sun 22nd Jul 2007 08:59 in reply to "RE[2]: I wonder..."
PlatformAgnostic Member since:
2006-01-02

Evolution tends to conserve more than it changes. You can only have life when you have a core set of things that function to maintain homeostasis. Without this, you just have unconstrained chemical reactions which just dissipate energy and create no further development.

We may argue that different levels of homeostasis and transistasis are necessary for different classes of organisms, but most natural organisms evolve by duplicating genes and then mutating one of the replicas so that the old functionality continues working while the other replica either slowly mutates into oblivion or becomes something entirely different.

There's nothing wrong with a stable ABI with clear transitions so that one can be deprecated over several releases while the new one is brought online. The testing and maintanance effort is slightly greater, but with 100s of people involved in the Linux Kernel's development, there really should be no excuse to maintain a pair of ABI revs for major interfaces.

Reply Parent Score: 3

RE[3]: I wonder...
by Oliver on Sun 22nd Jul 2007 09:44 in reply to "RE[2]: I wonder..."
Oliver Member since:
2006-07-15

>Still not convinced that biology works by random chance and natural selection?

Natural selection is the american reason for racism and the Third Reich. Biology doesn't work by random at all and a computer doesn't work by random at all. I don't have to be full of faith to see the nonsense in this absolute saying.
This what you call "by random" is something we don't understand at the moment. But it's nonsense too to invent some god as explanation.

And you if you don't see the analogy within Linux: it's chaos without almost any order, so it's weak and inferior. Without Linus at the top with his "dictatorship", there wouldn't be a Linux anymore. This is your "god", the mastermind behind it.

>If we're going to do this free software thing, let's not leave any good idea untried.

Yes and don't forget to think about "good ideas", some people call this quality software engineering.

Reply Parent Score: 2

RE[2]: I wonder...
by baadger on Sun 22nd Jul 2007 11:40 in reply to "RE: I wonder..."
baadger Member since:
2006-08-29

As you know, the idea behind a fluid internal API as well as a high frequency release cycle is to make the kernel more agile and see it provide support current technology more quickly.

Initially the result is the lack of a nice clean interfaces and a higher barrier for those trying to get into kernel development (lack of documentation) but it certainly doesn't result in the loss of generic device layers.

As examples look at the new wireless stack (that admittedly we have yet to see a lot of drivers mvoe over too) and libata. Both are good examples of convergence of code and functionality in the kernel. These layers just take time to emerge and are introduced into mature areas of the kernel, there's really no point developing such a layer if over the next X years a whole new class of related devices are going to come along and you haven't foreseen them in your design.

I put you to what is worse: a little continuous effort by driver developers to keep up or developers writing hacks to shoehorn their 2007 hardware into an API that was designed in 2001 (think Windows XP)?

Isn't it true that most wireless drivers for XP have had to implement the majority of their own wireless stack?

Reply Parent Score: 5

RE[2]: I wonder...
by abraxas on Mon 23rd Jul 2007 01:17 in reply to "RE: I wonder..."
abraxas Member since:
2005-07-07

When things like the USB stack have been rewritten 3 times, people here point to 'ooh, they're optimising' when in reality it has to do with a lack of planning - Linux kernel developers seem to ignore the cardinal rule that all programmers are taught regarding system design and analysis

You would like to believe that is the case but it isn't. The USB drivers are a lot better than the drivers available for Windows or OSX. The reason they are better is because they don't have to worry about backwards compatibility. Sure the Windows USB drivers are stable but they suck in comparison. Microsoft could probably write better drivers now if they wanted to but they would have to sacrifice compatibility.

What people like you fail to realize is that a lot of the rewriting that goes on is re-factoring. There are advantages to stabilizing on an API but there are also advantages not to.

Reply Parent Score: 3