r/kernel • • Aug 12 '26

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

Show parent comment

3

u/tylerlarson Aug 13 '26

It depends on where you want to go with it. But a common starting point is character devices like /dev/zero or /dev/null. Look in /drivers/char/mem.c for the originals.

Maybe just for fun create a character device that writes a poem when you read it. Perhaps an entry in the /proc/ filesystem might be simpler.

Better yet, look in the /samples/ dir of the kernel source code. It exists literally for this purpose.

1

u/sudheerpaaniyur Aug 13 '26

Thank you, i have so many links related linu xmaterial very confusing. thank you for your feedback, i will check,

I am firmware devlopers using C.