I’ve always been fascinated by kernel development. Realistically though, what are some examples of useful modules someone could write without several years of practice?
It's not so much that kernel development is all that difficult, but 99% of the things you could make that would be useful would be device drivers. And device driver development requires an understanding of digital logic and the domain-specific "hardware APIs" (registers and stuff) exposed by various types of hardware.
Linux Kernel Module Programming Guide
31–40 of 44 posts
Re: Linux Kernel Module Programming Guide
#32Earlier quoted context omitted.
I wrote some low level code to turn an Arduino into a USB audio device and bit banged audio from a couple pins. Basically no experience in hardware stuff. But to be clear, getting good at programming is definitely a year+ kinda thing, of full time focus.
How did you end up doing USB with the Arduino? Was it bit banged as well (VUSB)? Is this code available anywhere?
Re: Linux Kernel Module Programming Guide
#33Earlier quoted context omitted.
It's not so much that kernel development is all that difficult, but 99% of the things you could make that would be useful would be device drivers. And device driver development requires an understanding of digital logic and the domain-specific "hardware APIs" (registers and stuff) exposed by various types of hardware.
So you would basically either have to be from the company that made the hardware, or have the full documentation for it, or be an insanely talented reverse engineer.
Re: Linux Kernel Module Programming Guide
#34Earlier quoted context omitted.
It really depends what you mean by making it "beginner friendly". A lot of work goes into refactoring and cleaning up code, making things cleaner, adding documentation, adding static and dynamic checkers for locks, memory errors, and various other things, making useful common data structures and code into libraries, inspection and debugging tools, reimplementing as much hand-coded assembly as reasonably possible in C…
My source for this comment is the Linux Device Drivers Development book from about 2004 still being the primary source of information on linux development and when asked about an updated version the response was something like "Back when it was written we needed more developers on linux but not anymore". As well as the comment from linus which I can't find anymore where he says other OSS projects need help more than…
The kernel has never had any official development guide or book. Various tutorials and howtos and books come and go along the way. Another good one,
https://www.kernel.org/doc/gorman/pdf/understand.pdf
They don't really scale at all. The device driver book scratched the surface of device drivers even back then. You can still read things like that and get an idea of the concepts which remain pretty similar, but the best way to really learn it beyond hello world stuff is getting into the code. If you want to write a device driver, start with a copy of a different driver of the same class which is well maintained, for example.
> and when asked about an updated version the response was something like "Back when it was written we needed more developers on linux but not anymore".
Not sure of the "we", but Linux kernel developers are in pretty decent demand today and the number of paid contributors seems to be pretty well growing. Certainly a lot since 2004.
> As well as the comment from linus which I can't find anymore where he says other OSS projects need help more than linux.
Yes that has long been true.
I'm not saying you're simply wrong, and I'm sure some people would find great benefit in more or more up to date books on it, but there has been no point where developers just decided that's enough of making Linux more friendly to newbies or have an easier learning curve. Nor has there ever been a great deal of effort to make it easier for newbies mind you. But as I said, people are always trying to clean things up and improve docs and add more seat belts trying to do staging and mentoring and things etc.... but it's just a difficult thing to improve.
My source is only my anecdote of contributing to Linux for ~20 years, so I admit I could well be biased or blind to some of these issues.
Re: Linux Kernel Module Programming Guide
#35I’ve always been fascinated by kernel development. Realistically though, what are some examples of useful modules someone could write without several years of practice?
Re: Linux Kernel Module Programming Guide
#36Earlier quoted context omitted.
So offer to mirror it then. The D in git’s DVCS stands for “decentralised”. I’ve heard some dumb complaints in my time but the real beauty of this one is you made it on another site that’s IPv4 only (HN doesn’t yet support IPv6 either).
If it were something I was likely to be using a bunch, then I probably would. Saying that it's a "dumb complaint" to point out that large parts of the world can't access the content is kind of taking the piss though. :(
Re: Linux Kernel Module Programming Guide
#37I’ve always been fascinated by kernel development. Realistically though, what are some examples of useful modules someone could write without several years of practice?
Re: Linux Kernel Module Programming Guide
#38Earlier quoted context omitted.
It's not so much that kernel development is all that difficult, but 99% of the things you could make that would be useful would be device drivers. And device driver development requires an understanding of digital logic and the domain-specific "hardware APIs" (registers and stuff) exposed by various types of hardware.
So you would basically either have to be from the company that made the hardware, or have the full documentation for it, or be an insanely talented reverse engineer.
These are usually a Google search away and the way people develop drivers even in professional settings.
For simple devices (e.g. I2C/SPI sensors) the functionality, number of registers, and procedures are usually very limited and it is not difficult.
Re: Linux Kernel Module Programming Guide
#39Nice, I remember reading the old 2007 version a few years ago, so nice to see it's been updated for modern linux. Perhaps one of the authors could update the old page to notify/direct users to the new version? Still ranks first when I google for it Old version: https://tldp.org/LDP/lkmpg/2.6/html/lkmpg.html
Bit disappointed that this doesn't cover custom parsing of module parameters: always thought that was a bit underused.
Re: Linux Kernel Module Programming Guide
#40Earlier quoted context omitted.
Do you have real examples of people that actually have zero access to IPv4 sites, or is this just a theoretical concern?
Quite a few of our (sqlitebrowser.org) users weren't able to access our download server, nor nightly build server, until we made it available over IPv6 in addition to just IPv4. Seems to be mainly people located in South East Asian countries, though I'd have to go trawling back through log history to get the exact details.