Flushing data to HDD when using int 0x13
Posted: Sun Feb 12, 2012 10:15 am
Hi,
I'm currently in a situation where I need to use interrupt 0x13 for read and write to a HDD. Apparently -- at least on many BIOS/controller/HDD-combinations -- there is no guarantee that data has actually been written when the interrupt returns. The writes are both being cached and reordered before they are finally written to the drive.
My quest is to find a way of causing the data to be flushed to drive, or at least find some way of knowing when and if the data has been written. Verifying sectors through interrupt 0x13 seems to funnily enough verify sectors in some cache somewhere. I was looking into using the legacy IDE interface, but this was shown to be near impossible since the HDD controller can be in AHCI mode. According to some documentation it can, on some controllers, still be possible to send ATA commands through the legacy IDE ports but this seems to be different on every controller. I am also unable to use AHCI since taking OS ownership would make it impossible to load a proprietary OS afterwards when it itself wants to take OS ownership on the AHCI controller.
Any ideas on things to try would be helpful, but I'm suspecting this will be nearly impossible by now.
Thanks,
Daniel
I'm currently in a situation where I need to use interrupt 0x13 for read and write to a HDD. Apparently -- at least on many BIOS/controller/HDD-combinations -- there is no guarantee that data has actually been written when the interrupt returns. The writes are both being cached and reordered before they are finally written to the drive.
My quest is to find a way of causing the data to be flushed to drive, or at least find some way of knowing when and if the data has been written. Verifying sectors through interrupt 0x13 seems to funnily enough verify sectors in some cache somewhere. I was looking into using the legacy IDE interface, but this was shown to be near impossible since the HDD controller can be in AHCI mode. According to some documentation it can, on some controllers, still be possible to send ATA commands through the legacy IDE ports but this seems to be different on every controller. I am also unable to use AHCI since taking OS ownership would make it impossible to load a proprietary OS afterwards when it itself wants to take OS ownership on the AHCI controller.
Any ideas on things to try would be helpful, but I'm suspecting this will be nearly impossible by now.
Thanks,
Daniel