diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-03 22:53:06 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-03 22:55:18 +0100 |
| commit | aff54fd3dc6855b62c047f126c6fe20ca717ee0f (patch) | |
| tree | c283173ea6e2ed8a273113dcf597b0f10b2f1d93 /Private/FSKit | |
| parent | f99e383775fa43c5c1354067962b1590ff2abdae (diff) | |
HCR-11 : SATA support phase 1, work in progress AHCI implementation.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/FSKit')
| -rw-r--r-- | Private/FSKit/NewFS.hxx | 38 | ||||
| -rw-r--r-- | Private/FSKit/NewFSIndexer.hxx | 6 |
2 files changed, 23 insertions, 21 deletions
diff --git a/Private/FSKit/NewFS.hxx b/Private/FSKit/NewFS.hxx index 8aace190..0be6ece0 100644 --- a/Private/FSKit/NewFS.hxx +++ b/Private/FSKit/NewFS.hxx @@ -17,23 +17,25 @@ #define kInvalidCatalog -1 #define kNameLen 256 -#define kNewFSIdentLen 6 -#define kNewFSIdent "NewFS" +#define kNewFSIdentLen 4 +#define kNewFSIdent "HCFS" #define kPadLen 16 #define kNewFSVersion 1 +typedef HCore::WideChar NewCharType; + enum { kNewFSHardDrive = 0xC0, // Hard Drive kNewFSOpticalDrive = 0x0C, // Blu-Ray/DVD kNewFSMassStorageDevice = 0xCC, // USB - kNewFSUnknowmn = 0xFF, // unknown device or unsupported (floppy) + kNewFSUnknown = 0xFF, // unknown device or unsupported (floppy) kNewFSDriveCount = 4, }; struct PACKED NewBootBlock final { - HCore::WideChar Ident[kNewFSIdentLen]; - HCore::WideChar Shell[kNameLen]; + NewCharType Ident[kNewFSIdentLen]; + NewCharType Shell[kNameLen]; HCore::Int64 NumParts; HCore::Int64 FreeSectors; @@ -59,7 +61,7 @@ struct PACKED NewBootBlock final { #define kKindPartition 4 struct PACKED NewCatalog final { - HCore::WideChar Name[kNameLen]; + NewCharType Name[kNameLen]; HCore::Int32 Flags; HCore::Int32 Kind; @@ -93,8 +95,8 @@ struct PACKED NewFork final { #define kPartLen 32 struct PACKED NewPartitionBlock final { - HCore::WideChar Ident[kNewFSIdentLen]; - HCore::WideChar PartitionName[kPartLen]; + NewCharType Ident[kNewFSIdentLen]; + NewCharType PartitionName[kPartLen]; HCore::Int32 Flags; HCore::Int32 Kind; @@ -129,31 +131,31 @@ struct PACKED NewPartitionBlock final { #define kCatalogKindDevice 9 #define kCatalogKindLock 10 -#define kFilesystemSeparator '/' +#define kFilesystemSeparator '\\' #define kFilesystemUpDir ".." -#define kFilesystemRoot "/" +#define kFilesystemRoot "\\" #define kFilesystemLE '\r' -#define kFilesystemEOF 0xFF11 +#define kFilesystemEOF (-1) -#define kFilesystemBitWidth sizeof(HCore::WideChar) +#define kFilesystemBitWidth sizeof(NewCharType) #define kFilesystemLbaType HCore::Lba namespace HCore { /// -/// \name NewFSImpl -/// NewFS filesystem operations. (catalog creation, remove removal, root +/// \name NewFSImplementation +/// \brief HCFS filesystem operations. (catalog creation, remove removal, root /// fork...) /// -class NewFSImpl { +class NewFSImplementation { public: - explicit NewFSImpl() = default; - virtual ~NewFSImpl() = default; + explicit NewFSImplementation() = default; + virtual ~NewFSImplementation() = default; public: - HCORE_COPY_DEFAULT(NewFSImpl); + HCORE_COPY_DEFAULT(NewFSImplementation); virtual NewFork* ForkFrom(NewCatalog& catalog, const Int64& id) = 0; diff --git a/Private/FSKit/NewFSIndexer.hxx b/Private/FSKit/NewFSIndexer.hxx index 3ff77858..bb6c9f99 100644 --- a/Private/FSKit/NewFSIndexer.hxx +++ b/Private/FSKit/NewFSIndexer.hxx @@ -32,11 +32,11 @@ class INewFSIterator { HCORE_COPY_DEFAULT(INewFSIterator); public: - void Add(IndexableProperty& indexProp) { fProps.Add(indexProp); } + void Append(IndexableProperty& indexProp) { fProps.Add(indexProp); } - void Remove(const SizeT& indexProp) { fProps.Remove(indexProp); } + MutableArray<IndexableProperty>& Leak() { return fProps; } - Boolean FindLinear(IndexProperty& filters) { + Boolean Find(IndexProperty& filters) { for (size_t i = 0; i < fProps.Count(); ++i) { if (StringBuilder::Equals(fProps[i].Leak().LeakProperty().Path, filters.Path)) { |
