summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-04-29 15:01:06 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-04-29 15:01:06 +0000
commita06c8a375f0c5f5e3613e9fe8228cebf442731ba (patch)
tree84b30c251e1b444873f4723ecab047689526e9f0 /Private/HALKit
parent14f10cc0b35155ddb19ec9069ebb884246e61dcf (diff)
parenta21859d722597e4eb1216a4a48d08d8f2659b514 (diff)
Merged in MHR-18 (pull request #9)
MHR-18
Diffstat (limited to 'Private/HALKit')
-rw-r--r--Private/HALKit/AMD64/Storage/ATA-PIO.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Private/HALKit/AMD64/Storage/ATA-PIO.cxx b/Private/HALKit/AMD64/Storage/ATA-PIO.cxx
index 6fe1e29a..9b37e248 100644
--- a/Private/HALKit/AMD64/Storage/ATA-PIO.cxx
+++ b/Private/HALKit/AMD64/Storage/ATA-PIO.cxx
@@ -106,7 +106,8 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf,
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
- Out8(IO + ATA_REG_SEC_COUNT0, 2);
+ /// Compute sector count.
+ Out8(IO + ATA_REG_SEC_COUNT0, SectorSz / (SectorSz / 2));
Out8(IO + ATA_REG_LBA0, (Lba));
Out8(IO + ATA_REG_LBA1, (Lba) >> 8);
@@ -133,9 +134,10 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf,
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, SectorSz / (SectorSz / 2));
Out8(IO + ATA_REG_LBA0, (Lba));
Out8(IO + ATA_REG_LBA1, (Lba) >> 8);