summaryrefslogtreecommitdiffhomepage
path: root/Private/StorageKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-30 08:05:00 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-30 08:05:00 +0100
commitf22e69b8837b84548f79e0b8ca7bef24605c6611 (patch)
treecda020af66538453cc3d8fb16a41e2e3eec7b01e /Private/StorageKit
parenta8c17ccd6d97cc78830917dc6282b040b21ba16c (diff)
Kernel: Update TODO_LIST.txt, fix CRC32, add .vscode dir in root.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/StorageKit')
-rw-r--r--Private/StorageKit/Storage.hpp9
-rw-r--r--Private/StorageKit/StorageCore.inl70
2 files changed, 31 insertions, 48 deletions
diff --git a/Private/StorageKit/Storage.hpp b/Private/StorageKit/Storage.hpp
index 8b3670af..568a9d25 100644
--- a/Private/StorageKit/Storage.hpp
+++ b/Private/StorageKit/Storage.hpp
@@ -10,19 +10,14 @@
#pragma once
#include <NewKit/Defines.hpp>
-
#include <StorageKit/ATA.hpp>
#include <StorageKit/NVME.hpp>
-#include <StorageKit/StorageCore.inl>
-
typedef hCore::UInt16 OSScsiPacket[12];
extern const OSScsiPacket kCDRomPacketTemplate;
-#define f_kDriveSectorSize 2048
+#define f_kDriveSectorSize 512
#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
index 85e2a3f5..73e89a9d 100644
--- a/Private/StorageKit/StorageCore.inl
+++ b/Private/StorageKit/StorageCore.inl
@@ -6,51 +6,39 @@
*
* ========================================================
*/
-
+
#ifndef __STORAGEKIT_STORAGECORE_INL__
#define __STORAGEKIT_STORAGECORE_INL__
#include <NewKit/Defines.hpp>
-// @brief Storage management unit.
-// swap files, files, dirs optimization.
-
-namespace hCore
-{
- typedef Char* SKStr;
-
- //! @brief Storage context, reads and write file according to the descriptor layout.
- class StorageContext
- {
- public:
- explicit StorageContext() = default;
- ~StorageContext() = default;
-
- StorageContext& operator=(const StorageContext&) = default;
- StorageContext(const StorageContext&) = default;
-
- public:
- bool Write(VoidPtr fileDescriptor, SizeT sizeFileDescriptor);
-
- struct SDescriptor
- {
- VoidPtr fFilePtr;
- SizeT fFilePtrSz;
- };
-
- SDescriptor Read(const SKStr name);
-
- };
-
-#define kMaxPathSK 4096
-
- struct StorageLayout final
- {
- Char fName[kMaxPathSK];
- VoidPtr fData;
- SizeT fDataSz;
- Int32 fType;
- };
-}
+/// @file StorageCore.inl
+/// @brief Storage Management API.
+
+namespace hCore {
+typedef Char* SKStr;
+
+///! @brief Storage context, reads and write file according to the descriptor
+///! layout.
+class StorageContext {
+ public:
+ explicit StorageContext() = default;
+ ~StorageContext() = default;
+
+ StorageContext& operator=(const StorageContext&) = default;
+ StorageContext(const StorageContext&) = default;
+
+ public:
+ bool Write(VoidPtr fileDescriptor, SizeT sizeFileDescriptor);
+
+ struct PacketDescriptor final {
+ VoidPtr fFilePtr;
+ SizeT fFilePtrSz;
+ };
+
+ PacketDescriptor* Read(const SKStr name);
+ Int32 Write(PacketDescriptor* packet, const SKStr name);
+};
+} // namespace hCore
#endif /* ifndef __STORAGEKIT_STORAGECORE_INL__ */