|
|

楼主 |
发表于 2006-1-13 16:45:41
|
显示全部楼层
是的,编程用write(fd,buf,size);写……
我看了驱动程序,应该是在这里报错的。
int ide_wait_stat (ide_startstop_t *startstop, ide_drive_t *drive, byte good, byte bad, unsigned long timeout) {
byte stat;
int i;
unsigned long flags;
/* bail early if we've exceeded max_failures */
if (drive->max_failures && (drive->failures > drive->max_failures)) {
*startstop = ide_stopped;
return 1;
}
udelay(1); /* spec allows drive 400ns to assert "BUSY" */
if ((stat = GET_STAT()) & BUSY_STAT) {
__save_flags(flags); /* local CPU only */
ide__sti(); /* local CPU only */
timeout += jiffies;
while ((stat = GET_STAT()) & BUSY_STAT) {
if (0 < (signed long)(jiffies - timeout)) {
__restore_flags(flags); /* local CPU only */
*startstop = ide_error(drive, "status timeout", stat); //这个ide_error里面就输出了上面的错误
return 1;
}
}
__restore_flags(flags); /* local CPU only */
} |
|