diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-03 15:25:06 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-03 15:25:06 +0100 |
| commit | bf2fc74c6552f9359955210c8f60e45308ae1d31 (patch) | |
| tree | 903ea813d3ef69b7c5c3a45bc7268fc990d6b191 /dev/Kernel | |
| parent | 4be14ab92ed6456e6d5bec5777fe7df5738112e7 (diff) | |
IMPL: Work In Progress efforts in Journaling and SysChk.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel')
| -rw-r--r-- | dev/Kernel/FSKit/NeFS.h | 28 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc | 2 | ||||
| -rw-r--r-- | dev/Kernel/src/FS/NeFS.cc | 5 | ||||
| -rw-r--r-- | dev/Kernel/src/KernelMain.cc | 4 |
4 files changed, 31 insertions, 8 deletions
diff --git a/dev/Kernel/FSKit/NeFS.h b/dev/Kernel/FSKit/NeFS.h index 2468fd16..78177e07 100644 --- a/dev/Kernel/FSKit/NeFS.h +++ b/dev/Kernel/FSKit/NeFS.h @@ -380,13 +380,37 @@ namespace Kernel return NO; } - Bool Commit(NeFileSystemParser* parser, + Bool ReleaseJournal() + { + if (mNode) + { + delete mNode; + mNode = nullptr; + return YES; + } + + return NO; + } + + Bool CommitJournal(NeFileSystemParser* parser, KString xml_data, KString journal_name) { - if (!parser) + if (!parser || + !mNode) return NO; + NFS_FORK_STRUCT new_fork{}; + + rt_copy_memory(mNode->Name, new_fork.CatalogName, rt_string_len(mNode->Name)); + rt_copy_memory(journal_name.Data(), new_fork.ForkName, rt_string_len(journal_name.Data())); + + new_fork.DataSize = xml_data.Length(); + + new_fork.Kind = kNeFSRsrcForkKind; + + parser->CreateFork(mNode, new_fork); + return parser->WriteCatalog(mNode, YES, xml_data.Data(), xml_data.Length(), journal_name.CData()); } diff --git a/dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc b/dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc index 55a3a4b9..081ce0b2 100644 --- a/dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc +++ b/dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc @@ -155,7 +155,7 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); diff --git a/dev/Kernel/src/FS/NeFS.cc b/dev/Kernel/src/FS/NeFS.cc index b5eb25e7..f188db43 100644 --- a/dev/Kernel/src/FS/NeFS.cc +++ b/dev/Kernel/src/FS/NeFS.cc @@ -85,11 +85,8 @@ _Output NFS_FORK_STRUCT* NeFileSystemParser::CreateFork(_Input NFS_CATALOG_STRUC Lba lbaOfPreviousFork = lba; /// do not check for anything. Loop until we get what we want, that is a free fork zone. - while (true) + while (lba <= kNeFSCatalogStartAddress) { - if (lba <= kNeFSCatalogStartAddress) - break; - drv.fPacket.fPacketLba = lba; drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); drv.fPacket.fPacketContent = &curFork; diff --git a/dev/Kernel/src/KernelMain.cc b/dev/Kernel/src/KernelMain.cc index 3a123e1b..58592a10 100644 --- a/dev/Kernel/src/KernelMain.cc +++ b/dev/Kernel/src/KernelMain.cc @@ -68,13 +68,15 @@ namespace Kernel::Detail } mJournal.CreateJournal(mNeFS); + KString xml; xml += "<LOG_XML>Formatted Filesystem</LOG_XML>"; KString name; name += "FORMAT"; - mJournal.Commit(mNeFS, xml, name); + mJournal.CommitJournal(mNeFS, xml, name); + mJournal.ReleaseJournal(); } } |
