构建内核模块为Android [英] Building kernel module for Android

查看:192
本文介绍了构建内核模块为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标记(如我读的Andr​​oid 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的Andr​​oid的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆