summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/HALKit
diff options
context:
space:
mode:
Diffstat (limited to 'dev/ZKA/HALKit')
-rw-r--r--dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx b/dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx
index cf739cb8..74869dc3 100644
--- a/dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx
+++ b/dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx
@@ -123,8 +123,7 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
- /// Compute sector count.
- Out8(IO + ATA_REG_SEC_COUNT0, 2);
+ Out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz));
Out8(IO + ATA_REG_LBA0, (Lba) & 0xFF);
Out8(IO + ATA_REG_LBA1, (Lba) >> 8);
@@ -154,10 +153,9 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS
drv_std_wait_io(IO);
drv_std_select(IO);
- /// Compute sector count.
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
- Out8(IO + ATA_REG_SEC_COUNT0, 2);
+ Out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz));
Out8(IO + ATA_REG_LBA0, (Lba) & 0xFF);
Out8(IO + ATA_REG_LBA1, (Lba) >> 8);