summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/HALKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-26 05:02:55 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-26 05:02:55 +0200
commit9076aff05349093c2c6280287ee3257d9c07c014 (patch)
tree9c415985dabaa37c7effc93306ca51e90c496e17 /dev/ZKA/HALKit
parentff94ce367f7f23e3a78f157f9420c480a4d7f9aa (diff)
[IMP] Add page file inside \System\ (syspage.sys)
[FIX] Fix ATA support in bootloader and kernel. [IMP] Add sector count macro in DriveManager. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
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);