Hi,
I have a board reference to imx6q-sabresd using android_M6.0.1_2.0.0_source.tar.gz.
I am trying to port device drivers on this board.
makefile:
obj-m := sema.o
KDIR := /work/myandroid/kernel_imx/
PWD := $(shell pwd)
all:
make -C $(KDIR) ARCH=arm CROSS_COMPILE=arm-linux-androideabi- M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
when insmod sema.ko:
root@sabresd_6dq:/data/local/tmp # insmod sema.ko
insmod: failed to load sema.ko: Exec format error
Hello Jia,
The question is on how to compile linux kernel module and write Makefile, Actually, it is not within our support range. Only give you some advice, help you correct your Makefile, see below, please!
---------------------------------------------Pay attention to correct path of your compiler----------------------------
obj-m := sema.o
sema-objs := sema.o
KDIR := /work/myandroid/kernel_imx/
PWD := $(shell pwd)
ARCH=arm
CROSS_COMPILE=arm-eabi-
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
all:
make -C $(KDIR) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
--------------------------------------------------------------------------------------------------------------------------------------------
Try it , please!
Regards,
Weidong