From da70596895d8135e08f8caac6978117697b4c021 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 18 Aug 2024 21:39:29 +0200 Subject: [REFACTOR] Improved project structure. Signed-off-by: Amlal El Mahrouss --- dev/Boot/BootKit/HW/ATA.hxx | 58 -------------------------------------------- dev/Boot/BootKit/HW/SATA.hxx | 46 ----------------------------------- 2 files changed, 104 deletions(-) delete mode 100644 dev/Boot/BootKit/HW/ATA.hxx delete mode 100644 dev/Boot/BootKit/HW/SATA.hxx (limited to 'dev/Boot/BootKit/HW') diff --git a/dev/Boot/BootKit/HW/ATA.hxx b/dev/Boot/BootKit/HW/ATA.hxx deleted file mode 100644 index 2c6416f8..00000000 --- a/dev/Boot/BootKit/HW/ATA.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#pragma once - -#include -#include - -using namespace Kernel; - -class BootDeviceATA final : public Device -{ -public: - enum - { - kPrimary = ATA_PRIMARY_IO, - kSecondary = ATA_SECONDARY_IO, - }; - - explicit BootDeviceATA() noexcept; - ~BootDeviceATA() = default; - - NEWOS_COPY_DEFAULT(BootDeviceATA); - - enum - { - kSectorSize = kATASectorSize - }; - - struct ATATrait final : public Device::Trait - { - UInt16 mBus{kPrimary}; - UInt8 mMaster{0}; - Boolean mErr{false}; - - operator bool() - { - return !mErr; - } - }; - -public: - operator bool(); - - SizeT GetSectorsCount() noexcept; - SizeT GetDiskSize() noexcept; - - BootDeviceATA& Read(Char* Buf, const SizeT& SecCount) override; - BootDeviceATA& Write(Char* Buf, const SizeT& SecCount) override; - - ATATrait& Leak() override; - -private: - ATATrait mTrait; -}; diff --git a/dev/Boot/BootKit/HW/SATA.hxx b/dev/Boot/BootKit/HW/SATA.hxx deleted file mode 100644 index 4704ece4..00000000 --- a/dev/Boot/BootKit/HW/SATA.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#pragma once - -#include -#include - -class BootDeviceSATA final -{ -public: - explicit BootDeviceSATA() noexcept; - ~BootDeviceSATA() = default; - - NEWOS_COPY_DEFAULT(BootDeviceSATA); - - struct SATATrait final - { - Kernel::SizeT mBase{1024}; - Kernel::Boolean mErr{false}; - Kernel::Boolean mDetected{false}; - - operator bool() - { - return !this->mErr; - } - }; - - operator bool() - { - return this->Leak().mDetected; - } - - BootDeviceSATA& Read(Kernel::WideChar* Buf, const Kernel::SizeT& SecCount); - BootDeviceSATA& Write(Kernel::WideChar* Buf, const Kernel::SizeT& SecCount); - - SATATrait& Leak(); - -private: - SATATrait mTrait; -}; - -#define kAHCISectorSz 4096 -- cgit v1.2.3