diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-11-21 15:48:03 +0100 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-11-21 15:48:03 +0100 |
| commit | 779b66cef292e1b52bce4599c9dfe1e0c10858eb (patch) | |
| tree | 8011852695f113c012315514986f6428f06b2155 /dev | |
| parent | dc008570233d0dbfac32eb87367b7e4a08302e32 (diff) | |
IMP: Improvements over the microkernel, did lots of refactors.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/ZKAKit/KernelKit/DriveMgr.h | 39 | ||||
| -rw-r--r-- | dev/ZKAKit/KernelKit/FileMgr.h | 93 | ||||
| -rw-r--r-- | dev/ZKAKit/KernelKit/User.h | 6 | ||||
| -rw-r--r-- | dev/ZKAKit/src/DriveMgr.cc | 32 | ||||
| -rw-r--r-- | dev/ZKAKit/src/FS/NeFS.cc | 50 | ||||
| -rw-r--r-- | dev/ZKAKit/src/Storage/ATADeviceInterface.cc | 4 | ||||
| -rw-r--r-- | dev/ZKAKit/src/UserProcessScheduler.cc | 6 |
7 files changed, 121 insertions, 109 deletions
diff --git a/dev/ZKAKit/KernelKit/DriveMgr.h b/dev/ZKAKit/KernelKit/DriveMgr.h index 204e90b2..f96a35ff 100644 --- a/dev/ZKAKit/KernelKit/DriveMgr.h +++ b/dev/ZKAKit/KernelKit/DriveMgr.h @@ -4,8 +4,8 @@ ------------------------------------------- */ -#ifndef __INC_DRIVE_MANAGER_H__ -#define __INC_DRIVE_MANAGER_H__ +#ifndef INC_DRIVE_MANAGER_H +#define INC_DRIVE_MANAGER_H #include <KernelKit/UserProcessScheduler.h> #include <CompilerKit/CompilerKit.h> @@ -16,25 +16,28 @@ #include <NewKit/KString.h> #include <NewKit/Ref.h> -#define kMaxDriveCountPerMountpoint (4U) +#define kDriveMaxCount (4U) #define kDriveSectorSz (512U) #define kDriveInvalidID (-1) #define kDriveNameLen (32) -#define DrvSectorCnt(SIZE, SECTOR_SZ) (((SIZE) + (SECTOR_SZ)) / (SECTOR_SZ)) +#define drv_sector_cnt(SIZE, SECTOR_SZ) (((SIZE) + (SECTOR_SZ)) / (SECTOR_SZ)) namespace Kernel { enum { - /// Storage type. - kInvalidStorage = -1, + kInvalidDisc = -1, + + /// Storage types, combine with flags. kBlockDevice = 0xAD, - kMassStorage = 0xDA, + kMassStorageDisc = 0xDA, kFloppyDisc = 0xCD, kOpticalDisc = 0xDC, // CD-ROM/DVD-ROM/Blu-Ray - /// Storage flags, combine with below. - kReadOnly = 0x10, // Read only drive + kTapeDisc = 0xD7, + + /// Storage flags, combine with types. + kReadOnlyDrive = 0x10, // Read only drive kEPMDrive = 0x11, // Explicit Partition Map. kEPTDrive = 0x12, // ESP w/ EPM partition. kMBRDrive = 0x13, // PC classic partition scheme @@ -43,25 +46,23 @@ namespace Kernel kStorageCount = 9, }; - typedef Int64 rt_drive_id_type; - /// @brief Media drive trait type. struct DriveTrait final { Char fName[kDriveNameLen]; // /System, /Boot, //./Devices/USB... Int32 fKind; // fMassStorage, fFloppy, fOpticalDisc. - rt_drive_id_type fId; // Drive id. Int32 fFlags; // fReadOnly, fXPMDrive, fXPTDrive /// @brief Packet drive (StorageKit compilant.) struct DrivePacket final { - VoidPtr fPacketContent; //! packet body. - Char fPacketMime[kDriveNameLen]; //! identify what we're sending. - SizeT fPacketSize; //! packet size - UInt32 fPacketCRC32; //! sanity crc, in case if good is set to false - Boolean fPacketGood; - Lba fLba; + VoidPtr fPacketContent{nullptr}; //! packet body. + Char fPacketMime[kDriveNameLen] = "*/*"; //! identify what we're sending. + SizeT fPacketSize{0UL}; //! packet size + UInt32 fPacketCRC32{0UL}; //! sanity crc, in case if good is set to false + Boolean fPacketGood{YES}; + Lba fPacketLba{0UL}; + Boolean fPacketReadOnly{NO}; } fPacket; Void (*fInput)(DrivePacket* packetPtr); @@ -153,4 +154,4 @@ namespace Kernel DriveTrait io_construct_main_drive(void) noexcept; } // namespace Kernel -#endif /* ifndef __INC_DRIVE_MANAGER_H__ */ +#endif /* ifndef INC_DRIVE_MANAGER_H */ diff --git a/dev/ZKAKit/KernelKit/FileMgr.h b/dev/ZKAKit/KernelKit/FileMgr.h index 9a283e9d..9b05fb09 100644 --- a/dev/ZKAKit/KernelKit/FileMgr.h +++ b/dev/ZKAKit/KernelKit/FileMgr.h @@ -17,7 +17,8 @@ ------------------------------------------- */ -#pragma once +#ifndef INC_FILEMGR_H +#define INC_FILEMGR_H #ifdef __FSKIT_INCLUDES_NEFS__ #include <FSKit/NeFS.h> @@ -210,10 +211,10 @@ namespace Kernel public: ErrorOr<Int64> WriteAll(const VoidPtr data) noexcept { - if (this->fFileRestrict != eRestrictReadWrite && - this->fFileRestrict != eRestrictReadWriteBinary && - this->fFileRestrict != eRestrictWrite && - this->fFileRestrict != eRestrictWriteBinary) + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictWrite && + this->fFileRestrict != kFileMgrRestrictWriteBinary) return ErrorOr<Int64>(kErrorInvalidData); if (data == nullptr) @@ -232,10 +233,10 @@ namespace Kernel VoidPtr ReadAll() noexcept { - if (this->fFileRestrict != eRestrictReadWrite && - this->fFileRestrict != eRestrictReadWriteBinary && - this->fFileRestrict != eRestrictRead && - this->fFileRestrict != eRestrictReadBinary) + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictRead && + this->fFileRestrict != kFileMgrRestrictReadBinary) return nullptr; auto man = FSClass::GetMounted(); @@ -251,10 +252,10 @@ namespace Kernel ErrorOr<Int64> WriteAll(const Char* fName, const VoidPtr data) noexcept { - if (this->fFileRestrict != eRestrictReadWrite && - this->fFileRestrict != eRestrictReadWriteBinary && - this->fFileRestrict != eRestrictWrite && - this->fFileRestrict != eRestrictWriteBinary) + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictWrite && + this->fFileRestrict != kFileMgrRestrictWriteBinary) return ErrorOr<Int64>(kErrorInvalidData); if (data == nullptr) @@ -273,10 +274,10 @@ namespace Kernel VoidPtr Read(const Char* fName) noexcept { - if (this->fFileRestrict != eRestrictReadWrite && - this->fFileRestrict != eRestrictReadWriteBinary && - this->fFileRestrict != eRestrictRead && - this->fFileRestrict != eRestrictReadBinary) + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictRead && + this->fFileRestrict != kFileMgrRestrictReadBinary) return nullptr; auto man = FSClass::GetMounted(); @@ -292,10 +293,10 @@ namespace Kernel VoidPtr Read(SizeT offset, SizeT sz) { - if (this->fFileRestrict != eRestrictReadWrite && - this->fFileRestrict != eRestrictReadWriteBinary && - this->fFileRestrict != eRestrictRead && - this->fFileRestrict != eRestrictReadBinary) + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictRead && + this->fFileRestrict != kFileMgrRestrictReadBinary) return nullptr; auto man = FSClass::GetMounted(); @@ -313,10 +314,10 @@ namespace Kernel Void Write(SizeT offset, voidPtr data, SizeT sz) { - if (this->fFileRestrict != eRestrictReadWrite && - this->fFileRestrict != eRestrictReadWriteBinary && - this->fFileRestrict != eRestrictWrite && - this->fFileRestrict != eRestrictWriteBinary) + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictWrite && + this->fFileRestrict != kFileMgrRestrictWriteBinary) return; auto man = FSClass::GetMounted(); @@ -340,22 +341,22 @@ namespace Kernel /// @return The MIME. Char* MIME() noexcept { - return const_cast<char*>(fMime); + return const_cast<Char*>(fMime); } enum { - eRestrictRead, - eRestrictReadBinary, - eRestrictWrite, - eRestrictWriteBinary, - eRestrictReadWrite, - eRestrictReadWriteBinary, + kFileMgrRestrictRead, + kFileMgrRestrictReadBinary, + kFileMgrRestrictWrite, + kFileMgrRestrictWriteBinary, + kFileMgrRestrictReadWrite, + kFileMgrRestrictReadWriteBinary, }; private: NodePtr fFile{nullptr}; - Int32 fFileRestrict{}; + Int32 fFileRestrict{kFileMgrRestrictReadBinary | kFileMgrRestrictRead}; const Char* fMime{kFileMimeGeneric}; }; @@ -370,37 +371,37 @@ namespace Kernel const Encoding* restrict_type) : fFile(Class::GetMounted()->Open(path, restrict_type)) { - static const auto cLength = 255; + static const auto kLength = 255U; /// @brief restrict information about the file descriptor. - struct RESTRICT_MAP final + struct FileRestrictKind final { - Char fRestrict[cLength]; - Int32 fMappedTo; + Char fRestrict[kLength] = ""; + Int32 fMappedTo{0U}; }; const SizeT kRestrictCount = kRestrictMax; - const RESTRICT_MAP kRestrictList[] = { + const FileRestrictKind kRestrictList[] = { { .fRestrict = kRestrictR, - .fMappedTo = eRestrictRead, + .fMappedTo = kFileMgrRestrictRead, }, { .fRestrict = kRestrictRB, - .fMappedTo = eRestrictReadBinary, + .fMappedTo = kFileMgrRestrictReadBinary, }, { .fRestrict = kRestrictRWB, - .fMappedTo = eRestrictReadWriteBinary, + .fMappedTo = kFileMgrRestrictReadWriteBinary, }, { .fRestrict = kRestrictW, - .fMappedTo = eRestrictWrite, + .fMappedTo = kFileMgrRestrictWrite, }, { .fRestrict = kRestrictWB, - .fMappedTo = eRestrictReadWrite, - }}; + .fMappedTo = kFileMgrRestrictReadWrite, + }}; for (SizeT index = 0; index < kRestrictCount; ++index) { @@ -415,10 +416,12 @@ namespace Kernel kcout << "new file: " << path << ".\r"; } - /// @brief destructor + /// @brief destructor of the file stream. template <typename Encoding, typename Class> FileStream<Encoding, Class>::~FileStream() { mm_delete_heap(fFile); } } // namespace Kernel + +#endif // ifndef INC_FILEMGR_H diff --git a/dev/ZKAKit/KernelKit/User.h b/dev/ZKAKit/KernelKit/User.h index 04b0cf66..997cab14 100644 --- a/dev/ZKAKit/KernelKit/User.h +++ b/dev/ZKAKit/KernelKit/User.h @@ -12,14 +12,14 @@ #include <NewKit/KString.h> #include <NewKit/Defines.h> -// user mode users. +///! We got the Super and guest user, both used to make authorization operations on the OS. #define kSuperUser "OS AUTHORITY/SUPER" #define kGuestUser "OS AUTHORITY/GUEST" #define kUsersDir "/Users/" -#define kMaxUserNameLen (255) -#define kMaxUserTokenLen (4096) +#define kMaxUserNameLen (255U) +#define kMaxUserTokenLen (255U) namespace Kernel { diff --git a/dev/ZKAKit/src/DriveMgr.cc b/dev/ZKAKit/src/DriveMgr.cc index b609c2f7..899c5f67 100644 --- a/dev/ZKAKit/src/DriveMgr.cc +++ b/dev/ZKAKit/src/DriveMgr.cc @@ -33,9 +33,9 @@ namespace Kernel } #ifdef __AHCI__ - drv_std_read(pckt->fLba, (Char*)pckt->fPacketContent, kAHCISectorSize, pckt->fPacketSize); + drv_std_read(pckt->fPacketLba, (Char*)pckt->fPacketContent, kAHCISectorSize, pckt->fPacketSize); #elif defined(__ATA_PIO__) || defined(__ATA_DMA__) - drv_std_read(pckt->fLba, kATAIO, kATAMaster, (Char*)pckt->fPacketContent, kATASectorSize, pckt->fPacketSize); + drv_std_read(pckt->fPacketLba, kATAIO, kATAMaster, (Char*)pckt->fPacketContent, kATASectorSize, pckt->fPacketSize); #endif } @@ -50,9 +50,9 @@ namespace Kernel } #ifdef __AHCI__ - drv_std_write(pckt->fLba, (Char*)pckt->fPacketContent, kAHCISectorSize, pckt->fPacketSize); + drv_std_write(pckt->fPacketLba, (Char*)pckt->fPacketContent, kAHCISectorSize, pckt->fPacketSize); #elif defined(__ATA_PIO__) || defined(__ATA_DMA__) - drv_std_write(pckt->fLba, kATAIO, kATAMaster, (Char*)pckt->fPacketContent, kATASectorSize, pckt->fPacketSize); + drv_std_write(pckt->fPacketLba, kATAIO, kATAMaster, (Char*)pckt->fPacketContent, kATASectorSize, pckt->fPacketSize); #endif } @@ -83,14 +83,18 @@ namespace Kernel kATAIO = ATA_SECONDARY_IO; if (!drv_std_init(kATAIO, kATAMaster, kATAIO, kATAMaster)) + { return; + } pckt->fPacketGood = YES; #elif defined(__AHCI__) UInt16 pi = 0; if (!drv_std_init(pi)) + { return; + } #endif // if defined(__ATA_PIO__) || defined (__ATA_DMA__) } @@ -137,7 +141,7 @@ namespace Kernel DriveTrait trait; rt_copy_memory((VoidPtr) "/Disks/NUL:", trait.fName, rt_string_len("/Disks/NUL:")); - trait.fKind = kInvalidStorage; + trait.fKind = kInvalidDisc; trait.fInput = io_drv_unimplemented; trait.fOutput = io_drv_unimplemented; @@ -156,7 +160,7 @@ namespace Kernel { static _BOOT_BLOCK_STRUCT block_struct; - trait->fPacket.fLba = kEPMBaseLba; + trait->fPacket.fPacketLba = kEPMBaseLba; trait->fPacket.fPacketSize = sizeof(_BOOT_BLOCK_STRUCT); trait->fPacket.fPacketContent = &block_struct; @@ -169,20 +173,24 @@ namespace Kernel if (rt_string_cmp(((BOOT_BLOCK_STRUCT*)trait->fPacket.fPacketContent)->Magic, kEPMMagic, kEPMMagicLength) == 0) { - trait->fKind = kMassStorage; - trait->fKind |= kEPMDrive; - kcout << "Formatted drive is EPM.\r"; + trait->fPacket.fPacketReadOnly = NO; + trait->fKind = kMassStorageDisc | kEPMDrive; + kcout << "Formatted Disc is EPM (Mass Storage).\r"; } else { - trait->fKind = kUnformattedDrive; + trait->fPacket.fPacketReadOnly = YES; + trait->fKind = kMassStorageDisc | kUnformattedDrive | kReadOnlyDrive; kcout << "Scheme Found: " << block_struct.Name << endl; if (block_struct.Name[0] == 0) - kcout << "Formatted drive is blank.\r"; + kcout << "Disc partition is unknown (set to Read Only).\r"; } - trait->fPacket.fLba = 0; + rt_copy_memory((VoidPtr) "*/*", trait->fPacket.fPacketMime, + rt_string_len("*/*")); + + trait->fPacket.fPacketLba = 0; trait->fPacket.fPacketSize = 0UL; trait->fPacket.fPacketContent = nullptr; } diff --git a/dev/ZKAKit/src/FS/NeFS.cc b/dev/ZKAKit/src/FS/NeFS.cc index bf1b54c5..2a7ff93c 100644 --- a/dev/ZKAKit/src/FS/NeFS.cc +++ b/dev/ZKAKit/src/FS/NeFS.cc @@ -90,7 +90,7 @@ _Output NFS_FORK_STRUCT* NeFSParser::CreateFork(_Input NFS_CATALOG_STRUCT* catal if (lba <= kNeFSCatalogStartAddress) break; - drv.fPacket.fLba = lba; + drv.fPacket.fPacketLba = lba; drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); drv.fPacket.fPacketContent = &curFork; @@ -126,7 +126,7 @@ _Output NFS_FORK_STRUCT* NeFSParser::CreateFork(_Input NFS_CATALOG_STRUCT* catal /// entry. if (lba >= kNeFSCatalogStartAddress) { - drv.fPacket.fLba = lbaOfPreviousFork; + drv.fPacket.fPacketLba = lbaOfPreviousFork; drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); drv.fPacket.fPacketContent = &prevFork; @@ -145,7 +145,7 @@ _Output NFS_FORK_STRUCT* NeFSParser::CreateFork(_Input NFS_CATALOG_STRUCT* catal the_fork.PreviousSibling = lbaOfPreviousFork; the_fork.NextSibling = the_fork.DataOffset - the_fork.DataSize - sizeof(NFS_FORK_STRUCT); - drv.fPacket.fLba = lba; + drv.fPacket.fPacketLba = lba; drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); drv.fPacket.fPacketContent = &the_fork; @@ -180,7 +180,7 @@ _Output NFS_FORK_STRUCT* NeFSParser::FindFork(_Input NFS_CATALOG_STRUCT* catalog while (lba != 0) { - drv.fPacket.fLba = lba; + drv.fPacket.fPacketLba = lba; drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); drv.fPacket.fPacketContent = (VoidPtr)the_fork; @@ -317,7 +317,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, drive.fPacket.fPacketContent = sectorBufPartBlock; drive.fPacket.fPacketSize = kNeFSSectorSz; - drive.fPacket.fLba = kNeFSRootCatalogStartAddress; + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; drive.fInput(&drive.fPacket); @@ -353,7 +353,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, drive.fPacket.fPacketContent = &temporary_catalog; drive.fPacket.fPacketSize = kNeFSSectorSz; - drive.fPacket.fLba = start_free; + drive.fPacket.fPacketLba = start_free; drive.fInput(&drive.fPacket); @@ -363,7 +363,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, child_catalog->PrevSibling = out_lba; - drive.fPacket.fLba = start_free; + drive.fPacket.fPacketLba = start_free; drive.fInput(&drive.fPacket); while (drive.fPacket.fPacketGood) @@ -387,7 +387,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, drive.fPacket.fPacketContent = sectorBufPartBlock; drive.fPacket.fPacketSize = kNeFSSectorSz; - drive.fPacket.fLba = kNeFSRootCatalogStartAddress; + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; drive.fInput(&drive.fPacket); @@ -414,7 +414,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, drive.fPacket.fPacketContent = child_catalog; drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT); - drive.fPacket.fLba = start_free; + drive.fPacket.fPacketLba = start_free; drive.fOutput(&drive.fPacket); @@ -422,7 +422,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, drive.fPacket.fPacketContent = sectorBufPartBlock; drive.fPacket.fPacketSize = kNeFSSectorSz; - drive.fPacket.fLba = kNeFSRootCatalogStartAddress; + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; drive.fInput(&drive.fPacket); @@ -453,7 +453,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::CreateCatalog(_Input const Char* name, drive.fPacket.fPacketContent = &temporary_catalog; drive.fPacket.fPacketSize = kNeFSSectorSz; - drive.fPacket.fLba = start_free; + drive.fPacket.fPacketLba = start_free; drive.fInput(&drive.fPacket); } @@ -490,7 +490,7 @@ bool NeFSParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLb drive->fPacket.fPacketContent = fs_buf; drive->fPacket.fPacketSize = kNeFSSectorSz; - drive->fPacket.fLba = start; + drive->fPacket.fPacketLba = start; drive->fInput(&drive->fPacket); @@ -526,7 +526,7 @@ bool NeFSParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLb { drive->fPacket.fPacketContent = buf; drive->fPacket.fPacketSize = kNeFSSectorSz; - drive->fPacket.fLba = outEpmLba; + drive->fPacket.fPacketLba = outEpmLba; drive->fInput(&drive->fPacket); @@ -542,7 +542,7 @@ bool NeFSParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLb drive->fPacket.fPacketContent = bufEpmHdr; drive->fPacket.fPacketSize = kNeFSSectorSz; - drive->fPacket.fLba = outEpmLba; + drive->fPacket.fPacketLba = outEpmLba; drive->fOutput(&drive->fPacket); @@ -594,7 +594,7 @@ bool NeFSParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLb drive->fPacket.fPacketContent = fs_buf; drive->fPacket.fPacketSize = kNeFSSectorSz; - drive->fPacket.fLba = kNeFSRootCatalogStartAddress; + drive->fPacket.fPacketLba = kNeFSRootCatalogStartAddress; drive->fOutput(&drive->fPacket); @@ -619,7 +619,7 @@ bool NeFSParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLb drive->fPacket.fPacketContent = fs_buf; drive->fPacket.fPacketSize = kNeFSSectorSz; - drive->fPacket.fLba = start; + drive->fPacket.fPacketLba = start; drive->fInput(&drive->fPacket); } @@ -658,7 +658,7 @@ bool NeFSParser::WriteCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, Bool i { drive.fPacket.fPacketContent = fork_data_input; drive.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); - drive.fPacket.fLba = startFork; + drive.fPacket.fPacketLba = startFork; drive.fInput(&drive.fPacket); @@ -686,7 +686,7 @@ bool NeFSParser::WriteCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, Bool i drive.fPacket.fPacketContent = buf; drive.fPacket.fPacketSize = kNeFSForkDataSz; - drive.fPacket.fLba = fork_data_input->DataOffset; + drive.fPacket.fPacketLba = fork_data_input->DataOffset; kcout << "data offset: " << hex_number(fork_data_input->DataOffset) << endl; @@ -694,7 +694,7 @@ bool NeFSParser::WriteCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, Bool i drive.fPacket.fPacketContent = fork_data_input; drive.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); - drive.fPacket.fLba = startFork - sizeof(NFS_FORK_STRUCT); + drive.fPacket.fPacketLba = startFork - sizeof(NFS_FORK_STRUCT); drive.fOutput(&drive.fPacket); @@ -732,7 +732,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::FindCatalog(_Input const Char* catalogNa drive.fPacket.fPacketContent = &fs_buf; drive.fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK); - drive.fPacket.fLba = kNeFSRootCatalogStartAddress; + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; drive.fInput(&drive.fPacket); @@ -745,7 +745,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::FindCatalog(_Input const Char* catalogNa NFS_CATALOG_STRUCT temporary_catalog{0}; - drive.fPacket.fLba = startCatalogList; + drive.fPacket.fPacketLba = startCatalogList; drive.fPacket.fPacketContent = &temporary_catalog; drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT); @@ -799,7 +799,7 @@ _Output NFS_CATALOG_STRUCT* NeFSParser::FindCatalog(_Input const Char* catalogNa NeFSSearchThroughCatalogList: while (drive.fPacket.fPacketGood) { - drive.fPacket.fLba = startCatalogList; + drive.fPacket.fPacketLba = startCatalogList; drive.fPacket.fPacketContent = &temporary_catalog; drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT); @@ -892,7 +892,7 @@ Boolean NeFSParser::RemoveCatalog(_Input const Char* catalogName) rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, rt_string_len("fs/nefs-packet")); - drive.fPacket.fLba = out_lba; // the catalog position. + drive.fPacket.fPacketLba = out_lba; // the catalog position. drive.fPacket.fPacketSize = sizeof(NFS_CATALOG_STRUCT); // size of catalog. roughly the sector size. drive.fPacket.fPacketContent = catalog; // the catalog itself. @@ -901,7 +901,7 @@ Boolean NeFSParser::RemoveCatalog(_Input const Char* catalogName) Char partitionBlockBuf[sizeof(NFS_ROOT_PARTITION_BLOCK)] = {0}; - drive.fPacket.fLba = kNeFSRootCatalogStartAddress; + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; drive.fPacket.fPacketContent = partitionBlockBuf; drive.fPacket.fPacketSize = sizeof(NFS_ROOT_PARTITION_BLOCK); @@ -962,7 +962,7 @@ VoidPtr NeFSParser::ReadCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, while (dataForkLba > kNeFSCatalogStartAddress) { - drive.fPacket.fLba = dataForkLba; + drive.fPacket.fPacketLba = dataForkLba; drive.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); drive.fPacket.fPacketContent = fs_buf; diff --git a/dev/ZKAKit/src/Storage/ATADeviceInterface.cc b/dev/ZKAKit/src/Storage/ATADeviceInterface.cc index e80dd533..df987dff 100644 --- a/dev/ZKAKit/src/Storage/ATADeviceInterface.cc +++ b/dev/ZKAKit/src/Storage/ATADeviceInterface.cc @@ -43,7 +43,7 @@ ATADeviceInterface& ATADeviceInterface::operator<<(MountpointInterface* Data) if (!Data) return *this; - for (SizeT driveCount = 0; driveCount < kMaxDriveCountPerMountpoint; ++driveCount) + for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) { auto interface = Data->GetAddressOf(driveCount); if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) @@ -69,7 +69,7 @@ ATADeviceInterface& ATADeviceInterface::operator>>(MountpointInterface* Data) if (!Data) return *this; - for (SizeT driveCount = 0; driveCount < kMaxDriveCountPerMountpoint; ++driveCount) + for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) { auto interface = Data->GetAddressOf(driveCount); if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) diff --git a/dev/ZKAKit/src/UserProcessScheduler.cc b/dev/ZKAKit/src/UserProcessScheduler.cc index 79e07385..3fb063a4 100644 --- a/dev/ZKAKit/src/UserProcessScheduler.cc +++ b/dev/ZKAKit/src/UserProcessScheduler.cc @@ -9,7 +9,7 @@ /***********************************************************************************/ /// @file UserProcessScheduler.cc -/// @brief EL0/Ring-3 Process scheduler. +/// @brief EL0/Ring-3 process scheduler. /***********************************************************************************/ #include <KernelKit/UserProcessScheduler.h> @@ -52,7 +52,7 @@ namespace Kernel } /***********************************************************************************/ - /// @brief crash current process. + /// @brief Crashes the current process. /***********************************************************************************/ Void UserProcess::Crash() @@ -87,7 +87,7 @@ namespace Kernel Int32& UserProcess::GetLocalCode() noexcept { - return fLocalCode; + return this->fLocalCode; } /***********************************************************************************/ |
