summaryrefslogtreecommitdiffhomepage
path: root/Private
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-22 09:47:28 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-22 09:47:28 +0100
commit5df4daf0619b95131ea99110ee2e8913012b6134 (patch)
treed554db8ee6b9d331d90331224d97a5c6a61cdc55 /Private
parentbc9b63a3dbc63d818e90237beb019f584acfe133 (diff)
HCR-14: ATA Built-in driver.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private')
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootATA.cxx9
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootMain.cxx3
2 files changed, 4 insertions, 8 deletions
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
index e55b2121..72340d01 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
@@ -154,6 +154,8 @@ Void boot_ata_read(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
Out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO);
+ boot_ata_wait_io(IO);
+
BTextWriter writer;
writer.Write(L"NewBoot: Port: ").Write(IO).Write(L"\r\n");
@@ -162,8 +164,6 @@ Void boot_ata_read(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
WideChar chr = In16(IO + ATA_REG_DATA);
Buf[IndexOff] = chr;
-
- boot_ata_wait_io(IO);
}
}
@@ -180,12 +180,11 @@ Void boot_ata_write(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
Out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO);
+ boot_ata_wait_io(IO);
+
for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) {
- // Send it two
Out16(IO + ATA_REG_DATA, Buf[IndexOff]);
- Out16(IO + ATA_REG_DATA, '\0');
- boot_ata_wait_io(IO);
}
}
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
index b90d9d60..5bff5929 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
@@ -38,9 +38,6 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
.Write(SystemTable->FirmwareVendor)
.Write(L"\r\n");
- /// Init ATA driver.
- BDeviceATA ataDrv;
-
/// Read Kernel blob.
BFileReader kernelImg(L".HCORE", ImageHandle);