A simple .c
file that can be compiled to a kernel module
without any header files.
Read more at A Standalone Linux Kernel Module.
gcc -c -o standalone.ko standalone.c
insmod standalone.ko
lsmod | grep 'standalone'
dmesg
Designed to run on Ubuntu 18.04. For different kernels, adjust the required values accordingly.