构建内核模块为Android [英] Building kernel module for Android
问题描述
我需要将FTDI USB模块添加到Android内核(安卓2.3.1,Linux的2.6.32),所以我得到了2.6.32内核,并试图构建模块:
I need to add the FTDI USB module to the Android kernel (Android 2.3.1, Linux 2.6.32), so I got the 2.6.32 kernel and tried to build the module:
make modules ARCH=arm CROSS_COMPILE=arm-none-eabi-
但是,当我试图做insmod的ftdi_sio.ko,该错误信息是
But when I tried to do 'insmod ftdi_sio.ko', the error message was
insmod: init_module 'ftdi_sio.ko' failed (Exec format error)
在dmesg的输出,我发现这个
In dmesg's output I found this
ftdi_sio: version magic '2.6.32.27 preempt mod_unload ARMv5 ' should be '2.6.32.27 preempt mod_unload ARMv7 '
我想加上'的ARMv7-A标记(如我读的Android NDK的文档)
I tried to add 'armv7-a' flag (as I read in Android NDK docs)
make modules ARCH=arm CROSS_COMPILE=arm-linux-androideabi- CFLAGS='-march=armv7-a -mfloat-abi=softfp'
另外,我想下面的交叉编译器ARM-NONE-eabi-,臂eabi-,手臂-Linux的Android的EABI -
Also, I tried following cross-compilers: arm-none-eabi-, arm-eabi-, arm-linux-android-eabi-
每一次的结果是一样的 - 在的ARMv5版本的魔力。 如何建立模块对ARMv7?
Every time result was the same - ARMv5 in the version magic. How can I build the module for ARMv7?
推荐答案
尝试建立 CONFIG_CPU_V7 = Y
在内核的.config
文件
这篇关于构建内核模块为Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!