Hello World Module
Description
Simple kernel module that prints messages when loaded and unloaded.
Build
make
Test
# Load module
sudo insmod hello.ko
# Check dmesg
dmesg | tail -5
# Module info
modinfo hello.ko
# Unload
sudo rmmod hello
# Check dmesg again
dmesg | tail -5
Expected Output
[timestamp] Hello: Module loaded
[timestamp] Hello: Kernel version X.Y.Z
[timestamp] Hello: Module unloaded. Goodbye!
Troubleshooting
- Error: Operation not permitted: Use sudo
- Error: Module not found: Run from directory containing hello.ko
- Build fails: Install kernel headers