r/linuxquestions • u/[deleted] • May 24 '21
To all the Linux kernel devs and contributors
how did you start learning kernel Dev
what mistakes would you avoid if you were to start all over again
what are the best resources to learn Linux kernel dev
what are the requisite/must knows/stuff nobody tells you about kernel dev
All suggestions are welcome. Thanks in advance.
6
u/bmwiedemann openSUSE Slowroll creator May 25 '21
First and foremost, have a purpose.
When I started to write Kernel code around 2000, I needed a filesystem overlay to write to CD-ROMs - a notoriously read-only media.
I of course did the code in the wrong place, so never even tried to upstream it, so it stopped working when 2.6 kernels changed the rules. Would be better to add the right code in the right place, but to find that, you have to read and talk a lot to others working on that code.
3
0
May 24 '21
[deleted]
20
u/Vlad_The_Impellor May 24 '21
Nailed it. It also helps to understand (at the flyover level) how the GNU C compiler, assembler, and linker work, plus all the other tools commonly used in the build process. Build the current kernel in one job. Note the commands being run and skim their man pages.
You also have to know vi or emacs, and develop/hold an obsessive opinion about your choice which you must be willing to defend. Buy a white robe with brown belt, watch Bruce Lee movie, practice the moves.
6
u/blockjoe May 24 '21
I've noticed I tend to learn well via the "learn by doing" method. I've learned a lot of what I know by having some, sometimes contrived, problem I want a solution for, and I learn by executing on that solution.
A problem I've had, is that I don't have enough understanding to figure out what would be a simple, but illustrative enough of an example to dive into.
Is there anything that you would suggest as a "Hello World!" of device drivers? While I have a bunch of unsupported devices sitting around, I don't think looking at a device that I don't have the spec for and trying to just power my way through an implementation is something that's going to be successful.
5
u/vishwajith_k May 24 '21
Hello world of LDD here https://lwn.net/Kernel/LDD3/ apis are expiring! You need search and replace for a newer kernel; book was written for something may be 2.6
0
May 24 '21
[deleted]
45
4
u/r_phone May 25 '21
Most people look for vulnerabilities in the kernel s
You are suggesting a new bie to look for vulnerability.
Ok
8
u/Toucan2000 May 24 '21
Why
23
-5
May 24 '21 edited Apr 27 '24
snatch worry escape rhythm violet foolish dinner wine square vast
This post was mass deleted and anonymized with Redact
4
u/[deleted] May 25 '21
Are you just curious, or do you want to go into kernel development?
I don't want to discourage you, but if it's the latter, and you ask those questions, you probably aren't ready. The kernel is very complex, it's not something that you can just dive into.
If you just want to help, you should probably pick some simpler projects. Just to start somewhere. You don't go into quantum physics before learning calculus.
You should go into kernel development if:
you're already writing low-level code
(and you want/need to write a driver for some hardware)
you already have an idea of what you can fix/improve from experience
you know C very well and you're a very experienced programmer, so you can look for things you can fix/improve
I'm neither of those, so I don't try to fix what's not broken, and as an experienced devops and not so experienced developer, I just use the software and occasionally report bugs. Because I either don't have the time to figure it out myself, or I lack experience.
Not everyone gets to be a kernel developer, and neither they have to.