免费注册 查看新帖 |

Chinaunix

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

linux设备驱动程序的hello_world编译出现问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-10-18 19:53 |只看该作者 |倒序浏览
是哦那个make编译后出现问题了
谢谢大家帮忙了啊

[yangww_cs@localhost driver]$ make
make: Warning: File `Makefile' has modification time 3.5e+02 s in the future
make -C /lib/modules/2.6.9-67.ELsmp/build M=/mnt/hgfs/Linux/driver  modules
make[1]: Entering directory `/usr/src/kernels/2.6.9-67.EL-smp-i686'
make[2]: Warning: File `/mnt/hgfs/Linux/driver/Makefile' has modification time 3.5e+02 s in the future
  CC [M]  /mnt/hgfs/Linux/driver/hello.o
/mnt/hgfs/Linux/driver/hello.c:16:25: warning: no newline at end of file
make[2]: 警告:检测到时钟错误。您的创建可能是不完整的。
  Building modules, stage 2.
  MODPOST
  CC      /mnt/hgfs/Linux/driver/hello.mod.o
  LD [M]  /mnt/hgfs/Linux/driver/hello.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.9-67.EL-smp-i686'
make: 警告:检测到时钟错误。您的创建可能是不完整的。
[yangww_cs@localhost driver]$

论坛徽章:
0
2 [报告]
发表于 2010-10-18 20:00 |只看该作者
[yangww_cs@localhost driver]$ make
make -C /lib/modules/2.6.9-67.ELsmp/build M=/mnt/hgfs/Linux/driver  modules
make[1]: Entering directory `/usr/src/kernels/2.6.9-67.EL-smp-i686'
make[2]: Warning: File `/mnt/hgfs/Linux/driver/hello.c' has modification time 1e+03 s in the future
  CC [M]  /mnt/hgfs/Linux/driver/hello.o
make[2]: 警告:检测到时钟错误。您的创建可能是不完整的。
  Building modules, stage 2.
  MODPOST
  LD [M]  /mnt/hgfs/Linux/driver/hello.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.9-67.EL-smp-i686'
[yangww_cs@localhost driver]$ ls
hello.c  hello.ko  hello.mod.c  hello.mod.o  hello.o  Makefile
[yangww_cs@localhost driver]$

论坛徽章:
0
3 [报告]
发表于 2010-10-18 20:00 |只看该作者
无心水贴啊~
大家有什么不错的linux驱动开发QQ群啊
我才开始学习
问题有点多
麻烦大家了啊~

论坛徽章:
0
4 [报告]
发表于 2010-10-18 21:23 |只看该作者
你把每个文件打开随便找个空的地方回车保存在make就可以了。

论坛徽章:
0
5 [报告]
发表于 2010-10-19 21:18 |只看该作者
回复 4# dingcai


    不好意思啊!
我一般都晚上上网的~
请问就是编译生成的文件么??

论坛徽章:
0
6 [报告]
发表于 2010-10-19 22:33 |只看该作者
回复 5# zoe_cs


    不是编译生成的文件, 是源码文件,即.c和.h的文件

论坛徽章:
0
7 [报告]
发表于 2010-10-22 19:13 |只看该作者
回复 6# dingcai


    不好意思啊!不行啊~我在.c后面都回车了
   但是还是不行
但是[root@localhost driver]# /sbin/insmod ./hello.ko
可以
就是没有打印东西
[root@localhost driver]# /sbin/rmmod ./hello.ko
也很正常

论坛徽章:
0
8 [报告]
发表于 2010-10-23 14:23 |只看该作者
我的也是,insmod hello.ko没问题,就是不输出

论坛徽章:
0
9 [报告]
发表于 2010-10-24 21:51 |只看该作者
在终端上显示不出来,可以使用dmesg看看。
这个决定于你使用printk中使用的宏。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP