2018-05-15 10:50:52 +00:00
|
|
|
obj-m += kvmfr.o
|
2018-05-21 11:56:23 +00:00
|
|
|
USER := $(shell whoami)
|
2019-06-04 23:08:00 +00:00
|
|
|
KVER ?= $(shell uname -r)
|
|
|
|
KDIR ?= /lib/modules/$(KVER)/build
|
2018-05-15 10:50:52 +00:00
|
|
|
|
2020-01-29 03:01:52 +00:00
|
|
|
all:
|
2019-06-04 23:08:00 +00:00
|
|
|
make -C $(KDIR) M=$(PWD) modules
|
2018-05-15 10:50:52 +00:00
|
|
|
|
|
|
|
clean:
|
2019-06-04 23:08:00 +00:00
|
|
|
make -C $(KDIR) M=$(PWD) clean
|
2018-05-21 11:56:23 +00:00
|
|
|
|
2020-01-13 02:39:24 +00:00
|
|
|
test:
|
|
|
|
gcc test.c -Wall -Werror -g -Og -o test
|
|
|
|
|
|
|
|
load: all
|
2018-05-21 11:56:23 +00:00
|
|
|
grep -q '^uio' /proc/modules || sudo modprobe uio
|
|
|
|
grep -q '^kvmfr' /proc/modules && sudo rmmod kvmfr || true
|
|
|
|
sudo insmod ./kvmfr.ko
|
|
|
|
sudo chown $(USER) /dev/uio0
|
2020-01-13 02:39:24 +00:00
|
|
|
sudo chown $(USER) /dev/kvmfr0
|
|
|
|
|
|
|
|
.PHONY: test
|