diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-23 19:13:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-23 19:15:17 +0100 |
| commit | a13e1c0911c0627184bc38f18c7fdda64447b3ad (patch) | |
| tree | 073a62c09bf216e85a3f310376640fa1805147f9 /dev/Kernel/src/Storage | |
| parent | 149fa096eb306d03686b3b67e813cf1a78e08cd0 (diff) | |
meta(kernel): Reworked repository's filesystem structure.
Removing useless parts of the project too.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/src/Storage')
| -rw-r--r-- | dev/Kernel/src/Storage/AHCIDeviceInterface.cc | 36 | ||||
| -rw-r--r-- | dev/Kernel/src/Storage/ATADeviceInterface.cc | 88 | ||||
| -rw-r--r-- | dev/Kernel/src/Storage/NVMEDeviceInterface.cc | 28 | ||||
| -rw-r--r-- | dev/Kernel/src/Storage/SCSIDeviceInterface.cc | 11 |
4 files changed, 0 insertions, 163 deletions
diff --git a/dev/Kernel/src/Storage/AHCIDeviceInterface.cc b/dev/Kernel/src/Storage/AHCIDeviceInterface.cc deleted file mode 100644 index 8d987ab5..00000000 --- a/dev/Kernel/src/Storage/AHCIDeviceInterface.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include <StorageKit/AHCI.h> - -using namespace NeOS; - -/// @brief Class constructor -/// @param Out Drive output -/// @param In Drive input -/// @param Cleanup Drive cleanup. -AHCIDeviceInterface::AHCIDeviceInterface(void (*out)(IDeviceObject* self, MountpointInterface* outpacket), - void (*in)(IDeviceObject* self, MountpointInterface* inpacket), - void (*cleanup)(void)) - : IDeviceObject(out, in), fCleanup(cleanup) -{ -} - -/// @brief Class desctructor -AHCIDeviceInterface::~AHCIDeviceInterface() -{ - MUST_PASS(fCleanup); - - if (fCleanup) - fCleanup(); -} - -/// @brief Returns the name of the device interface. -/// @return it's name as a string. -const Char* AHCIDeviceInterface::Name() const -{ - return "/dev/sda{}"; -} diff --git a/dev/Kernel/src/Storage/ATADeviceInterface.cc b/dev/Kernel/src/Storage/ATADeviceInterface.cc deleted file mode 100644 index 9f1a0068..00000000 --- a/dev/Kernel/src/Storage/ATADeviceInterface.cc +++ /dev/null @@ -1,88 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include <StorageKit/ATA.h> - -using namespace NeOS; - -/// @brief Class constructor -/// @param Out Drive output -/// @param In Drive input -/// @param Cleanup Drive cleanup. -ATADeviceInterface::ATADeviceInterface( - void (*Out)(IDeviceObject*, MountpointInterface* outpacket), - void (*In)(IDeviceObject*, MountpointInterface* inpacket), - void (*Cleanup)(void)) - : IDeviceObject(Out, In), fCleanup(Cleanup) -{ -} - -/// @brief Class desctructor -ATADeviceInterface::~ATADeviceInterface() -{ - MUST_PASS(fCleanup); - if (fCleanup) - fCleanup(); -} - -/// @brief Returns the name of the device interface. -/// @return it's name as a string. -const Char* ATADeviceInterface::Name() const -{ - return "/dev/hda{}"; -} - -/// @brief Output operator. -/// @param Data -/// @return -ATADeviceInterface& ATADeviceInterface::operator<<(MountpointInterface* Data) -{ - if (!Data) - return *this; - - for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) - { - auto interface = Data->GetAddressOf(driveCount); - if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) - { - continue; - } - else if ((interface) && - rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) - { - return *this; - } - } - - return (ATADeviceInterface&)IDeviceObject<MountpointInterface*>::operator<<( - Data); -} - -/// @brief Input operator. -/// @param Data -/// @return -ATADeviceInterface& ATADeviceInterface::operator>>(MountpointInterface* Data) -{ - if (!Data) - return *this; - - for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) - { - auto interface = Data->GetAddressOf(driveCount); - if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) - { - continue; - } - else if ((interface) && - rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) - { - return *this; - } - } - - return (ATADeviceInterface&)IDeviceObject<MountpointInterface*>::operator>>( - Data); -} diff --git a/dev/Kernel/src/Storage/NVMEDeviceInterface.cc b/dev/Kernel/src/Storage/NVMEDeviceInterface.cc deleted file mode 100644 index 3e2c2c53..00000000 --- a/dev/Kernel/src/Storage/NVMEDeviceInterface.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include <StorageKit/NVME.h> - -namespace NeOS -{ - NVMEDeviceInterface::NVMEDeviceInterface(void (*out)(IDeviceObject*, MountpointInterface* outpacket), - void (*in)(IDeviceObject*, MountpointInterface* inpacket), - void (*cleanup)(void)) - : IDeviceObject(out, in), fCleanup(cleanup) - { - } - - NVMEDeviceInterface::~NVMEDeviceInterface() - { - if (fCleanup) - fCleanup(); - } - - const Char* NVMEDeviceInterface::Name() const - { - return ("/dev/nvme{}"); - } -} // namespace NeOS diff --git a/dev/Kernel/src/Storage/SCSIDeviceInterface.cc b/dev/Kernel/src/Storage/SCSIDeviceInterface.cc deleted file mode 100644 index cc625cdb..00000000 --- a/dev/Kernel/src/Storage/SCSIDeviceInterface.cc +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include <StorageKit/SCSI.h> - -///! @brief ATAPI SCSI packet. -const scsi_packet_type<12> kCDRomPacketTemplate = {0x43, 0, 1, 0, 0, 0, - 0, 12, 0x40, 0, 0}; |
