summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-20 14:47:08 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-20 14:47:08 +0100
commit4ba02280f19b8a2beb1ad8445be7df6b7f9e1805 (patch)
tree4928e93b6463dcce6e0d74120882a6ec572bae5c /Private/NewBoot/Source
parent055a896406af227e03708fa20a728259cace704a (diff)
kernel: Reworking kernel to support virtual memory.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/NewBoot/Source')
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootATA.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
index 21f3f256..0ee16d82 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
@@ -152,6 +152,8 @@ Void boot_ata_read(UInt32 Lba, UInt8 IO, UInt8 Master, CharacterType* Buf,
Out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO);
+ boot_ata_wait_io(IO);
+
for (SizeT IndexOff = 0; IndexOff < 256; ++IndexOff) {
Buf[Offset + IndexOff] = In16(IO + ATA_REG_DATA);
}
@@ -172,6 +174,8 @@ Void boot_ata_write(UInt32 Lba, UInt8 IO, UInt8 Master, CharacterType* Buf,
Out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO);
+ boot_ata_wait_io(IO);
+
for (SizeT IndexOff = 0; IndexOff < 256; ++IndexOff) {
Out16(IO + ATA_REG_DATA, Buf[Offset + IndexOff]);
}
@@ -225,7 +229,7 @@ BDeviceATA& BDeviceATA::Read(CharacterType* Buf, const SizeT& SectorSz) {
return *this;
}
- Leak().mErr = false;
+ this->Leak().mErr = false;
if (!Buf || SectorSz < 1) return *this;
@@ -233,8 +237,6 @@ BDeviceATA& BDeviceATA::Read(CharacterType* Buf, const SizeT& SectorSz) {
boot_ata_read(this->Leak().mBase + i,
this->Leak().mBus, this->Leak().mMaster,
Buf, i);
-
- boot_ata_wait_io(this->Leak().mBus);
}
return *this;
@@ -262,15 +264,13 @@ BDeviceATA& BDeviceATA::Write(CharacterType* Buf, const SizeT& SectorSz) {
Buf, Off);
Off += kATASectorSize;
-
- boot_ata_wait_io(this->Leak().mBus);
}
return *this;
}
/**
- * @brief ATA Config getter.
+ * @brief ATA trait getter.
* @return BDeviceATA::ATATrait& the drive config.
*/
BDeviceATA::ATATrait& BDeviceATA::Leak() { return mTrait; }