summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-02-07 14:10:04 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-02-07 14:10:04 +0100
commit9c1c2beb24ed553d83453d413e8c73479c59f7de (patch)
treefdf03608cecaf6704ee745e47ff6b719a211d6ac /dev/Kernel
parentfb35c7b211920db07079bd5948e54d0f4347076d (diff)
ADD: NeFS refactors and getting that SATA driver done.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel')
-rw-r--r--dev/Kernel/FSKit/NeFS.h56
-rw-r--r--dev/Kernel/HALKit/AMD64/Storage/SATA.cc2
-rw-r--r--dev/Kernel/src/FS/NeFS+FileMgr.cc12
-rw-r--r--dev/Kernel/src/FS/NeFS.cc126
4 files changed, 96 insertions, 100 deletions
diff --git a/dev/Kernel/FSKit/NeFS.h b/dev/Kernel/FSKit/NeFS.h
index 497e89a8..c56d5838 100644
--- a/dev/Kernel/FSKit/NeFS.h
+++ b/dev/Kernel/FSKit/NeFS.h
@@ -48,7 +48,7 @@ default.
#define kNeFSDataFork "main_data"
#define kNeFSResourceFork "main_rsrc"
-#define kNeFSForkSize (sizeof(NFS_FORK_STRUCT))
+#define kNeFSForkSize (sizeof(NEFS_FORK_STRUCT))
#define kNeFSPartitionTypeStandard (7)
#define kNeFSPartitionTypePage (8)
@@ -92,16 +92,14 @@ default.
/// @note Start after the partition map header. (Virtual addressing)
#define kNeFSRootCatalogStartAddress (1024)
-#define kNeFSCatalogStartAddress ((2048) + sizeof(NFS_ROOT_PARTITION_BLOCK))
+#define kNeFSCatalogStartAddress ((2048) + sizeof(NEFS_ROOT_PARTITION_BLOCK))
#define kResourceTypeDialog (10)
#define kResourceTypeString (11)
#define kResourceTypeMenu (12)
#define kResourceTypeSound (13)
#define kResourceTypeFont (14)
-
-#define kConfigLen (64)
-#define kPartLen (32)
+#define kNeFSPartLen (32)
#define kNeFSFlagDeleted (70)
#define kNeFSFlagUnallocated (0)
@@ -110,14 +108,14 @@ default.
#define kNeFSMimeNameLen (200)
#define kNeFSForkNameLen (200)
-#define kNeFSFrameworkExt ".fwrk"
-#define kNeFSStepsExt ".step"
-#define kNeFSApplicationExt ".app"
+#define kNeFSFrameworkExt ".fwrk/"
+#define kNeFSStepsExt ".step/"
+#define kNeFSApplicationExt ".app/"
#define kNeFSJournalExt ".jrnl"
-struct NFS_CATALOG_STRUCT;
-struct NFS_FORK_STRUCT;
-struct NFS_ROOT_PARTITION_BLOCK;
+struct NEFS_CATALOG_STRUCT;
+struct NEFS_FORK_STRUCT;
+struct NEFS_ROOT_PARTITION_BLOCK;
enum
{
@@ -140,7 +138,7 @@ enum
};
/// @brief Catalog type.
-struct PACKED NFS_CATALOG_STRUCT final
+struct PACKED NEFS_CATALOG_STRUCT final
{
BOOL ForkOrCatalog : 1 {0};
@@ -177,7 +175,7 @@ struct PACKED NFS_CATALOG_STRUCT final
/// @note The way we store is way different than how other filesystems do, specific chunk of code are
/// written into either the data fork or resource fork, the resource fork is reserved for file metadata.
/// whereas the data fork is reserved for file data.
-struct PACKED NFS_FORK_STRUCT final
+struct PACKED NEFS_FORK_STRUCT final
{
BOOL ForkOrCatalog : 1 {1};
@@ -201,10 +199,10 @@ struct PACKED NFS_FORK_STRUCT final
};
/// @brief Partition block type
-struct PACKED NFS_ROOT_PARTITION_BLOCK final
+struct PACKED NEFS_ROOT_PARTITION_BLOCK final
{
Kernel::Char Ident[kNeFSIdentLen] = {0};
- Kernel::Char PartitionName[kPartLen] = {0};
+ Kernel::Char PartitionName[kNeFSPartLen] = {0};
Kernel::Int32 Flags;
Kernel::Int32 Kind;
@@ -269,29 +267,29 @@ namespace Kernel
/// @param catalog it's catalog
/// @param theFork the fork itself.
/// @return the fork
- _Output BOOL CreateFork(_Input NFS_FORK_STRUCT& in);
+ _Output BOOL CreateFork(_Input NEFS_FORK_STRUCT& in);
/// @brief Find fork inside New filesystem.
/// @param catalog the catalog.
/// @param name the fork name.
/// @return the fork.
- _Output NFS_FORK_STRUCT* FindFork(_Input NFS_CATALOG_STRUCT* catalog,
+ _Output NEFS_FORK_STRUCT* FindFork(_Input NEFS_CATALOG_STRUCT* catalog,
_Input const Char* name,
Boolean data);
- _Output Void RemoveFork(_Input NFS_FORK_STRUCT* fork);
+ _Output Void RemoveFork(_Input NEFS_FORK_STRUCT* fork);
- _Output Void CloseFork(_Input NFS_FORK_STRUCT* fork);
+ _Output Void CloseFork(_Input NEFS_FORK_STRUCT* fork);
- _Output NFS_CATALOG_STRUCT* FindCatalog(_Input const Char* catalog_name, Lba& ou_lba, Bool search_hidden = YES, Bool local_search = NO);
+ _Output NEFS_CATALOG_STRUCT* FindCatalog(_Input const Char* catalog_name, Lba& ou_lba, Bool search_hidden = YES, Bool local_search = NO);
- _Output NFS_CATALOG_STRUCT* GetCatalog(_Input const Char* name);
+ _Output NEFS_CATALOG_STRUCT* GetCatalog(_Input const Char* name);
- _Output NFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name,
+ _Output NEFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name,
_Input const Int32& flags,
_Input const Int32& kind);
- _Output NFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name);
+ _Output NEFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name);
_Output Bool WriteCatalog(_Input const Char* catalog,
_Input Bool rsrc,
@@ -299,18 +297,18 @@ namespace Kernel
_Input SizeT sz,
_Input const Char* name);
- _Output VoidPtr ReadCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog,
+ _Output VoidPtr ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog,
_Input Bool isRsrcFork,
_Input SizeT dataSz,
_Input const Char* forkName);
- _Output Bool Seek(_Input _Output NFS_CATALOG_STRUCT* catalog, SizeT off);
+ _Output Bool Seek(_Input _Output NEFS_CATALOG_STRUCT* catalog, SizeT off);
- _Output SizeT Tell(_Input _Output NFS_CATALOG_STRUCT* catalog);
+ _Output SizeT Tell(_Input _Output NEFS_CATALOG_STRUCT* catalog);
_Output Bool RemoveCatalog(_Input const Char* catalog);
- _Output Bool CloseCatalog(_InOut NFS_CATALOG_STRUCT* catalog);
+ _Output Bool CloseCatalog(_InOut NEFS_CATALOG_STRUCT* catalog);
/// @brief Make a EPM+NeFS drive out of the disk.
/// @param drive The drive to write on.
@@ -339,7 +337,7 @@ namespace Kernel
class NeFileSystemJournal final
{
private:
- NFS_CATALOG_STRUCT* mNode{nullptr};
+ NEFS_CATALOG_STRUCT* mNode{nullptr};
public:
explicit NeFileSystemJournal(const char* stamp = nullptr)
@@ -408,7 +406,7 @@ namespace Kernel
!mNode)
return NO;
- NFS_FORK_STRUCT new_fork{};
+ NEFS_FORK_STRUCT new_fork{};
rt_copy_memory(mStamp, new_fork.CatalogName, rt_string_len(mStamp));
rt_copy_memory(journal_name, new_fork.ForkName, rt_string_len(journal_name));
diff --git a/dev/Kernel/HALKit/AMD64/Storage/SATA.cc b/dev/Kernel/HALKit/AMD64/Storage/SATA.cc
index e7971e19..26391340 100644
--- a/dev/Kernel/HALKit/AMD64/Storage/SATA.cc
+++ b/dev/Kernel/HALKit/AMD64/Storage/SATA.cc
@@ -67,8 +67,6 @@ static Kernel::Void drv_calculate_disk_geometry() noexcept
kout << "Disk Size: " << Kernel::number(drv_get_size()) << endl;
kout << "Highest Disk LBA: " << Kernel::number(kCurrentDiskSectorCount) << endl;
-
- while(1);
}
/// @brief Initializes an AHCI disk.
diff --git a/dev/Kernel/src/FS/NeFS+FileMgr.cc b/dev/Kernel/src/FS/NeFS+FileMgr.cc
index 1aa92f71..c7fdab14 100644
--- a/dev/Kernel/src/FS/NeFS+FileMgr.cc
+++ b/dev/Kernel/src/FS/NeFS+FileMgr.cc
@@ -168,8 +168,8 @@ namespace Kernel
NE_UNUSED(flags);
- if ((reinterpret_cast<NFS_CATALOG_STRUCT*>(node))->Kind == kNeFSCatalogKindFile)
- mParser->WriteCatalog(reinterpret_cast<NFS_CATALOG_STRUCT*>(node)->Name, (flags & kFileFlagRsrc ? true : false), data, size,
+ if ((reinterpret_cast<NEFS_CATALOG_STRUCT*>(node))->Kind == kNeFSCatalogKindFile)
+ mParser->WriteCatalog(reinterpret_cast<NEFS_CATALOG_STRUCT*>(node)->Name, (flags & kFileFlagRsrc ? true : false), data, size,
name);
}
@@ -186,8 +186,8 @@ namespace Kernel
NE_UNUSED(flags);
- if ((reinterpret_cast<NFS_CATALOG_STRUCT*>(node))->Kind == kNeFSCatalogKindFile)
- return mParser->ReadCatalog(reinterpret_cast<NFS_CATALOG_STRUCT*>(node), (flags & kFileFlagRsrc ? true : false), sz,
+ if ((reinterpret_cast<NEFS_CATALOG_STRUCT*>(node))->Kind == kNeFSCatalogKindFile)
+ return mParser->ReadCatalog(reinterpret_cast<NEFS_CATALOG_STRUCT*>(node), (flags & kFileFlagRsrc ? true : false), sz,
name);
return nullptr;
@@ -204,7 +204,7 @@ namespace Kernel
if (!node || off == 0)
return false;
- return mParser->Seek(reinterpret_cast<NFS_CATALOG_STRUCT*>(node), off);
+ return mParser->Seek(reinterpret_cast<NEFS_CATALOG_STRUCT*>(node), off);
}
/// @brief Tell where the catalog is.
@@ -217,7 +217,7 @@ namespace Kernel
if (!node)
return kNPos;
- return mParser->Tell(reinterpret_cast<NFS_CATALOG_STRUCT*>(node));
+ return mParser->Tell(reinterpret_cast<NEFS_CATALOG_STRUCT*>(node));
}
/// @brief Rewinds the catalog.
diff --git a/dev/Kernel/src/FS/NeFS.cc b/dev/Kernel/src/FS/NeFS.cc
index 418cc7cc..adceb429 100644
--- a/dev/Kernel/src/FS/NeFS.cc
+++ b/dev/Kernel/src/FS/NeFS.cc
@@ -61,7 +61,7 @@ STATIC MountpointInterface kMountpoint;
/// @param the_fork the fork itself.
/// @return the fork
/***********************************************************************************/
-_Output BOOL NeFileSystemParser::CreateFork(_Input NFS_FORK_STRUCT& the_fork)
+_Output BOOL NeFileSystemParser::CreateFork(_Input NEFS_FORK_STRUCT& the_fork)
{
if (the_fork.ForkName[0] != 0 &&
the_fork.CatalogName[0] != 0 &&
@@ -83,14 +83,14 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NFS_FORK_STRUCT& the_fork)
Lba lba_prev = lba;
- NFS_FORK_STRUCT prev_fork;
- NFS_FORK_STRUCT cur_fork;
+ NEFS_FORK_STRUCT prev_fork;
+ NEFS_FORK_STRUCT cur_fork;
/// do not check for anything. Loop until we get what we want, that is a free fork zone.
while (drv.fPacket.fPacketGood)
{
drv.fPacket.fPacketLba = lba;
- drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT);
+ drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT);
drv.fPacket.fPacketContent = &cur_fork;
drv.fInput(drv.fPacket);
@@ -120,7 +120,7 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NFS_FORK_STRUCT& the_fork)
if (lba >= kNeFSCatalogStartAddress)
{
drv.fPacket.fPacketLba = lba_prev;
- drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT);
+ drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT);
drv.fPacket.fPacketContent = &prev_fork;
prev_fork.NextSibling = lba;
@@ -134,12 +134,12 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NFS_FORK_STRUCT& the_fork)
}
the_fork.Flags |= kNeFSFlagCreated;
- the_fork.DataOffset = lba - sizeof(NFS_FORK_STRUCT);
+ the_fork.DataOffset = lba - sizeof(NEFS_FORK_STRUCT);
the_fork.PreviousSibling = lba_prev;
the_fork.NextSibling = the_fork.DataOffset - the_fork.DataSize;
drv.fPacket.fPacketLba = lba;
- drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT);
+ drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT);
drv.fPacket.fPacketContent = &the_fork;
kout << "Writing fork metadata...\r";
@@ -166,19 +166,19 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NFS_FORK_STRUCT& the_fork)
/// @param name the fork name.
/// @return the fork.
/***********************************************************************************/
-_Output NFS_FORK_STRUCT* NeFileSystemParser::FindFork(_Input NFS_CATALOG_STRUCT* catalog,
+_Output NEFS_FORK_STRUCT* NeFileSystemParser::FindFork(_Input NEFS_CATALOG_STRUCT* catalog,
_Input const Char* name,
Boolean isDataFork)
{
auto drive = kMountpoint.A();
- NFS_FORK_STRUCT* the_fork = nullptr;
+ NEFS_FORK_STRUCT* the_fork = nullptr;
Lba lba = isDataFork ? catalog->DataFork : catalog->ResourceFork;
while (lba != 0)
{
drive.fPacket.fPacketLba = lba;
- drive.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT);
+ drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT);
drive.fPacket.fPacketContent = (VoidPtr)the_fork;
rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, 16);
@@ -221,7 +221,7 @@ _Output NFS_FORK_STRUCT* NeFileSystemParser::FindFork(_Input NFS_CATALOG_STRUCT*
/// @param name
/// @return catalog pointer.
/***********************************************************************************/
-_Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name)
+_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name)
{
return this->CreateCatalog(name, 0, kNeFSCatalogKindFile);
}
@@ -233,7 +233,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
/// @param kind the catalog kind.
/// @return catalog pointer.
/***********************************************************************************/
-_Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name,
+_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name,
_Input const Int32& flags,
_Input const Int32& kind)
{
@@ -253,7 +253,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
name[rt_string_len(name) - 1] == NeFileSystemHelper::Separator())
return nullptr;
- NFS_CATALOG_STRUCT* catalog_copy = this->FindCatalog(name, out_lba);
+ NEFS_CATALOG_STRUCT* catalog_copy = this->FindCatalog(name, out_lba);
if (catalog_copy)
{
@@ -301,7 +301,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
--index_reverse_copy;
}
- NFS_CATALOG_STRUCT* catalog = this->FindCatalog(parent_name, out_lba);
+ NEFS_CATALOG_STRUCT* catalog = this->FindCatalog(parent_name, out_lba);
auto drive = kMountpoint.A();
@@ -316,19 +316,19 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
}
else if (!catalog)
{
- Char part_block[sizeof(NFS_ROOT_PARTITION_BLOCK)] = {0};
+ Char part_block[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0};
drive.fPacket.fPacketContent = part_block;
- drive.fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK);
+ drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK);
drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress;
drive.fInput(drive.fPacket);
- NFS_ROOT_PARTITION_BLOCK* blk_nefs = (NFS_ROOT_PARTITION_BLOCK*)part_block;
+ NEFS_ROOT_PARTITION_BLOCK* blk_nefs = (NEFS_ROOT_PARTITION_BLOCK*)part_block;
out_lba = blk_nefs->StartCatalog;
}
- NFS_CATALOG_STRUCT* child_catalog = new NFS_CATALOG_STRUCT();
+ NEFS_CATALOG_STRUCT* child_catalog = new NEFS_CATALOG_STRUCT();
child_catalog->ResourceForkSize = 0UL;
child_catalog->DataForkSize = 0UL;
@@ -342,25 +342,25 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
rt_copy_memory((VoidPtr)name, (VoidPtr)child_catalog->Name,
rt_string_len(name));
- NFS_CATALOG_STRUCT temporary_catalog{};
+ NEFS_CATALOG_STRUCT temporary_catalog{};
Lba start_free = out_lba;
rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime,
rt_string_len("fs/nefs-packet"));
- Char buf_part_block[sizeof(NFS_ROOT_PARTITION_BLOCK)] = {0};
+ Char buf_part_block[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0};
drive.fPacket.fPacketContent = buf_part_block;
- drive.fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK);
+ drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK);
drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress;
drive.fInput(drive.fPacket);
- NFS_ROOT_PARTITION_BLOCK* part_block = (NFS_ROOT_PARTITION_BLOCK*)buf_part_block;
+ NEFS_ROOT_PARTITION_BLOCK* part_block = (NEFS_ROOT_PARTITION_BLOCK*)buf_part_block;
drive.fPacket.fPacketContent = &temporary_catalog;
- drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT);
+ drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT);
drive.fPacket.fPacketLba = start_free;
drive.fInput(drive.fPacket);
@@ -381,10 +381,10 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
if ((temporary_catalog.Flags & kNeFSFlagCreated) == 0)
{
child_catalog->NextSibling =
- start_free + (sizeof(NFS_CATALOG_STRUCT) * kNeFSCatalogPadding);
+ start_free + (sizeof(NEFS_CATALOG_STRUCT) * kNeFSCatalogPadding);
drive.fPacket.fPacketContent = &temporary_catalog;
- drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT);
+ drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT);
drive.fPacket.fPacketLba = start_free;
drive.fOutput(drive.fPacket);
@@ -393,7 +393,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
child_catalog->ResourceFork = child_catalog->DataFork;
drive.fPacket.fPacketContent = child_catalog;
- drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT);
+ drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT);
drive.fPacket.fPacketLba = start_free;
drive.fOutput(drive.fPacket);
@@ -401,7 +401,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
// Get NeFS partition's block.
drive.fPacket.fPacketContent = buf_part_block;
- drive.fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK);
+ drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK);
drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress;
drive.fInput(drive.fPacket);
@@ -420,23 +420,23 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
delete catalog;
catalog = nullptr;
- NFS_CATALOG_STRUCT* found_catalog = new NFS_CATALOG_STRUCT();
- rt_copy_memory(&temporary_catalog, found_catalog, sizeof(NFS_CATALOG_STRUCT));
+ NEFS_CATALOG_STRUCT* found_catalog = new NEFS_CATALOG_STRUCT();
+ rt_copy_memory(&temporary_catalog, found_catalog, sizeof(NEFS_CATALOG_STRUCT));
return found_catalog;
}
else if ((temporary_catalog.Flags & kNeFSFlagCreated) &&
StringBuilder::Equals(temporary_catalog.Name, name))
{
- rt_copy_memory(&temporary_catalog, child_catalog, sizeof(NFS_CATALOG_STRUCT));
+ rt_copy_memory(&temporary_catalog, child_catalog, sizeof(NEFS_CATALOG_STRUCT));
return child_catalog;
}
- start_free = start_free + (sizeof(NFS_CATALOG_STRUCT) * kNeFSCatalogPadding);
+ start_free = start_free + (sizeof(NEFS_CATALOG_STRUCT) * kNeFSCatalogPadding);
drive.fPacket.fPacketContent = &temporary_catalog;
- drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT);
+ drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT);
drive.fPacket.fPacketLba = start_free;
drive.fInput(drive.fPacket);
@@ -469,12 +469,12 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L
return false;
}
- Char fs_buf[sizeof(NFS_ROOT_PARTITION_BLOCK)] = {0};
+ Char fs_buf[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0};
Lba start = kNeFSRootCatalogStartAddress;
drive->fPacket.fPacketContent = fs_buf;
- drive->fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK);
+ drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK);
drive->fPacket.fPacketLba = start;
drive->fInput(&drive->fPacket);
@@ -546,7 +546,7 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L
// disk isnt faulty and data has been fetched.
while (drive->fPacket.fPacketGood)
{
- NFS_ROOT_PARTITION_BLOCK* part_block = (NFS_ROOT_PARTITION_BLOCK*)fs_buf;
+ NEFS_ROOT_PARTITION_BLOCK* part_block = (NEFS_ROOT_PARTITION_BLOCK*)fs_buf;
// check for an empty partition here.
if (part_block->PartitionName[0] == 0 &&
@@ -572,13 +572,13 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L
part_block->Kind = kNeFSPartitionTypeStandard;
part_block->StartCatalog = kNeFSCatalogStartAddress;
part_block->Flags = kNeFSPartitionTypeStandard;
- part_block->CatalogCount = sectorCount / sizeof(NFS_CATALOG_STRUCT);
+ part_block->CatalogCount = sectorCount / sizeof(NEFS_CATALOG_STRUCT);
part_block->SectorCount = sectorCount;
part_block->DiskSize = diskSize;
- part_block->FreeCatalog = sectorCount / sizeof(NFS_CATALOG_STRUCT);
+ part_block->FreeCatalog = sectorCount / sizeof(NEFS_CATALOG_STRUCT);
drive->fPacket.fPacketContent = fs_buf;
- drive->fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK);
+ drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK);
drive->fPacket.fPacketLba = kNeFSRootCatalogStartAddress;
drive->fOutput(&drive->fPacket);
@@ -603,7 +603,7 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L
start += part_block->DiskSize;
drive->fPacket.fPacketContent = fs_buf;
- drive->fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK);
+ drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK);
drive->fPacket.fPacketLba = start;
drive->fInput(&drive->fPacket);
@@ -647,8 +647,8 @@ bool NeFileSystemParser::WriteCatalog(_Input const Char* catalog_name, Bool is_r
delete catalog;
catalog = nullptr;
- NFS_FORK_STRUCT* fork_data_input = new NFS_FORK_STRUCT();
- NFS_FORK_STRUCT prev_fork{};
+ NEFS_FORK_STRUCT* fork_data_input = new NEFS_FORK_STRUCT();
+ NEFS_FORK_STRUCT prev_fork{};
kout << hex_number(startFork) << endl;
@@ -656,7 +656,7 @@ bool NeFileSystemParser::WriteCatalog(_Input const Char* catalog_name, Bool is_r
while (startFork >= kNeFSCatalogStartAddress)
{
drive.fPacket.fPacketContent = fork_data_input;
- drive.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT);
+ drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT);
drive.fPacket.fPacketLba = startFork;
drive.fInput(drive.fPacket);
@@ -710,7 +710,7 @@ bool NeFileSystemParser::WriteCatalog(_Input const Char* catalog_name, Bool is_r
/// @brief
/// @param catalog_name the catalog name.
/// @return the newly found catalog.
-_Output NFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* catalog_name,
+_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* catalog_name,
Lba& out_lba,
Bool search_hidden,
Bool local_search)
@@ -719,14 +719,14 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* c
*catalog_name == 0)
return nullptr;
- NFS_ROOT_PARTITION_BLOCK part{0};
+ NEFS_ROOT_PARTITION_BLOCK part{0};
auto& drive = kMountpoint.A();
rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime,
rt_string_len("fs/nefs-packet"));
drive.fPacket.fPacketContent = &part;
- drive.fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK);
+ drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK);
drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress;
drive.fInput(drive.fPacket);
@@ -757,7 +757,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* c
--indexReverseCopy;
}
- NFS_CATALOG_STRUCT* parent_catalog = this->FindCatalog(parent_name, out_lba);
+ NEFS_CATALOG_STRUCT* parent_catalog = this->FindCatalog(parent_name, out_lba);
if (parent_catalog &&
!StringBuilder::Equals(parent_name, NeFileSystemHelper::Root()))
@@ -784,14 +784,14 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* c
}
}
- NFS_CATALOG_STRUCT temporary_catalog{};
+ NEFS_CATALOG_STRUCT temporary_catalog{};
kNeFSSearchThroughCatalogList:
while (YES)
{
drive.fPacket.fPacketLba = start_catalog_lba;
drive.fPacket.fPacketContent = &temporary_catalog;
- drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT);
+ drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT);
drive.fInput(drive.fPacket);
@@ -816,8 +816,8 @@ kNeFSSearchThroughCatalogList:
kout << "Found available catalog at: " << hex_number(start_catalog_lba) << endl;
kout << "Found available catalog at: " << temporary_catalog.Name << endl;
- NFS_CATALOG_STRUCT* catalog_ptr = new NFS_CATALOG_STRUCT();
- rt_copy_memory(&temporary_catalog, catalog_ptr, sizeof(NFS_CATALOG_STRUCT));
+ NEFS_CATALOG_STRUCT* catalog_ptr = new NEFS_CATALOG_STRUCT();
+ rt_copy_memory(&temporary_catalog, catalog_ptr, sizeof(NEFS_CATALOG_STRUCT));
out_lba = start_catalog_lba;
return catalog_ptr;
@@ -848,7 +848,7 @@ kNeFSSearchThroughCatalogList:
/// @brief Get catalog from filesystem.
/// @param name the catalog's name/
/// @return
-_Output NFS_CATALOG_STRUCT* NeFileSystemParser::GetCatalog(_Input const Char* name)
+_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::GetCatalog(_Input const Char* name)
{
Lba unused = 0;
return this->FindCatalog(name, unused, YES);
@@ -857,7 +857,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::GetCatalog(_Input const Char* na
/// @brief Closes a catalog, (frees it).
/// @param catalog the catalog to close.
/// @return
-Boolean NeFileSystemParser::CloseCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog)
+Boolean NeFileSystemParser::CloseCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog)
{
if (!catalog)
return false;
@@ -896,21 +896,21 @@ Boolean NeFileSystemParser::RemoveCatalog(_Input const Char* catalog_name)
drive.fPacket.fPacketLba = out_lba; // the catalog position.
drive.fPacket.fPacketSize =
- sizeof(NFS_CATALOG_STRUCT); // size of catalog. roughly the sector size.
+ sizeof(NEFS_CATALOG_STRUCT); // size of catalog. roughly the sector size.
drive.fPacket.fPacketContent = catalog; // the catalog itself.
drive.fOutput(drive.fPacket); // send packet.
- Char partitionBlockBuf[sizeof(NFS_ROOT_PARTITION_BLOCK)] = {0};
+ Char partitionBlockBuf[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0};
drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress;
drive.fPacket.fPacketContent = partitionBlockBuf;
- drive.fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK);
+ drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK);
drive.fInput(drive.fPacket);
- NFS_ROOT_PARTITION_BLOCK* part_block =
- reinterpret_cast<NFS_ROOT_PARTITION_BLOCK*>(partitionBlockBuf);
+ NEFS_ROOT_PARTITION_BLOCK* part_block =
+ reinterpret_cast<NEFS_ROOT_PARTITION_BLOCK*>(partitionBlockBuf);
--part_block->CatalogCount;
++part_block->FreeSectors;
@@ -937,7 +937,7 @@ Boolean NeFileSystemParser::RemoveCatalog(_Input const Char* catalog_name)
/// @return
/***********************************************************************************/
-VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog,
+VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog,
_Input Bool is_rsrc_fork,
_Input SizeT dataSz,
_Input const Char* forkName)
@@ -954,18 +954,18 @@ VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NFS_CATALOG_STRUCT* catal
kout << "catalog " << catalog->Name
<< ", fork: " << hex_number(dataForkLba) << endl;
- NFS_FORK_STRUCT* fs_buf = new NFS_FORK_STRUCT();
+ NEFS_FORK_STRUCT* fs_buf = new NEFS_FORK_STRUCT();
auto drive = kMountpoint.A();
rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime,
rt_string_len("fs/nefs-packet"));
- NFS_FORK_STRUCT* fs_fork_data = nullptr;
+ NEFS_FORK_STRUCT* fs_fork_data = nullptr;
while (dataForkLba > kNeFSCatalogStartAddress)
{
drive.fPacket.fPacketLba = dataForkLba;
- drive.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT);
+ drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT);
drive.fPacket.fPacketContent = fs_buf;
drive.fInput(drive.fPacket);
@@ -998,7 +998,7 @@ VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NFS_CATALOG_STRUCT* catal
/// @return if the seeking was successful.
/***********************************************************************************/
-bool NeFileSystemParser::Seek(_Input _Output NFS_CATALOG_STRUCT* catalog, SizeT off)
+bool NeFileSystemParser::Seek(_Input _Output NEFS_CATALOG_STRUCT* catalog, SizeT off)
{
err_global_get() = kErrorUnimplemented;
return false;
@@ -1010,7 +1010,7 @@ bool NeFileSystemParser::Seek(_Input _Output NFS_CATALOG_STRUCT* catalog, SizeT
/// @return The position on the file.
/***********************************************************************************/
-SizeT NeFileSystemParser::Tell(_Input _Output NFS_CATALOG_STRUCT* catalog)
+SizeT NeFileSystemParser::Tell(_Input _Output NEFS_CATALOG_STRUCT* catalog)
{
err_global_get() = kErrorUnimplemented;
return 0;