|
我的设备叫asdf是网上的一个例子, 我编译了挂上去之后,写了一个test.c的程序来与他通讯,可是却怎么也打不开这个设备,请问是怎么回事? 谢谢了!
[root@localhost asdf]# insmod asdf.o
insmod: a module named asdf already exists
[root@localhost asdf]# lsmod
Module Size Used by Not tainted
nls_iso8859-1 3484 1 (autoclean)
udf 97504 0 (autoclean)
ide-cd 35196 1 (autoclean)
cdrom 33472 0 (autoclean) [ide-cd]
asdf 6180 0 (unused)
parport_pc 18756 1 (autoclean)
lp 8868 0 (autoclean)
parport 36480 1 (autoclean) [parport_pc lp]
iptable_filter 2380 0 (autoclean) (unused)
ip_tables 14648 1 [iptable_filter]
autofs 12948 0 (autoclean) (unused)
ne2k-pci 7136 1
8390 8380 0 [ne2k-pci]
nls_cp936 124956 6 (autoclean)
vfat 12844 3 (autoclean)
fat 38328 0 (autoclean) [vfat]
keybdev 2880 0 (unused)
mousedev 5428 1
hid 21700 0 (unused)
input 5792 0 [keybdev mousedev hid]
usb-uhci 25868 0 (unused)
usbcore 77696 1 [hid usb-uhci]
ext3 69984 1
jbd 51220 1 [ext3]
[root@localhost asdf]# mknod /dev/asdf c 254 0
mknod: ‘/dev/asdf’: 文件已存在
[root@localhost asdf]# ./test
asdf_fd=-1
open device asdf Faile!
[root@localhost asdf]# cat /dev/asdf
cat: /dev/asdf: 没有那个设备
[root@localhost asdf]# ls -l /dev/asdf
crw-rw-rw- 1 root root 245, 0 10月 28 11:17 /dev/asdf
[root@localhost asdf]# cat /dev/asdf
cat: /dev/asdf: 没有那个设备
[root@localhost asdf]# cp /dev/asdf image
cp: 无法打开 ‘/dev/asdf’ 来读取数据: 没有那个设备
[root@localhost asdf]# cp asdf image
cp: stat‘asdf’失败: 没有那个文件或目录
[root@localhost asdf]# cd /dev
[root@localhost dev]# ls -l asdf
crw-rw-rw- 1 root root 245, 0 10月 28 11:17 asdf
[root@localhost dev]# cp asdf image
cp: 无法打开 ‘asdf’ 来读取数据: 没有那个设备
[root@localhost dev]# |
|