kernel_module_learn/03_character_device
2025-02-23 13:14:54 +01:00
..
Makefile Reorder and add module params example 2025-02-18 17:06:38 +01:00
README.md Reorder and add module params example 2025-02-18 17:06:38 +01:00
test_module.c Change spaces to tabs 2025-02-23 13:14:54 +01:00

Additionnal informations

To test character device, your need create the device.

Step 1: Get major number of your module device

cat /proc/devices | grep flodev

Step 2: Create device (as root)

mknod /dev/[wanted name] -c <major_number> 0

Exemple (as root):

cat /proc/devices | grep flodev # => 236 flodev
mknod /dev/flodev0 c 236 0
echo "Salut" >> /dev/flodev0
dmesg | tail # =>
#   flodev - Ouverture du périphérique
#   flodev - Message reçu: Salut
#   flodev - Fermeture du périphérique
rm /dev/flodev0