Fix ata device detection
After grub loading sector and LBA could have been altered
This commit is contained in:
parent
f110f85498
commit
8a4e0ff10f
@ -418,6 +418,10 @@ int ATADetectDevice(struct ata_device *dev)
|
|||||||
struct ata_controller *ctl = dev->ctl;
|
struct ata_controller *ctl = dev->ctl;
|
||||||
outb(ctl->base + ATA_PIO_DRIVE,
|
outb(ctl->base + ATA_PIO_DRIVE,
|
||||||
ATA_PIO_DRIVE_IBM | (dev->isSlave ? ATA_PIO_DRIVE_SLAVE : ATA_PIO_DRIVE_MASTER));
|
ATA_PIO_DRIVE_IBM | (dev->isSlave ? ATA_PIO_DRIVE_SLAVE : ATA_PIO_DRIVE_MASTER));
|
||||||
|
outb(ctl->base + ATA_PIO_SEC_COUNT, 0);
|
||||||
|
outb(ctl->base + ATA_PIO_LBALO, 0);
|
||||||
|
outb(ctl->base + ATA_PIO_LBAMID, 0);
|
||||||
|
outb(ctl->base + ATA_PIO_LBAHI, 0);
|
||||||
unsigned st = inb(ctl->base + ATA_PIO_STATUS);
|
unsigned st = inb(ctl->base + ATA_PIO_STATUS);
|
||||||
if (st & ATA_PIO_STATUS_DRIVE_BUSY)
|
if (st & ATA_PIO_STATUS_DRIVE_BUSY)
|
||||||
goto no_disk;
|
goto no_disk;
|
||||||
|
Loading…
Reference in New Issue
Block a user