简体   繁体   English

交叉编译raspberry pi内核模块

[英]cross compile raspberry pi kernel module

So I have been trying to learn more about developing linux drivers with Linux Device Drivers version 3. Using a spare Rasberry Pi (b) I had kicking around. 因此,我一直在尝试了解有关使用Linux设备驱动程序版本3开发Linux驱动程序的更多信息。使用备用Rasberry Pi(b)我已经开始了。

I used http://www.raspberrypi.org/documentation/linux/kernel/building.md to build the the kernel in my ~/kernelWork/kernel folder. 我使用http://www.raspberrypi.org/documentation/linux/kernel/building.md在〜/ kernelWork / kernel文件夹中构建内核。 I have also compiled the kernel and have it running on my raspberry pi to avoid compatibility issues. 我还编译了内核并让它在我的raspberry pi上运行以避免兼容性问题。

The issue I have is I know I need to cross compile the module source to work with the ARM architecture, but I'm not sure where to point the -C flag of the command 我遇到的问题是我知道我需要交叉编译模块源以使用ARM体系结构,但我不知道在哪里指向命令的-C标志

make -C ~/kernel-2.6 M=`pwd` modules

command to make my module with. 命令使我的模块。 I took a look into my arch folder of my kernel, and looked in the ARM directory included there, but from there I'm not sure where to go. 我查看了我的内核的arch文件夹,并查看了包含在那里的ARM目录,但从那里我不知道该去哪里。

So in short, after I have built my kernel where do I point the -C flag to cross compile my module. 所以简而言之,在我构建了内核之后,我指向-C标志以交叉编译我的模块。

I had to set my Makefile to cross compile with the settings 我必须将我的Makefile设置为与设置交叉编译

all:
    make ARCH=arm CROSS_COMPILE=${CCPREFIX} -C /home/jacob/kernelWork/kernel M=$(PWD) modules


clean:
    make -C /home/jacob/kernelWork/kernel M=$(PWD) clean

As well as setting my environment variables KERNEL_SRC and CCPREFIX to my kernel source, and the raspberry compiler I pulled from the git source. 除了将我的环境变量KERNEL_SRC和CCPREFIX设置为我的内核源代码,以及我从git源代码中提取的覆盆子编译器。 This page has the full details 此页面包含完整的详细信息

http://bchavez.bitarmory.com/archive/2013/01/16/compiling-kernel-modules-for-raspberry-pi.aspx http://bchavez.bitarmory.com/archive/2013/01/16/compiling-kernel-modules-for-raspberry-pi.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM