forked from Bananymous/banan-os
Kernel: Add small wait in ATA driver before reading/writing
This allows bochs to boot again
This commit is contained in:
parent
641ed23380
commit
32359df939
|
@ -265,6 +265,8 @@ namespace Kernel
|
|||
io_write(ATA_PORT_LBA2, (uint8_t)(lba >> 16));
|
||||
io_write(ATA_PORT_COMMAND, ATA_COMMAND_READ_SECTORS);
|
||||
|
||||
PIT::sleep(1);
|
||||
|
||||
for (uint32_t sector = 0; sector < sector_count; sector++)
|
||||
{
|
||||
block_until_irq();
|
||||
|
@ -297,6 +299,8 @@ namespace Kernel
|
|||
io_write(ATA_PORT_LBA2, (uint8_t)(lba >> 16));
|
||||
io_write(ATA_PORT_COMMAND, ATA_COMMAND_WRITE_SECTORS);
|
||||
|
||||
PIT::sleep(1);
|
||||
|
||||
for (uint32_t sector = 0; sector < sector_count; sector++)
|
||||
{
|
||||
write_buffer(ATA_PORT_DATA, (uint16_t*)buffer + sector * device->m_sector_words, device->m_sector_words);
|
||||
|
|
Loading…
Reference in New Issue