open无法打开设备求助!
将一i386下的PCI驱动移植到另一MIPS平台下(内核为2.4.18),经过一些修改,驱动终于编译通。在MIPS平台下用cat /proc/pci可以观察到该硬件设备信息,同时手工mknod加该设备为一字符设备,然后可以insmod正常加载。但是在应用程序中无法用open打开该设备!
在该设备驱动中对应open操作的函数里面加printk,但用dmesg无法看到该打印,所以open对应操作实际上没有执行!
请教高手该如何修正?万分感谢! faint .kernel version: 2.4.18, no face please. u open it as root ? is u file mode ok? can u check the error code of u open call? 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. sooo stupid compiler? can u use gcc? 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! if that is mips, can u try to build a crosscompiler on x86 for mips? 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. 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]