Dou*_* Su 6 linux-device-driver linux-kernel raspberry-pi
我重新编译了我的Raspberry Pi的Linux内核以启用一些调试功能.新内核是通过https://github.com/raspberrypi/tools提供的工具在我的X86台式机上编译的.新内核似乎工作正常,直到我编译我的hello-world驱动程序模块,并打印下面的信息:
make -C /lib/modules/3.18.10-d0u9/build M=/home/pi/Linux-Device-Driver-3.18/1_Hello-World modules
make[1]: Entering directory '/usr/src/linux-source-3.18'
CC [M] /home/pi/Linux-Device-Driver-3.18/1_Hello-World/main.o
./scripts/recordmcount: 1: ./scripts/recordmcount: Syntax error: "(" unexpected
scripts/Makefile.build:257: recipe for target '/home/pi/Linux-Device-Driver-3.18/1_Hello-World/main.o' failed
make[2]: *** [/home/pi/Linux-Device-Driver-3.18/1_Hello-World/main.o] Error 2
Makefile:1398: recipe for target '_module_/home/pi/Linux-Device-Driver-3.18/1_Hello-World' failed
make[1]: *** [_module_/home/pi/Linux-Device-Driver-3.18/1_Hello-World] Error 2
make[1]: Leaving directory '/usr/src/linux-source-3.18'
Makefile:19: recipe for target 'modules' failed
make: *** [modules] Error 2
Run Code Online (Sandbox Code Playgroud)
该hello-world模块非常简单,并且可以在我的X86 PC上正确编译.
我想也许我编译Linux内核的方式是错误的...
有没有人遇到这个问题?
顺便说一句,如何正确交叉编译内核for raspberry Pi进行驱动程序开发?
如果不知道有关重新编译的内核版本、操作系统版本等的更多细节,就很难确定到底发生了什么。
根据个人经验,安装Raspbian是一种在 pi 上运行的更宽容的方式。Debian 足够了,在它上面运行与大多数 Linux 环境有些相似。
Sparkfun 有一个关于安装 Raspbian 的很棒的指南,并且 Raspbian 网站有很多可用的文档,并且似乎是一个非常活跃的社区。抱歉,我无法提供更多帮助,但如果没有有关如何重新编译内核、启用了哪些调试功能等的更多详细信息,很难更具体地说明解决方案。
| 归档时间: |
|
| 查看次数: |
1033 次 |
| 最近记录: |