@xiaowen
是自己写了个ko吗?是不是需要自己写Makefile才能编译?
我自己写ko的Makefile如下,不知道有没有帮助
obj-m += xxx.o
CURRENT_PATH:=$(shell pwd)
LINUX_KERNEL:=$(shell uname -r)
KVERSION:=5.4
KDIR=/home/allwinner/tina-d1-h/out/d1-h-nezha/compile_dir/target/linux-d1-h-nezha/linux-5.4.61
#complie object
CC=riscv64-unknown-linux-gnu-gcc
all:
make -C $(KDIR) M=$(PWD) modules CROSS_COMPILE=riscv64-unknown-linux-gnu- ARCH=riscv
#clean
clean:
make -C $(KDIR) M=$(CURRENT_PATH) clean