insight 发表于 2003-7-16 15:47:11

open无法打开设备求助!

将一i386下的PCI驱动移植到另一MIPS平台下(内核为2.4.18),经过一些修改,驱动终于编译通。在MIPS平台下用cat /proc/pci可以观察到该硬件设备信息,同时手工mknod加该设备为一字符设备,然后可以insmod正常加载。

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

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

请教高手该如何修正?万分感谢!

insight 发表于 2003-7-16 15:47:56

faint .kernel version: 2.4.18, no face please.

Dragonfly 发表于 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?

insight 发表于 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.

Dragonfly 发表于 2003-7-17 10:57:27

sooo stupid compiler? can u use gcc?

insight 发表于 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!

Dragonfly 发表于 2003-7-17 21:14:08

if that is mips, can u try to build a crosscompiler on x86 for mips?

insight 发表于 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.

Dragonfly 发表于 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?
页: [1]
查看完整版本: open无法打开设备求助!