mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 12:34:26 +01:00
move all our stuff into /lkmc in guest
Motivation: userland is getting several new subdirectories, it would be too insane to just dump all of that in the guest root filesystem. To alleviate the cd pain, .profile puts user inside /lkmc by default.
This commit is contained in:
17
rootfs_overlay/lkmc/uio_read.sh
Executable file
17
rootfs_overlay/lkmc/uio_read.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
# https://github.com/cirosantilli/linux-kernel-module-cheat#uio
|
||||
set -e
|
||||
modprobe uio_pci_generic
|
||||
# pci_min device
|
||||
echo '1234 11e9' > /sys/bus/pci/drivers/uio_pci_generic/new_id
|
||||
./uio_read.out &
|
||||
# Helper to observe interrupts.
|
||||
insmod irq.ko
|
||||
base="$(setpci -d 1234:11e9 BASE_ADDRESS_0)"
|
||||
# Start generating interrupt.
|
||||
devmem "0x${base}" w 0x12345678
|
||||
# Stop generating interrupt.
|
||||
devmem "0x$(($base + 4))" w 0x12345678
|
||||
devmem "0x${base}" w 0x12345678
|
||||
devmem "0x$(($base + 4))" w 0x12345678
|
||||
modprobe -r uio_pci_generic
|
||||
Reference in New Issue
Block a user