mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 09:47:35 +00:00
Kernel: Send IDE flush command after writing sectors.
This commit is contained in:
parent
11e7ce60e5
commit
37498c1566
1 changed files with 7 additions and 0 deletions
|
@ -19,6 +19,7 @@ enum IDECommand : byte {
|
|||
IDENTIFY_DRIVE = 0xEC,
|
||||
READ_SECTORS = 0x21,
|
||||
WRITE_SECTORS = 0x30,
|
||||
FLUSH_CACHE = 0xe7,
|
||||
};
|
||||
|
||||
enum IDEStatus : byte {
|
||||
|
@ -257,5 +258,11 @@ bool IDEDiskDevice::write_sectors(dword start_sector, word count, const byte* da
|
|||
enable_irq();
|
||||
wait_for_irq();
|
||||
|
||||
disable_irq();
|
||||
IO::out8(IDE0_COMMAND, FLUSH_CACHE);
|
||||
while (IO::in8(IDE0_STATUS) & BUSY);
|
||||
enable_irq();
|
||||
wait_for_irq();
|
||||
|
||||
return !m_device_error;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue