天嵌 ARM开发社区

 找回密码
 注册
查看: 2397|回复: 13

step22编写第一个驱动程序遇到了问题

[复制链接]
小胖子 发表于 2010-7-24 22:32:19 | 显示全部楼层 |阅读模式
我在step22编写第一个驱动程序遇到了问题。
把EmbedSky_hello.c文件按照教材编写好之后,又配置好了内核,执行指令:
make SUBDIR=drivers/char/ modules
以下弹出编译信息:
scripts/kconfig/conf -s arch/arm/Kconfig
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CALL    scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
  GZIP    kernel/config_data.gz
  IKCFG   kernel/config_data.h
  CC [M]  kernel/configs.o
  CC [M]  drivers/char/EmbedSky_hello.o
drivers/char/EmbedSky_hello.c:12:32: error: asm/arch/regs-gpio.h: No such file or directory
[root@localhost linux-2.6.30.4]# clear
[root@localhost linux-2.6.30.4]# ky_hello.o] Error 1
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2

说是头文件sm/arch/regs-gpio.h等等找不到,请问我得怎么做,才能编译成功,产生.ko文件呢?
guoyin 发表于 2010-7-25 14:32:11 | 显示全部楼层
内核改了regs-gpio.h目录,你要找对路径就可以了!
改为<mach/regs-gpio.h>试试
 楼主| 小胖子 发表于 2010-7-25 21:15:07 | 显示全部楼层
2# guoyin
没有你说的那个目录!下面是截图,请你仔细按照教材做一遍再来回答,好么?下面是内核的截图。
亚瑟王 发表于 2010-8-2 18:57:44 | 显示全部楼层
没有看到截图,不过2楼的回答是正确的。
 楼主| 小胖子 发表于 2010-8-4 09:10:56 | 显示全部楼层
4# 亚瑟王
我找到mach的路径了,它不在include文件夹里面,这说明系统会自动在内核源码里面找mach目录,对么,亚瑟王?
亚瑟王 发表于 2010-8-4 23:19:49 | 显示全部楼层
mach目录是在include目录下的。
feixue2588 发表于 2010-9-10 17:07:20 | 显示全部楼层
mark一下
长长长长。。
 楼主| 小胖子 发表于 2010-9-20 15:51:10 | 显示全部楼层
6# 亚瑟王
亚瑟王你好,<mach/regs-gpio.h>这个头文件我找不到具体目录了,请你给出我具体的目录,不要只是说在include里面,我找了,没找到。请你一步步的给我具体的路径,谢谢啦!
天嵌_support1 发表于 2010-9-20 16:16:52 | 显示全部楼层
8# 小胖子


linux-2.6.30.4/arch/arm/mach-s3c2410/include/mach/regs-gpio.h

这个够清楚么?
 楼主| 小胖子 发表于 2010-9-22 13:56:19 | 显示全部楼层
9# embedsky_lxt
我知道是这个路径,你只告诉了我结果是这样。我想知道系统是根据什么查找到这个头文件的呢?
 楼主| 小胖子 发表于 2010-9-22 13:57:51 | 显示全部楼层
6# 亚瑟王
我知道是这个路径linux-2.6.30.4/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
,我想知道系统是根据什么查找到这个头文件的呢?
天嵌_support1 发表于 2010-9-24 22:46:40 | 显示全部楼层
11# 小胖子


这些是在Makefile 里面定义的...
楼主有时间去研究一样Makefile吧
konizhang 发表于 2011-11-22 19:32:14 | 显示全部楼层
arch/arm/Makefile的第181~185进行了定义
181 ifeq ($(KBUILD_SRC),)
182 KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
183 else
184 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
185 endif
亚瑟王 发表于 2011-11-28 15:50:41 | 显示全部楼层
正解。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-7-5 05:02 , Processed in 1.046875 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表