diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-28 20:54:33 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-28 20:54:33 +0100 |
| commit | b2c7b8604ed3a4c209a15a9ffd718a43163dd9b4 (patch) | |
| tree | 851d79e3a9b1c676b48ec8dfcd2b989f4da45c9b /Private/StorageKit | |
| parent | 215518ae55a54973a1ae18f572ca5bf0ac2a499e (diff) | |
NewKernel: Add PowerPC partition type inside EPM, add Leak() FileStream method. and documentation.
SystemLib: Start implementing the API.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/StorageKit')
| -rw-r--r-- | Private/StorageKit/AHCI.hpp | 21 | ||||
| -rw-r--r-- | Private/StorageKit/ATA.hpp | 43 | ||||
| -rw-r--r-- | Private/StorageKit/Storage.hpp | 2 | ||||
| -rw-r--r-- | Private/StorageKit/StorageCore.inl | 41 |
4 files changed, 55 insertions, 52 deletions
diff --git a/Private/StorageKit/AHCI.hpp b/Private/StorageKit/AHCI.hpp index 20cddf3f..6f5b5a90 100644 --- a/Private/StorageKit/AHCI.hpp +++ b/Private/StorageKit/AHCI.hpp @@ -14,8 +14,9 @@ class AHCIPacket; class AHCIDeviceInterface : public DeviceInterface<AHCIPacket> { public: - explicit AHCIDeviceInterface(void (*Out)(AHCIPacket outpacket), - void (*In)(AHCIPacket inpacket), void (*Cleanup)(void)); + explicit AHCIDeviceInterface(void (*Out)(AHCIPacket outpacket), + void (*In)(AHCIPacket inpacket), + void (*Cleanup)(void)); virtual ~AHCIDeviceInterface(); @@ -25,16 +26,18 @@ class AHCIDeviceInterface : public DeviceInterface<AHCIPacket> { const char *Name() const override; - private: + private: + void (*fOut)(AHCIPacket); + void (*fIn)(AHCIPacket); void (*fCleanup)(void); }; class AHCIPacket final { UIntPtr DataPtr; - SizeT DataSz; - UInt8 PortId; - UInt8 PortRdy; - Lba Begin; - Lba End; + SizeT DataSz; + UInt8 PortId; + UInt8 PortRdy; + Lba BeginLba; + Lba SectorCnt; }; -} // namespace NewOS
\ No newline at end of file +} // namespace NewOS
\ No newline at end of file diff --git a/Private/StorageKit/ATA.hpp b/Private/StorageKit/ATA.hpp new file mode 100644 index 00000000..5ad5a2d4 --- /dev/null +++ b/Private/StorageKit/ATA.hpp @@ -0,0 +1,43 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include <KernelKit/DeviceManager.hpp> +#include <NewKit/OwnPtr.hpp> + +namespace NewOS { +class ATAPacket; + +class ATADeviceInterface : public DeviceInterface<ATAPacket> { + public: + explicit ATADeviceInterface(void (*Out)(ATAPacket outpacket), + void (*In)(ATAPacket inpacket), + void (*Cleanup)(void)); + + virtual ~ATADeviceInterface(); + + public: + ATADeviceInterface &operator=(const ATADeviceInterface &) = default; + ATADeviceInterface(const ATADeviceInterface &) = default; + + const char *Name() const override; + + private: + void (*fOut)(ATAPacket); + void (*fIn)(ATAPacket); + void (*fCleanup)(void); +}; + +class ATAPacket final { + UIntPtr DataPtr; + SizeT DataSz; + UInt8 PortId; + UInt8 PortRdy; + Lba BeginLba; + Lba SectorCnt; +}; +} // namespace NewOS
\ No newline at end of file diff --git a/Private/StorageKit/Storage.hpp b/Private/StorageKit/Storage.hpp index 6654c62b..8e7614e6 100644 --- a/Private/StorageKit/Storage.hpp +++ b/Private/StorageKit/Storage.hpp @@ -20,5 +20,3 @@ extern const SKScsiPacket kCDRomPacketTemplate; #define f_kDriveSize(LAST_LBA) ((LAST_LBA + 1) * f_kDriveSectorSize) -#include <StorageKit/StorageCore.inl> - diff --git a/Private/StorageKit/StorageCore.inl b/Private/StorageKit/StorageCore.inl deleted file mode 100644 index 8a7ca0b9..00000000 --- a/Private/StorageKit/StorageCore.inl +++ /dev/null @@ -1,41 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#ifndef __STORAGEKIT_STORAGECORE_INL__ -#define __STORAGEKIT_STORAGECORE_INL__ - -#include <NewKit/Defines.hpp> - -/// @file StorageCore.inl -/// @brief Storage Management API. - -namespace NewOS { -typedef Char* SKStr; - -///! @brief Storage context, reads and write file according to the descriptor -///layout. -class StorageInterface { - public: - explicit StorageInterface() = default; - virtual ~StorageInterface() = default; - - StorageInterface& operator=(const StorageInterface&) = default; - StorageInterface(const StorageInterface&) = default; - - public: - struct PacketDescriptor final { - VoidPtr fFilePtr; - SizeT fFilePtrSz; - Lba fBase; - UInt32 fDriveId; - }; - - virtual PacketDescriptor* Read(const SKStr name) = 0; - virtual Int32 Write(PacketDescriptor* packet, const SKStr name) = 0; -}; -} // namespace NewOS - -#endif /* ifndef __STORAGEKIT_STORAGECORE_INL__ */ |
