1. Install compile environment
#sudo apt-get install build-essential
2. Install kernel header
#sudo apt-get install linux-headers-$(uname -r)
3. Write a kernel module and compile and run it
make -C /usr/src/linux-headers-$(uname -r) M=$(pwd) modules