summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-03 22:53:06 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-03 22:55:18 +0100
commitaff54fd3dc6855b62c047f126c6fe20ca717ee0f (patch)
treec283173ea6e2ed8a273113dcf597b0f10b2f1d93 /Private/NewBoot/Source
parentf99e383775fa43c5c1354067962b1590ff2abdae (diff)
HCR-11 : SATA support phase 1, work in progress AHCI implementation.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/Source')
-rw-r--r--Private/NewBoot/Source/Entrypoint.cxx1
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/AMD64-AHCI.cxx2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/AMD64-ATA.cxx25
3 files changed, 15 insertions, 13 deletions
diff --git a/Private/NewBoot/Source/Entrypoint.cxx b/Private/NewBoot/Source/Entrypoint.cxx
index d2134746..39769b87 100644
--- a/Private/NewBoot/Source/Entrypoint.cxx
+++ b/Private/NewBoot/Source/Entrypoint.cxx
@@ -7,6 +7,7 @@
* ========================================================
*/
+#include "BootKit/Arch/ATA.hxx"
#define __BOOTLOADER__ 1
#include <BootKit/BootKit.hxx>
diff --git a/Private/NewBoot/Source/HEL/AMD64/AMD64-AHCI.cxx b/Private/NewBoot/Source/HEL/AMD64/AMD64-AHCI.cxx
index 2d449bbb..2363f8cb 100644
--- a/Private/NewBoot/Source/HEL/AMD64/AMD64-AHCI.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/AMD64-AHCI.cxx
@@ -17,3 +17,5 @@
* @copyright Copyright (c) 2024 Mahrouss Logic
*
*/
+
+#include <BootKit/Arch/AHCI.hxx>
diff --git a/Private/NewBoot/Source/HEL/AMD64/AMD64-ATA.cxx b/Private/NewBoot/Source/HEL/AMD64/AMD64-ATA.cxx
index 3414d060..20af043d 100644
--- a/Private/NewBoot/Source/HEL/AMD64/AMD64-ATA.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/AMD64-ATA.cxx
@@ -22,8 +22,6 @@
#include <BootKit/BootKit.hxx>
#include <EFIKit/Api.hxx>
-#include "BootKit/Platform.hxx"
-
/// bugs: 0
#define kATADataLen 256
@@ -94,7 +92,7 @@ ATAInit_Retry:
writer.WriteString(L"\r\n");
- OutBus = (Bus == ATA_PRIMARY) ? BATADevice::kPrimary : BATADevice::kSecondary;
+ OutBus = (Bus == ATA_PRIMARY) ? BDeviceATA::kPrimary : BDeviceATA::kSecondary;
OutMaster = (Bus == ATA_PRIMARY) ? ATA_MASTER : ATA_SLAVE;
Out8(Bus + ATA_REG_HDDEVSEL, 0xA0 | ATA_MASTER << 4);
@@ -172,12 +170,13 @@ Void ATAWriteLba(UInt32 Lba, UInt8 IO, UInt8 Master, wchar_t* Buf,
}
}
-Boolean ATAIsDetected(Void) { return kATADetected; }
+/// @check is ATA detected?
+Boolean IsATADetected(Void) { return kATADetected; }
/***
*
*
- * ATA Device class.
+ * @brief ATA Device class.
*
*
*/
@@ -186,8 +185,8 @@ Boolean ATAIsDetected(Void) { return kATADetected; }
* @brief ATA Device constructor.
* @param void none.
*/
-BATADevice::BATADevice() noexcept {
- if (ATAIsDetected()) return;
+BDeviceATA::BDeviceATA() noexcept {
+ if (IsATADetected()) return;
if (ATAInitDriver(ATA_PRIMARY_IO, true, this->Leak().mBus,
this->Leak().mMaster) ||
@@ -209,8 +208,8 @@ BATADevice::BATADevice() noexcept {
@param Sz Sector size
@param Buf buffer
*/
-BATADevice& BATADevice::Read(CharacterType* Buf, const SizeT& SectorSz) {
- if (!ATAIsDetected()) {
+BDeviceATA& BDeviceATA::Read(CharacterType* Buf, const SizeT& SectorSz) {
+ if (!IsATADetected()) {
Leak().mErr = true;
return *this;
}
@@ -232,8 +231,8 @@ BATADevice& BATADevice::Read(CharacterType* Buf, const SizeT& SectorSz) {
@param Sz Sector size
@param Buf buffer
*/
-BATADevice& BATADevice::Write(CharacterType* Buf, const SizeT& SectorSz) {
- if (!ATAIsDetected()) {
+BDeviceATA& BDeviceATA::Write(CharacterType* Buf, const SizeT& SectorSz) {
+ if (!IsATADetected()) {
Leak().mErr = true;
return *this;
}
@@ -256,6 +255,6 @@ BATADevice& BATADevice::Write(CharacterType* Buf, const SizeT& SectorSz) {
/**
* @brief ATA Config getter.
- * @return BATADevice::ATATraits& the drive config.
+ * @return BDeviceATA::ATATraits& the drive config.
*/
-BATADevice::ATATraits& BATADevice::Leak() { return mTraits; }
+BDeviceATA::ATATraits& BDeviceATA::Leak() { return mTraits; }