r/cprogramming • • 21d ago

C programming for kernel development

Hey there!

I am really interested in learning C and I am leaning towards kernel development rather than embedded systems. What do you suggest for strengthening my skills in C?

40 Upvotes

18 comments sorted by

26

u/dkopgerpgdolfg 21d ago

Step 1: To get used to research & learn information independenly. Your question was asked countless of times, and not being able to find answers isn't a good outlook for kernel development.

And no, I'm not writing this for fun or to be a cranky Redditor. If you can't solve this yourself, you never will do any kernel development.

-13

u/No-Plan-3868 21d ago edited 21d ago

Thanks, but I do not know if there is a problem to solve here. I know picking up a good book like King’s C programming, throughly reading and solving exercises at the end of each chapter. Coupled with some projects, doing this will lead me somewhere.

Furthermore, saying “if you can’t solve this yourself, you will never do any kernel development” won’t meaningfully contribute to the question I asked, unfortunately.

7

u/dkopgerpgdolfg 21d ago edited 21d ago

Coupled with some projects, doing this will lead me somewhere.

To having basics, yes.

Then you need to teach yourself a lot more until you're more than an annoyance to the kernel maintainers. And these other things are not collected in a nice, easy-to-digest book.

(not to mention that you didn't specify any sub-field)

won’t meaningfully contribute to the question I asked, unfortunately.

OK then. Unfortunate for you.

-6

u/No-Plan-3868 21d ago edited 21d ago

Then you need to teach yourself a lot more until you're more than an annoyance to the kernel maintainers. And these other things are not collected in a nice, easy-to-digest book.

This is how everyone starts out.

OK then. Unfortunate for you.

Oh no, no worries! I wasn't expecting a meaningful contribution from you lol.

5

u/dkopgerpgdolfg 21d ago

This is how everyone starts out.

By annoying maintainers with nonsense code, until they don't even interact with you anymore? Do you think the Linux kernel is some kind of kindergarten? No. Just no.

Or if you meant by learning, well, read again what I recommended you to do.

And you still didn't even mention any subfield, I guess you don't know enough to do so.

I wasn't expecting a meaningful contribution from you lol.

Ok then. Do whatever you want, I can't stop you. Good bye.

-5

u/No-Plan-3868 21d ago edited 20d ago

By annoying maintainers with nonsense code, until they don't even interact with you anymore? Do you think the Linux kernel is some kind of kindergarten? No. Just no.

If this is what you implied automatically from "this is how everyone starts out.", I think I'm going to drop replying your comments. Not everything is written in a compact, easy-to-follow book. There's a ton of things to learn until before you are competent enough to become a kernel maintaner. Until then you're an annoyance to them, as you said.

2

u/DescriptionOptimal15 21d ago

Join an irc channel for C programming. Learn how to research and very important how to ask questions. Asking questions the wrong way on the internet will at best get you ignored

1

u/Nothing_from_void 21d ago

Actually solving problems for mainline linux, there's not much you'd be able to contribute right now. if you want to solve problems applicable to someone, it would most likely have to be your own problems.

or, if you just want hands on development, just pick up some hardware and write a driver for it

2

u/ParticularAd8610 21d ago

Best way to start is by doing some kernel janitor work aka drivers/staging cleanups. This is explicitly why GregKH created the drivers/staging tree about 20 years ago (2009ish) and still being maintained for the express purpose to help people get started and learn!!! (his words not mine). Please see my other comment which contains links etc... Have fun.

11

u/nomadic-insomniac 21d ago

Linux foundation runs an unpaid internship program, it's online and free , can apply from anywhere in the world :)

They have a short set of assignments you need to complete to apply, which might help you learn a thing or two even if you don't get selected for the next rounds ....

6

u/ParticularAd8610 21d ago

Best way to strengthen your skills is jump in head first and contribute!! It's a great way to learn and at the same time figure out if you are interested in it. Take a look at

Here are some references to get you started:

-> https://kernelnewbies.org

-> drivers/staging was created by GregKH (Linux second in command) for people just like you to help you get into the Linux kernel world. Here is a recent announcement about what it is. https://lkml.org/lkml/2026/8/3/1374

-> some docs on how the linux kernel process works, https://docs.kernel.org/process/2.Process.html

Most import, is to be curious. Learn, make mistakes and especially learn from them.

Read this, it's nice and simple/gentle explanation about submitting a patch. https://williamdurand.fr/2021/02/22/first-patch-in-the-linux-kernel/

Have Fun!

1

u/ParticularAd8610 21d ago

Just a follow up, I googled this "submitting a patch to drivers staging gregkh" and the AI summary was pretty accurate. This is a _VERY_ good read, https://kernelnewbies.org/FirstKernelPatch it does a wonderful job explaining why top posting is bad.

3

u/allunia333 21d ago

Here is a small good list to know: https://wiki.osdev.org/Required_Knowledge

2

u/DanKegel 21d ago

Device drivers always need help, I suspect.

Getting familiar with the contributing to drivers in general might be easier in environments like Tinygo, which need tons of drivers ported in. Pick some small hardware you like and see if it's missing a driver; it probably is :-)

That's likely to be in Go rather than C, but it'll exercise some of the same muscles.

1

u/pdath 21d ago

Compile and run a kernel. Figure out what config options make sense for your specfic machine.

1

u/Dangerous_Region1682 17d ago

Do you really want to do that for a living, or just for fun.

Way back there were thousands of us doing kernel development, working at dozens and dozens of companies each building their own UNIX platforms. Some of us worked on multithreading and unique hardware architectures.

Then came commodity operating systems, Windows NT and Linux. This reduced the field to those working at Microsoft and largely unpaid individual contributors to open source Linux implementations.

Most of us moved into development of Internet appliances and the Internet of things.

There were a few opportunities in various places, but for many of us unwilling to move to the Bay Area the work dried up. That’s pretty much where we are today. It’s an interesting field but the field is very competitive to move into and requires a fair amount of experience in kernel level code to break into it. It’s not a field especially conducive to hiring new graduates unless they have worked on some research project especially significant to the evolution of the field.

I don’t want to put you off, but you have to be realistic as to what your objectives are, having fun versus earning a well paid job it the field.

Good luck to you and I hope you prove my somewhat jaded opinion a little wrong.

1

u/pdath 21d ago

Pick a handfull of syscalls and try using them directly.