![]() |
Exploring BeagleBone: LKMs (by Derek Molloy)
V1.0
This project describes how you can build loadable kernel modules (LKMs) on your BeagleBone platform
|
▼ button | |
button.c | A kernel module for controlling a button (or any signal) that is connected to a GPIO. It has full support for interrupts and for sysfs entries so that an interface can be created to the button or the button can be configured from Linux userspace. The sysfs entry appears at /sys/ebb/gpio115 |
▼ ebbchar | |
ebbchar.c | An introductory character driver to support the second article of my series on Linux loadable kernel module (LKM) development. This module maps to /dev/ebbchar and comes with a helper C program that can be run in Linux user space to communicate with this the LKM |
testebbchar.c | A Linux user space program that communicates with the ebbchar.c LKM. It passes a string to the LKM and reads the response from the LKM. For this example to work the device must be called /dev/ebbchar |
▼ ebbcharmutex | |
ebbcharmutex.c | An introductory character driver to support the second article of my series on Linux loadable kernel module (LKM) development. This module maps to /dev/ebbchar and comes with a helper C program that can be run in Linux user space to communicate with this the LKM. This version has mutex locks to deal with synchronization problems |
testebbcharmutex.c | A Linux user space program that communicates with the ebbchar.c LKM. It passes a string to the LKM and reads the response from the LKM. For this example to work the device must be called /dev/ebbchar |
▼ gpio_test | |
gpio_test.c | A kernel module for controlling a GPIO LED/button pair. The device mounts devices via sysfs /sys/class/gpio/gpio115 and gpio49. Therefore, this test LKM circuit assumes that an LED is attached to GPIO 49 which is on P9_23 and the button is attached to GPIO 115 on P9_27. There is no requirement for a custom overlay, as the pins are in their default mux mode states |
▼ hello | |
hello.c | An introductory "Hello World!" loadable kernel module (LKM) that can display a message in the /var/log/kern.log file when the module is loaded and removed. The module can accept an argument when it is loaded – the name, which appears in the kernel log files |
▼ led | |
led.c | A kernel module for controlling a simple LED (or any signal) that is connected to a GPIO. It is threaded in order that it can flash the LED. The sysfs entry appears at /sys/ebb/led49 |