Here you can find examples for simple Linux Kernel Modules and Linux Drivers.
I used a Raspberry Pi 3 to develop and test my modules and drivers. To compile them, you need to install the Kernel headers on your Pi. On Raspberry Pi OS you can do this with the following command:
sudo apt update && sudo apt upgrade -y
sudo apt install raspberrypi-kernel-headers
reboot
Raspberry Pi OS is only installs the latest kernel headers. So, make sure, you are running the latest kernel.
You also need the build utils (make, gcc, ...) but they come preinstalled on Raspberry Pi OS.
In this repo you can find examples for:
- Simple Kernel Module
For more information about my Linux Driver examples check out my videos and my playlist
If you want to support me, you can buy me a coffee buymeacoffee.com/johannes4linux.