driver-know-hows

device driver related stuff

View on GitHub

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