Yes, it is possible. Exec Format Error: it seems that your module is
not built using the headers of your goldfish kernel. Try this simple
makefile when building your new driver (assuming hello.c as source):
obj-m := hello.o
CROSS_COMPILE=arm-eabi-
KERNEL_DIR ?= ~/goldfish/kernel/
all:
$(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$
(CROSS_COMPILE) modules
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
modules.order Module.symvers Module.markers
You need to take note that you need to export first CROSS_COMPILE
variable to your current shell. (i.e. #export CROSS_COMPILE=~/<your-
android-dir>/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you
issue the command #make. I think this will resolve the Exec Format
Error problem.
As for the 'operation not permitted' problem in #insmod, it seems that
the "Loadable Module Support" in your goldfish's kernel config is
still not enabled. You can try this:
<goldfish-kernel># ARCH=arm make goldfish_defconfig
<goldfish-kernel># ARCH=arm make menuconfig
[*] Enable loadable module support ---> (make sure to have this one)
<goldfish-kernel># ARCH=arm ARCH=arm CROSS_COMPILE=arm-eabi- make
Your final kernel will be arch/arm/boot/zImage. After booting emulator
using that kernel, you can now do your #insmod in emulator shell.
Hope that helps.