summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Sources
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-30 10:04:19 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-30 10:04:19 +0200
commit5229ca8ae190c0cb3db8d381a44be4113e81d5dc (patch)
tree03af438c8ae325294e801adb6ee6aa80430d30cb /dev/ZKA/Sources
parentd87eb24271671f4d7d1298c6c4bbdf4e73f774f3 (diff)
A lot of filesystem improvements.
+ Save NextSibling field if catalog name, has parent name in it. + Upgrade NewFS to 1.28. + Fix strcmp inside Support.cxx + BootKit formatter can update the partition now, but only if NewFS. + Fix broken logging window.
Diffstat (limited to 'dev/ZKA/Sources')
-rw-r--r--dev/ZKA/Sources/DLLMain.cxx4
-rw-r--r--dev/ZKA/Sources/FS/NewFS.cxx22
2 files changed, 14 insertions, 12 deletions
diff --git a/dev/ZKA/Sources/DLLMain.cxx b/dev/ZKA/Sources/DLLMain.cxx
index a82d0b97..8562ba09 100644
--- a/dev/ZKA/Sources/DLLMain.cxx
+++ b/dev/ZKA/Sources/DLLMain.cxx
@@ -90,7 +90,7 @@ namespace Kernel::Detail
kNewFSCatalogKindDir);
CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.dll: Catalog directory has been created: ", 10 + (10 * (dirIndx + 1)), 10, RGB(0, 0, 0));
- CG::CGDrawStringToWnd(cKernelWnd, catalogDir->Name, 10 + (10 * (dirIndx + 1)), 10 + (FONT_SIZE_X * rt_string_len("newoskrnl.dll: Catalog has been created: ")), RGB(0, 0, 0));
+ CG::CGDrawStringToWnd(cKernelWnd, catalogDir->Name, 10 + (10 * (dirIndx + 1)), 10 + (FONT_SIZE_X * rt_string_len("newoskrnl.dll: Catalog directory has been created: ")), RGB(0, 0, 0));
delete catalogDir;
}
@@ -211,7 +211,7 @@ EXTERN_C Kernel::Void ke_dll_entrypoint(Kernel::Void)
CG::CGDrawStringToWnd(cKernelWnd, kSysDrv, 20, 10 + (FONT_SIZE_X * Kernel::rt_string_len("newoskrnl.dll: Missing catalog: ")), RGB(0, 0, 0));
}
- CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.dll: Starting the scheduler...", 30, 10, RGB(0, 0, 0));
+ CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.dll: Starting ZKA...", 30, 10, RGB(0, 0, 0));
while (Yes)
{
diff --git a/dev/ZKA/Sources/FS/NewFS.cxx b/dev/ZKA/Sources/FS/NewFS.cxx
index cdf9d6a4..5406f91c 100644
--- a/dev/ZKA/Sources/FS/NewFS.cxx
+++ b/dev/ZKA/Sources/FS/NewFS.cxx
@@ -63,7 +63,7 @@ _Output NFS_FORK_STRUCT* NewFSParser::CreateFork(_Input NFS_CATALOG_STRUCT* cata
_Input NFS_FORK_STRUCT& theFork)
{
if (catalog && theFork.ForkName[0] != 0 &&
- theFork.DataSize <= kNewFSForkSz)
+ theFork.DataSize <= kNewFSForkSz)
{
Lba lba = (theFork.Kind == kNewFSDataForkKind) ? catalog->DataFork
: catalog->ResourceFork;
@@ -381,7 +381,7 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::CreateCatalog(_Input const Char* name,
}
// ========================== //
- // allocate catalog now...
+ // Allocate catalog now...
// ========================== //
if ((nextSibling->Flags & kNewFSFlagCreated) == 0)
{
@@ -406,10 +406,13 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::CreateCatalog(_Input const Char* name,
catalogChild->DataFork = partBlock->DiskSize - start_free;
catalogChild->ResourceFork = catalogChild->DataFork;
- catalogChild->NextSibling =
- start_free + (sizeof(NFS_CATALOG_STRUCT) * cNewFSCatalogPadding);
-
- // write the new catalog.
+ // Write the new catalog next sibling, if we don't know this parent. //
+ // This is necessary, so that we don't have to get another lba to allocate. //
+ if (!StringBuilder::Equals(parentName, nextSibling->Name))
+ {
+ catalogChild->NextSibling =
+ start_free + (sizeof(NFS_CATALOG_STRUCT) * cNewFSCatalogPadding);
+ }
drive.fPacket.fPacketContent = catalogChild;
drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT);
@@ -417,7 +420,7 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::CreateCatalog(_Input const Char* name,
drive.fOutput(&drive.fPacket);
- // get newfs part block.
+ // Get NewFS partition's block.
drive.fPacket.fPacketContent = sectorBufPartBlock;
drive.fPacket.fPacketSize = kNewFSSectorSz;
@@ -425,10 +428,9 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::CreateCatalog(_Input const Char* name,
drive.fInput(&drive.fPacket);
- partBlock->SectorCount -= 1;
+ partBlock->FreeSectors -= 1;
partBlock->CatalogCount += 1;
partBlock->FreeCatalog -= 1;
- partBlock->FreeCatalog = catalogChild->NextSibling;
drive.fOutput(&drive.fPacket);
@@ -904,8 +906,8 @@ Boolean NewFSParser::RemoveCatalog(_Input const Char* catalogName)
NFS_ROOT_PARTITION_BLOCK* partBlock =
reinterpret_cast<NFS_ROOT_PARTITION_BLOCK*>(partitionBlockBuf);
- ++partBlock->FreeCatalog;
--partBlock->CatalogCount;
+ ++partBlock->FreeSectors;
drive.fOutput(&drive.fPacket);