diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-14 18:35:05 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-14 18:39:11 +0200 |
| commit | f8aaa274535b6541f376090958eedbbba3ba00ba (patch) | |
| tree | 420a4d41f339ac6e6f083099390dddcf59922cab /dev/kernel/src/FS/NeFS+FileSystemParser.cc | |
| parent | 2b91067c894efde74e96fd9216598a5782699c7b (diff) | |
feat(kernel): Filesystem fixes, and others.
what?
- Add simple generic RTL8139 NIC driver, to be used within a NK device.
- Update IVT accordingly.
- Comment ARM's AP GIC init function, to tell what it's actually doing.
- Cleanup Kernel Main, removed the useless pre_init_scheduler function.
- Prepare new FileMgr with HeFileSystemMgr.
- Fallback to NeFS when trying to format a fileysstem.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/src/FS/NeFS+FileSystemParser.cc')
| -rw-r--r-- | dev/kernel/src/FS/NeFS+FileSystemParser.cc | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/dev/kernel/src/FS/NeFS+FileSystemParser.cc b/dev/kernel/src/FS/NeFS+FileSystemParser.cc index 0b818bbb..49673b59 100644 --- a/dev/kernel/src/FS/NeFS+FileSystemParser.cc +++ b/dev/kernel/src/FS/NeFS+FileSystemParser.cc @@ -444,6 +444,8 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const I NEFS_ROOT_PARTITION_BLOCK* part_block = (NEFS_ROOT_PARTITION_BLOCK*) fs_buf; + if (rt_string_cmp(kNeFSIdent, part_block->Ident, kNeFSIdentLen) == 0) return true; + const auto kNeFSUntitledHD = part_name; rt_copy_memory((VoidPtr) kNeFSIdent, (VoidPtr) part_block->Ident, kNeFSIdentLen); @@ -463,6 +465,7 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const I part_block->FreeSectors = sectorCount / sizeof(NEFS_CATALOG_STRUCT) - 1; part_block->SectorCount = sectorCount; part_block->DiskSize = diskSize; + part_block->SectorSize = drive->fSectorSz; part_block->FreeCatalog = sectorCount / sizeof(NEFS_CATALOG_STRUCT) - 1; drive->fPacket.fPacketContent = fs_buf; @@ -479,26 +482,6 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const I (Void)(kout << "Free sectors: " << hex_number(part_block->FreeSectors) << kendl); (Void)(kout << "Sector size: " << hex_number(part_block->SectorSize) << kendl); - NEFS_CATALOG_STRUCT root{}; - - rt_set_memory(&root, 0, sizeof(NEFS_CATALOG_STRUCT)); - - root.PrevSibling = part_block->StartCatalog; - root.NextSibling = 0UL; - - root.Kind = kNeFSCatalogKindDir; - root.Flags |= kNeFSFlagCreated; - root.CatalogFlags |= kNeFSStatusUnlocked; - - root.Name[0] = '/'; - root.Name[1] = 0; - - drive->fPacket.fPacketLba = part_block->StartCatalog; - drive->fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); - drive->fPacket.fPacketContent = &root; - - drive->fOutput(drive->fPacket); - return true; } |
