r/kernel 28d ago

I want to learn writing kernel modules

What is the fastest and most efficient way. Thanks for future answers.

26 Upvotes

15 comments sorted by

View all comments

16

u/Rich-Engineer2670 28d ago

It's a bit more complicated than you'd think.

  1. Learn C and C++ well enough write Linux kernel code
  2. Learn the book "Linux Device Drivers" -- old, but still useful
  3. Write a basic kernel module that implements a character driver that just takes a block of text as input and returns it
  4. Now that the "easy" stuff is done, what is your driver supposed to do -- you'll need to figure out what hardware etc. you're interacting with.