-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 672 Bytes
/
Makefile
File metadata and controls
36 lines (29 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
obj-m += chardev.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
creation_test:
sudo dmesg -C
sudo insmod chardev.ko
dmesg
sudo dmesg -C
sudo rmmod chardev.ko
dmesg
full_test:
sudo dmesg -C
sudo insmod chardev.ko
sudo mknod /dev/char_dev1 c 239 0
sudo chmod 777 /dev/char_dev1
sudo mknod /dev/char_dev2 c 239 1
sudo chmod 777 /dev/char_dev2
echo "ABOBA1" > /dev/char_dev1
cat /dev/char_dev1
cat /dev/char_dev2
echo "ABOBA2" > /dev/char_dev2
cat /dev/char_dev1
cat /dev/char_dev2
sudo rm /dev/char_dev1
sudo rm /dev/char_dev2
sudo rmmod chardev.ko
dmesg