June 2017
Intermediate to advanced
478 pages
13h 14m
English
At this point, you have some driver code that you want to compile and test on your target system. You can copy it into the kernel source tree and modify makefiles to build it, or you can compile it as a module out of tree. Let's start by building out of tree.
You need a simple makefile which uses the kernel build system to do the hard work:
LINUXDIR := $(HOME)/MELP/build/linux obj-m := dummy.o all: make ARCH=arm CROSS_COMPILE=arm-cortex_a8-linux-gnueabihf- \ -C $(LINUXDIR) M=$(shell pwd) clean: make -C $(LINUXDIR) M=$(shell pwd) clean
Set LINUXDIR to the directory of the kernel for your target device that you will be running the module on. The obj-m := dummy.o code will invoke the kernel build rule to take the ...
Read now
Unlock full access