Kernel: ATA controller waits now before read/write until disk is ready
Qemu used to freeze on disk writes but now it seems fine
This commit is contained in:
		
							parent
							
								
									2aad357c18
								
							
						
					
					
						commit
						bdc7a99c59
					
				|  | @ -216,6 +216,7 @@ namespace Kernel | |||
| 		if (lba < (1 << 28)) | ||||
| 		{ | ||||
| 			// LBA28
 | ||||
| 			TRY(device->wait(false)); | ||||
| 			device->io_write(ATA_PORT_DRIVE_SELECT, 0xE0 | device->m_slave_bit | ((lba >> 24) & 0x0F)); | ||||
| 			device->io_write(ATA_PORT_SECTOR_COUNT, sector_count); | ||||
| 			device->io_write(ATA_PORT_LBA0, (uint8_t)(lba >>  0)); | ||||
|  | @ -248,6 +249,7 @@ namespace Kernel | |||
| 		if (lba < (1 << 28)) | ||||
| 		{ | ||||
| 			// LBA28
 | ||||
| 			TRY(device->wait(false)); | ||||
| 			device->io_write(ATA_PORT_DRIVE_SELECT, 0xE0 | device->m_slave_bit | ((lba >> 24) & 0x0F)); | ||||
| 			device->io_write(ATA_PORT_SECTOR_COUNT, sector_count); | ||||
| 			device->io_write(ATA_PORT_LBA0, (uint8_t)(lba >>  0)); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue