sketch uio

This commit is contained in:
Ciro Santilli
2017-08-05 12:32:24 +01:00
parent 1f4f7faeba
commit 83411a0597
7 changed files with 84 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
insmod /character_device.ko
/mknoddev.sh character_device
/mknoddev.sh lkmc_character_device
cat /dev/lkmc_character_device
# => abcd
rm /dev/lkmc_character_device

View File

@@ -1,4 +1,4 @@
#!/bin/sh
dev="lkmc_$1"
dev="$1"
major="$(grep "$dev" /proc/devices | cut -d ' ' -f 1)"
mknod "/dev/$dev" c "$major" 0

View File

@@ -11,7 +11,7 @@ cat /proc/interrupts
# Setup.
insmod /pci.ko
/mknoddev.sh pci
/mknoddev.sh lkmc_pci
# Shows that this module owns the PCI device.
lspci -k