Johannes4Linux/Linux_Driver_Tutorial
소개
My new Tutorial how to get started with Linux Kernel Modules and Linux Drivers. Started in 2024
학습 및 교육측정된 스타 증가
- in 24h
- 0
- in 7 days
- +3
- in 15 days
- +5
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalLinux Driver Tutorial
Here you can find examples for simple Linux Kernel Modules and Linux Drivers.
Preparation
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.
Content
In this repo you can find examples for:
- Simple Hello World Kernel Module
- An improved Hello World Linux Kernel Module
- An example for using GPIOs in a driver without device tree
- Some info about Device Files, Device Numbers, Block and Character Devices
- Create a Character Device in a Driver
- Linux Kernel log levels
- Implement open and release functions for character devices
- Implement read and write functions for character devices
- Create a Character Device in a Driver manually
- Automatically create a Device File within the driver
- Dynamical memory allocation and private data in the
struct file - First introduction to
ioctl - Implementing
ioctlproperly - The device tree
- Adding a device over the device tree
- A Device Tree Device Driver
- Parsing parameters of a Device Tree Device Driver
- Writing to the kernel's log with device information
- Using GPIOs in a Device Tree Device Driver
- Allocating and using device data
- Miscellaneous devices for easy device files
- Adding a misc device to the platform device driver
- Using GPIO interrupts in a platform device driver
- Accessing memory mapped IO from a platform device driver
- Using a chip internal IRQ in a platform device driver
- sysfs device attributes as an interface between driver and userspace
More Information
For more information about my Linux Driver examples check out my videos and my playlist
Support me
If you want to support me, you can buy me a coffee buymeacoffee.com/johannes4linux.
관련 프로젝트 살펴보기
불러오는 중…