From 45548d516ddf5e88bf80940365d151e1bd69c29f Mon Sep 17 00:00:00 2001 From: amlal Date: Sun, 17 Mar 2024 07:25:31 +0100 Subject: HCR-14: A series of important fixes and improvements regarding the kernel. Signed-off-by: amlal --- Private/NewBoot/BootKit/Arch/AHCI.hxx | 38 ----------------------------------- Private/NewBoot/BootKit/Arch/ATA.hxx | 4 +--- Private/NewBoot/BootKit/Arch/SATA.hxx | 38 +++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 41 deletions(-) delete mode 100644 Private/NewBoot/BootKit/Arch/AHCI.hxx create mode 100644 Private/NewBoot/BootKit/Arch/SATA.hxx (limited to 'Private/NewBoot/BootKit') diff --git a/Private/NewBoot/BootKit/Arch/AHCI.hxx b/Private/NewBoot/BootKit/Arch/AHCI.hxx deleted file mode 100644 index 9505377b..00000000 --- a/Private/NewBoot/BootKit/Arch/AHCI.hxx +++ /dev/null @@ -1,38 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include -#include - -class BDeviceAHCI final { - public: - explicit BDeviceAHCI() noexcept; - ~BDeviceAHCI() = default; - - HCORE_COPY_DEFAULT(BDeviceAHCI); - - struct AHCITraits final { - HCore::SizeT fBase{1024}; - HCore::Boolean fError{false}; - HCore::Boolean fDetected{false}; - - operator bool() { return !this->fError; } - }; - - operator bool() { return this->Leak().fDetected; } - - BDeviceAHCI& Read(HCore::WideChar* Buf, const HCore::SizeT& SecCount); - BDeviceAHCI& Write(HCore::WideChar* Buf, const HCore::SizeT& SecCount); - - AHCITraits& Leak(); - - private: - AHCITraits mTraits; -}; - -#define kAHCISectorSz 512 diff --git a/Private/NewBoot/BootKit/Arch/ATA.hxx b/Private/NewBoot/BootKit/Arch/ATA.hxx index 3370fdba..15d36317 100644 --- a/Private/NewBoot/BootKit/Arch/ATA.hxx +++ b/Private/NewBoot/BootKit/Arch/ATA.hxx @@ -8,8 +8,6 @@ #include -Boolean IsATADetected(Void); - class BDeviceATA final { public: enum { @@ -31,7 +29,7 @@ class BDeviceATA final { operator bool() { return !mErr; } }; - operator bool() { return IsATADetected(); } + operator bool(); BDeviceATA& Read(WideChar* Buf, const SizeT& SecCount); BDeviceATA& Write(WideChar* Buf, const SizeT& SecCount); diff --git a/Private/NewBoot/BootKit/Arch/SATA.hxx b/Private/NewBoot/BootKit/Arch/SATA.hxx new file mode 100644 index 00000000..3e37be19 --- /dev/null +++ b/Private/NewBoot/BootKit/Arch/SATA.hxx @@ -0,0 +1,38 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include +#include + +class BDeviceSATA final { + public: + explicit BDeviceSATA() noexcept; + ~BDeviceSATA() = default; + + HCORE_COPY_DEFAULT(BDeviceSATA); + + struct AHCITraits final { + HCore::SizeT mBase{1024}; + HCore::Boolean mErr{false}; + HCore::Boolean mDetected{false}; + + operator bool() { return !this->mErr; } + }; + + operator bool() { return this->Leak().mDetected; } + + BDeviceSATA& Read(HCore::WideChar* Buf, const HCore::SizeT& SecCount); + BDeviceSATA& Write(HCore::WideChar* Buf, const HCore::SizeT& SecCount); + + AHCITraits& Leak(); + + private: + AHCITraits mTraits; +}; + +#define kAHCISectorSz 512 -- cgit v1.2.3