Fix the driver IDE. Patch from Chris Guerineau. Index: sos-trunk-modif/drivers/ide.c =================================================================== --- sos-trunk-modif.orig/drivers/ide.c +++ sos-trunk-modif/drivers/ide.c @@ -391,6 +391,8 @@ static int ide_get_device_info (struct i dev->cyls = info->nb_logical_cylinders; dev->sectors = info->nb_logical_sectors; + dev->blocks = info->lba_capacity; + dev->support_lba = FALSE; /* Determines if device supports LBA. The method is a bit ugly, but @@ -515,7 +517,8 @@ static sos_ret_t ide_io_operation (struc sect = (block & 0xff); cyl_lo = (block >> 8) & 0xff; cyl_hi = (block >> 16) & 0xff; - head = ((block >> 24) & 0x7) | 0x40; + head = ((block >> 24) & 0xF) | 0x40; + /* head = ((block >> 24) & 0x7) | 0x40; */ } else { @@ -554,11 +557,15 @@ static sos_ret_t ide_io_operation (struc outb(ATA_C_READ, dev->ctrl->ioaddr + ATA_CMD); /* Wait for the device ready to transfer */ - do { udelay(1); } while (inb(dev->ctrl->ioaddr + ATA_STATUS) & ATA_S_BSY); + /*do { udelay(1); } while (inb(dev->ctrl->ioaddr + ATA_STATUS) & ATA_S_BSY); */ + + do { udelay(1); } while (inb(dev->ctrl->ioaddr + ATA_ALTPORT) & ATA_S_BSY); /* If an error was detected, stop here */ - if (inb(dev->ctrl->ioaddr + ATA_STATUS) & ATA_S_ERROR) + /* if (inb(dev->ctrl->ioaddr + ATA_STATUS) & ATA_S_ERROR) */ + if (inb(dev->ctrl->ioaddr + ATA_ALTPORT) & ATA_S_ERROR) { + inb(dev->ctrl->ioaddr + ATA_STATUS); sos_kmutex_unlock (& dev->ctrl->mutex); return -SOS_EFATAL; } @@ -571,7 +578,8 @@ static sos_ret_t ide_io_operation (struc /* Wait for the DRQ bit to be set */ while (1) { - status = inb(dev->ctrl->ioaddr + ATA_STATUS); + /* status = inb(dev->ctrl->ioaddr + ATA_STATUS); */ + status = inb(dev->ctrl->ioaddr + ATA_ALTPORT); if (status & ATA_S_ERROR) { sos_kmutex_unlock (& dev->ctrl->mutex); @@ -590,7 +598,8 @@ static sos_ret_t ide_io_operation (struc /* Wait for the device to have received all the data */ while (1) { - status = inb(dev->ctrl->ioaddr + ATA_STATUS); + /* status = inb(dev->ctrl->ioaddr + ATA_STATUS); */ + status = inb(dev->ctrl->ioaddr + ATA_ALTPORT); if (status & ATA_S_ERROR) { sos_kmutex_unlock (& dev->ctrl->mutex);