免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1894 | 回复: 5
打印 上一主题 下一主题

hello world 驱动问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-10-12 18:48 |只看该作者 |倒序浏览
hello world 驱动问题 我运行helloword,出现下例情况:
[root@localhost hello_world]# make -C /usr/src/Linux-2.6.22.5/"  M=$PWD modules
make: Entering directory /usr/src/Linux-2.6.22.5/
  CC [M]  /root/work/hello_world/hello.o

  Building modules, stage 2.
  MODPOST
  CC      /root/work/hello_world/hello.mod.o
  LD [M]  /root/work/hello_world/hello.ko
make: Leaving directory /usr/src/Linux-2.6.22.5/
[root@localhost hello_world]# insmod ./hello.ko
./hello.ko: ELF file ./hello.ko not for this architecture
[root@localhost hello_world]#

请帮我分析下,insmod出现的问题,我的是redhat9.0

论坛徽章:
0
2 [报告]
发表于 2009-10-12 23:21 |只看该作者
得用交叉编译链。
明显你使用pc上的gcc编译的程序,要放在板子上运行,体系结构不一样。

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
3 [报告]
发表于 2009-10-13 11:53 |只看该作者
mak -C 后面使用的路径最好用 /lib/modules/`uname -r`/build

论坛徽章:
0
4 [报告]
发表于 2009-10-14 15:18 |只看该作者
原帖由 emmoblin 于 2009-10-12 23:21 发表
得用交叉编译链。
明显你使用pc上的gcc编译的程序,要放在板子上运行,体系结构不一样。

同意

论坛徽章:
0
5 [报告]
发表于 2009-10-14 17:09 |只看该作者
right

论坛徽章:
3
金牛座
日期:2014-06-14 22:04:062015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:49:45
6 [报告]
发表于 2009-10-14 23:00 |只看该作者

回复 #1 gogLinux 的帖子

有可能是内核版本差异
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP