This is about as simple as it gets.
To use:
make
insmod example.ko
dmesg
lsmod | grep example
rmmod example.ko
dmesg
Alternatively:
make test
and observe the two outputs as the module is loaded/unloaded.NOTE: You'll need
build-essential
andlinux-headers-$(uname -r)
installed.