QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1474|回复: 8

open无法打开设备求助!

[复制链接]
发表于 2003-7-16 15:47:11 | 显示全部楼层 |阅读模式
将一i386下的PCI驱动移植到另一MIPS平台下(内核为2.4.1,经过一些修改,驱动终于编译通。在MIPS平台下用cat /proc/pci可以观察到该硬件设备信息,同时手工mknod加该设备为一字符设备,然后可以insmod正常加载。

但是在应用程序中无法用open打开该设备!

在该设备驱动中对应open操作的函数里面加printk,但用dmesg无法看到该打印,所以open对应操作实际上没有执行!

请教高手该如何修正?万分感谢!
 楼主| 发表于 2003-7-16 15:47:56 | 显示全部楼层
faint .kernel version: 2.4.18, no face please.
回复

使用道具 举报

发表于 2003-7-16 21:52:54 | 显示全部楼层
u open it as root ? is u file mode ok? can u check the error code of u open call?
回复

使用道具 举报

 楼主| 发表于 2003-7-17 08:33:48 | 显示全部楼层
Thanks for your reply. Actually the MIPS system is from ARCA (www.arca.com.cn) and is set to singleuser mode, and I have found where the bug lies: the so call gcc-compliance compiler have made great mistakes:

printk("<1>num_device=%d\n", num_device);/*num_device=0*/
num_device++;
printk("<1>num_device=%d\n", num_device);/*num_device=0*/

I hope I could find some alternative way to avoid the compiler to do so.
回复

使用道具 举报

发表于 2003-7-17 10:57:27 | 显示全部楼层
sooo stupid compiler? can u use gcc?
回复

使用道具 举报

 楼主| 发表于 2003-7-17 11:26:16 | 显示全部楼层
I am porting the device driver from x86 arch i386 to MIPS arch arca (domestic CPU), where ARCA provide a gcc-like compiler, but there are much bugs in the compiler, where much should be done to improve it. Poor ARCA environment! Poor me!
回复

使用道具 举报

发表于 2003-7-17 21:14:08 | 显示全部楼层
if that is mips, can u try to build a crosscompiler on x86 for mips?
回复

使用道具 举报

 楼主| 发表于 2003-7-18 08:40:56 | 显示全部楼层
They have their own MIPS compiler named arca2-xxx, you can see their web site for more information, but their compiler and linker are obvious of poor quality.
回复

使用道具 举报

发表于 2003-7-18 08:45:20 | 显示全部楼层
yes, i checked their site. what i mean is if it is a mips machine. can u try to build a cross compiler gcc for mips and use it?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-2 06:23 , Processed in 0.053290 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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