This commit is contained in:
2026-06-19 07:46:17 -05:00
parent ffd3eab72d
commit dd811684dc
10 changed files with 803 additions and 43 deletions

31
pcie_driver/Makefile Executable file
View File

@@ -0,0 +1,31 @@
BINARY := drexpcie_module
KERNEL := /lib/modules/$(shell uname -r)/build
ARCH := x86
C_FLAGS := -Wall
KMOD_DIR := $(shell pwd)
TARGET_PATH := /lib/modules/$(shell uname -r)/kernel/drivers/char
OBJECTS := \
drexpcie.o \
drexdma.o \
drexchar.o \
ccflags-y += $(C_FLAGS)
obj-m += $(BINARY).o
$(BINARY)-y := $(OBJECTS)
$(BINARY).ko:
make -C $(KERNEL) M=$(KMOD_DIR) modules
install:
cp $(BINARY).ko $(TARGET_PATH)
depmod -a
uninstall:
rm $(TARGET_PATH)/$(BINARY).ko
depmod -a
clean:
make -C $(KERNEL) M=$(KMOD_DIR) clean