Add basic and chardev modules

This commit is contained in:
Florian RICHER 2025-02-08 17:01:11 +01:00
commit e3c9144b8a
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
10 changed files with 298 additions and 0 deletions

View file

@ -0,0 +1,31 @@
## Additionnal informations
To test character device, your need create the device.
Step 1: Get major number of your module device
```bash
cat /proc/devices | grep flodev
```
Step 2: Create device (as root)
```bash
mknod /dev/[wanted name] -c <major_number> 0
```
Exemple (as root):
```bash
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
```