记事本 发表于 2011-12-9 10:01:38

如何动态加载helloworld驱动模块

初学者必读参考文档

raominping 发表于 2011-12-9 10:12:26

谢谢楼主分享哦。。。。

记事本 发表于 2011-12-9 10:18:00

raominping 发表于 2011-12-9 10:12 static/image/common/back.gif
谢谢楼主分享哦。。。。

呵呵 自己写的 仅供参考 还请版主多多指教啊:)

TQ-lkp 发表于 2011-12-9 10:45:16

支持原创!{:3_62:}

zhukx2010 发表于 2011-12-9 16:58:09

谢谢分享,参考一下

wang5620079 发表于 2012-1-7 23:54:14

很好,学习了!

zhiyuan1986 发表于 2012-1-12 16:53:25

唉,我碰到头文件都找不到的问题。请问如何解决。
# cd ..
# cd opt/EmbedSky/linux-2.6.30.4/drivers/hellomode/
# make
make -C /opt/EmbedSky/linux-2.6.30.4 M=/opt/EmbedSky/linux-2.6.30.4/drivers/hell
omode modules ARCH=arm CROSS_COMPILE=arm-linux-
make: Entering directory `/opt/EmbedSky/linux-2.6.30.4'

WARNING: Symbol version dump /opt/EmbedSky/linux-2.6.30.4/Module.symvers
         is missing; modules will have no dependencies and modversions.

CC /opt/EmbedSky/linux-2.6.30.4/drivers/hellomode/hellomode.o
/opt/EmbedSky/linux-2.6.30.4/drivers/hellomode/hellomode.c:1:26: error: linux/mo
dule.h: No such file or directory
/opt/EmbedSky/linux-2.6.30.4/drivers/hellomode/hellomode.c:2:24: error: linux/in
it.h: No such file or directory
/opt/EmbedSky/linux-2.6.30.4/drivers/hellomode/hellomode.c:3: error: expected de
claration specifiers or '...' before string constant
/opt/EmbedSky/linux-2.6.30.4/drivers/hellomode/hellomode.c:3: warning: data defi
nition has no type or storage class
/opt/EmbedSky/linux-2.6.30.4/drivers/hellomode/hellomode.c:3: warning: type defa
ults to 'int' in declaration of 'MODULE_LICENSE'
/opt/EmbedSky/linux-2.6.30.4/drivers/hellomode/hellomode.c:3:

derek_tw721 发表于 2012-1-16 14:33:12

謝謝大大分享:funk:

神的诱惑 发表于 2012-2-25 16:33:41

下载来看看,楼主辛苦了。

亚瑟王 发表于 2012-2-27 12:05:28

7楼的亲,你的错误是因为内核没有编译引起的。

lingbing001 发表于 2012-3-2 15:35:45

本帖最后由 lingbing001 于 2012-3-2 17:18 编辑

亚瑟王 发表于 2012-2-27 12:05 http://bbs.embedsky.net/static/image/common/back.gif
7楼的亲,你的错误是因为内核没有编译引起的。

请问能帮我分析下我这个问题吗?
make -C /opt/EmbedSky/opt/EmbedSky/linux-2.6.30.4 M= /opt/EmbedSky/hellworld modules ARCH=arm
CROSS_COMPILE=arm-linux-
make:Entering directory '/opt/EmbedSky/opt/EmbedSky/linux-2.6.30.4'
Makefile:535: /opt/EmbedSky/opt/EmbedSky/linux-2.6.30.4/arch//Makefile:没有那个文件或目录
make:arm-linux-: gcc:Command not found
         B   Bmake :*** No rule to make target '/opt/EmbedSky/opt/EmbedSky/linux-2.6.30.4/arch//Makefile' .Stop.
make: Leaving directory '/opt/EmbedSky/opt/EmbedSky/linux-2.6.30.4'
make: ***Error 2

亚瑟王 发表于 2012-3-3 14:55:50

亲,你编译驱动的Makefile文件有问题,你把文件内容贴出来。

lingbing001 发表于 2012-3-7 15:09:10

亚瑟王 发表于 2012-3-3 14:55 static/image/common/back.gif
亲,你编译驱动的Makefile文件有问题,你把文件内容贴出来。

就是按照分享的文件写的,只不过把KDIR的路径改为我自己的内核路径了。

lingbing001 发表于 2012-3-7 15:10:26

亚瑟王 发表于 2012-2-27 12:05 static/image/common/back.gif
7楼的亲,你的错误是因为内核没有编译引起的。

能给您提供个建议吗?回答别人问题的时候可不可以选择回复,这样的话系统会提示有消息,不然的话都不知道问题有没有人回~:'(

亚瑟王 发表于 2012-3-8 19:00:47

lingbing001 发表于 2012-3-7 15:10 static/image/common/back.gif
能给您提供个建议吗?回答别人问题的时候可不可以选择回复,这样的话系统会提示有消息,不然的话都不知道 ...

亲,好的,这个之前没有想到。不好意思啊。
页: [1] 2
查看完整版本: 如何动态加载helloworld驱动模块