Writing Your First Kernel Module
So we've already built the kernel from source and even modified the source code. While these were some pretty cool parlor tricks, isn't it about time we learned something useful?
Well, I can't promise that, but today we'll take a step in the right direction by building a Linux kernel module.
The Linux kernel is structured so that you can add extended functionality without modifying the core source. These added modules can be linked in as the source is compiled or added dynamically. The one we write today will be inserted dynamically, adding itself and running without a system reboot.
While writing a kernel module is definitely safer than modifying the source, it can still mess up your system a lot more than a user space application, so proceed with caution.