A kernel module is practically a driver that can be loaded/unloaded in the kernel on demand.
jvns wrote a kernel module that prints hello world to the kernel log each time a packet is processed by the kernel.
Some good starting points:
I should probably make a linux VM (in kvm) for kernel module development.