summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/HALKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-11 12:25:04 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-11 12:25:04 +0100
commitabb9aca8e7e86e28875b211a47f1a59dd02098b6 (patch)
treeff9494fef9b4d2346286db4a3eda639f77e3ce77 /dev/Kernel/HALKit
parent0a2760d8a5ce09ae77cfc097ece4100579164f9d (diff)
ADD: A better AHCI driver.
Diffstat (limited to 'dev/Kernel/HALKit')
-rw-r--r--dev/Kernel/HALKit/AMD64/Storage/AHCI.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc b/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc
index f2e0fda5..f36b8e28 100644
--- a/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc
+++ b/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc
@@ -20,6 +20,8 @@
#include <KernelKit/UserProcessScheduler.h>
#include <KernelKit/LPC.h>
+#include <FirmwareKit/EPM.h>
+
#include <Mod/ATA/ATA.h>
#include <Mod/AHCI/AHCI.h>
#include <KernelKit/PCI/Iterator.h>
@@ -138,9 +140,9 @@ STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, Siz
for (; i < (command_header->Prdtl - 1); i++)
{
- command_table->Prdt[i].Dba = ((UInt32)(UInt64)buffer_phys);
- command_table->Prdt[i].Dbau = (((UInt64)(buffer_phys) >> 32));
command_table->Prdt[i].Dbc = ((size_buffer / command_header->Prdtl - 1) - 1);
+ command_table->Prdt[i].Dba = ((UInt32)(UInt64)buffer_phys + (i * command_table->Prdt[i].Dbc));
+ command_table->Prdt[i].Dbau = (((UInt64)(buffer_phys) >> 32) + (i * command_table->Prdt[i].Dbc));
command_table->Prdt[i].Ie = YES;
}