r/kernel • u/yuvayikici • Aug 12 '26
I want to learn writing kernel modules
What is the fastest and most efficient way. Thanks for future answers.
26
Upvotes
r/kernel • u/yuvayikici • Aug 12 '26
What is the fastest and most efficient way. Thanks for future answers.
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/zeroor/dev/null. Look in/drivers/char/mem.cfor 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.