summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Sources
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-09-04 17:29:07 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-09-04 17:29:07 +0200
commit8b1114ea205ef6560fb7bf5713577d1ab7deb5be (patch)
tree88dc9dc3c6af1d51db46a11dbb0dd9de09409250 /dev/ZKA/Sources
parenta0a90c80e5dd17df8f609aebc253b4bf9147f90f (diff)
[ MR ] BUMP commit.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/Sources')
-rw-r--r--dev/ZKA/Sources/CodeMgr.cxx (renamed from dev/ZKA/Sources/CodeManager.cxx)2
-rw-r--r--dev/ZKA/Sources/DLLMain.cxx22
-rw-r--r--dev/ZKA/Sources/DeviceMgr.cxx (renamed from dev/ZKA/Sources/DeviceManager.cxx)2
-rw-r--r--dev/ZKA/Sources/DriveMgr.cxx (renamed from dev/ZKA/Sources/DriveManager.cxx)4
-rw-r--r--dev/ZKA/Sources/FileMgr.cxx (renamed from dev/ZKA/Sources/FileManager.cxx)30
-rw-r--r--dev/ZKA/Sources/Heap.cxx73
-rw-r--r--dev/ZKA/Sources/MP.cxx30
-rw-r--r--dev/ZKA/Sources/NewFS+FileMgr.cxx (renamed from dev/ZKA/Sources/NewFS+FileManager.cxx)18
-rw-r--r--dev/ZKA/Sources/NewFS+IO.cxx4
-rw-r--r--dev/ZKA/Sources/NewFS+Journal.cxx2
-rw-r--r--dev/ZKA/Sources/PEFCodeMgr.cxx (renamed from dev/ZKA/Sources/PEFCodeManager.cxx)4
-rw-r--r--dev/ZKA/Sources/PageMgr.cxx (renamed from dev/ZKA/Sources/PageManager.cxx)10
-rw-r--r--dev/ZKA/Sources/Pmm.cxx14
-rw-r--r--dev/ZKA/Sources/Storage/ATADeviceInterface.cxx4
-rw-r--r--dev/ZKA/Sources/User.cxx2
-rw-r--r--dev/ZKA/Sources/UserProcessScheduler.cxx2
16 files changed, 103 insertions, 120 deletions
diff --git a/dev/ZKA/Sources/CodeManager.cxx b/dev/ZKA/Sources/CodeMgr.cxx
index 7e180ac0..df5b0917 100644
--- a/dev/ZKA/Sources/CodeManager.cxx
+++ b/dev/ZKA/Sources/CodeMgr.cxx
@@ -5,7 +5,7 @@
------------------------------------------- */
#include <NewKit/Utils.hxx>
-#include <KernelKit/CodeManager.hxx>
+#include <KernelKit/CodeMgr.hxx>
#include <KernelKit/UserProcessScheduler.hxx>
namespace Kernel
diff --git a/dev/ZKA/Sources/DLLMain.cxx b/dev/ZKA/Sources/DLLMain.cxx
index 84c58b3a..88887ec3 100644
--- a/dev/ZKA/Sources/DLLMain.cxx
+++ b/dev/ZKA/Sources/DLLMain.cxx
@@ -11,18 +11,18 @@
#include <ArchKit/ArchKit.hxx>
#include <CompilerKit/Detail.hxx>
#include <FirmwareKit/Handover.hxx>
-#include <KernelKit/FileManager.hxx>
+#include <KernelKit/FileMgr.hxx>
#include <KernelKit/Framebuffer.hxx>
#include <KernelKit/Heap.hxx>
#include <KernelKit/PEF.hxx>
-#include <KernelKit/PEFCodeManager.hxx>
+#include <KernelKit/PEFCodeMgr.hxx>
#include <KernelKit/UserProcessScheduler.hxx>
#include <NewKit/Json.hxx>
#include <NewKit/KernelCheck.hxx>
#include <NewKit/String.hxx>
#include <NewKit/Utils.hxx>
-#include <KernelKit/PEFCodeManager.hxx>
-#include <KernelKit/CodeManager.hxx>
+#include <KernelKit/PEFCodeMgr.hxx>
+#include <KernelKit/CodeMgr.hxx>
#include <CFKit/Property.hxx>
#include <Modules/CoreCG/WindowRenderer.hxx>
#include <KernelKit/Timer.hxx>
@@ -44,23 +44,23 @@ namespace Kernel::Detail
/// @brief Filesystem auto formatter, additional checks are also done by the class.
class FilesystemInstaller final
{
- Kernel::NewFilesystemManager* fNewFS{nullptr};
+ Kernel::NewFilesystemMgr* fNewFS{nullptr};
public:
/// @brief wizard constructor.
explicit FilesystemInstaller()
{
- if (Kernel::FilesystemManagerInterface::GetMounted())
+ if (Kernel::FilesystemMgrInterface::GetMounted())
{
CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.exe: NewFS IFS already mounted by HAL (A:)", 10, 10, RGB(0, 0, 0));
- fNewFS = reinterpret_cast<Kernel::NewFilesystemManager*>(Kernel::FilesystemManagerInterface::GetMounted());
+ fNewFS = reinterpret_cast<Kernel::NewFilesystemMgr*>(Kernel::FilesystemMgrInterface::GetMounted());
}
else
{
// Mounts a NewFS from main drive.
- fNewFS = new Kernel::NewFilesystemManager();
+ fNewFS = new Kernel::NewFilesystemMgr();
- Kernel::FilesystemManagerInterface::Mount(fNewFS);
+ Kernel::FilesystemMgrInterface::Mount(fNewFS);
CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.exe: Mounted NewFS IFS (A:)", 10, 10, RGB(0, 0, 0));
}
@@ -142,8 +142,8 @@ namespace Kernel::Detail
ZKA_COPY_DEFAULT(FilesystemInstaller);
/// @brief Grab the disk's NewFS reference.
- /// @return NewFilesystemManager the filesystem interface
- Kernel::NewFilesystemManager* Leak()
+ /// @return NewFilesystemMgr the filesystem interface
+ Kernel::NewFilesystemMgr* Leak()
{
return fNewFS;
}
diff --git a/dev/ZKA/Sources/DeviceManager.cxx b/dev/ZKA/Sources/DeviceMgr.cxx
index 229e0fb7..70d01984 100644
--- a/dev/ZKA/Sources/DeviceManager.cxx
+++ b/dev/ZKA/Sources/DeviceMgr.cxx
@@ -4,4 +4,4 @@
------------------------------------------- */
-#include <KernelKit/DeviceManager.hxx>
+#include <KernelKit/DeviceMgr.hxx>
diff --git a/dev/ZKA/Sources/DriveManager.cxx b/dev/ZKA/Sources/DriveMgr.cxx
index 84c9870f..376eb158 100644
--- a/dev/ZKA/Sources/DriveManager.cxx
+++ b/dev/ZKA/Sources/DriveMgr.cxx
@@ -5,12 +5,12 @@
------------------------------------------- */
#include <KernelKit/DebugOutput.hxx>
-#include <KernelKit/DriveManager.hxx>
+#include <KernelKit/DriveMgr.hxx>
#include <Modules/ATA/ATA.hxx>
#include <Modules/AHCI/AHCI.hxx>
#include <NewKit/Utils.hxx>
-/// @file DriveManager.cxx
+/// @file DriveMgr.cxx
/// @brief Kernel drive manager.
namespace Kernel
diff --git a/dev/ZKA/Sources/FileManager.cxx b/dev/ZKA/Sources/FileMgr.cxx
index 8c8fb83a..270c13f2 100644
--- a/dev/ZKA/Sources/FileManager.cxx
+++ b/dev/ZKA/Sources/FileMgr.cxx
@@ -4,7 +4,7 @@
------------------------------------------- */
-#include <KernelKit/FileManager.hxx>
+#include <KernelKit/FileMgr.hxx>
#include <NewKit/Utils.hxx>
/// BUGS: 0
@@ -12,18 +12,18 @@
namespace Kernel
{
- STATIC FilesystemManagerInterface* kMounted = nullptr;
+ STATIC FilesystemMgrInterface* kMounted = nullptr;
- /// @brief FilesystemManager getter.
+ /// @brief FilesystemMgr getter.
/// @return The mounted filesystem.
- _Output FilesystemManagerInterface* FilesystemManagerInterface::GetMounted()
+ _Output FilesystemMgrInterface* FilesystemMgrInterface::GetMounted()
{
return kMounted;
}
/// @brief Unmount filesystem.
/// @return The unmounted filesystem.
- _Output FilesystemManagerInterface* FilesystemManagerInterface::Unmount()
+ _Output FilesystemMgrInterface* FilesystemMgrInterface::Unmount()
{
if (kMounted)
{
@@ -39,7 +39,7 @@ namespace Kernel
/// @brief Mount filesystem.
/// @param mount_ptr The filesystem to mount.
/// @return if it succeeded true, otherwise false.
- bool FilesystemManagerInterface::Mount(_Input FilesystemManagerInterface* mount_ptr)
+ bool FilesystemMgrInterface::Mount(_Input FilesystemMgrInterface* mount_ptr)
{
if (mount_ptr != nullptr)
{
@@ -55,7 +55,7 @@ namespace Kernel
/// @param path
/// @param r
/// @return
- _Output NodePtr NewFilesystemManager::Open(_Input const Char* path, _Input const Char* r)
+ _Output NodePtr NewFilesystemMgr::Open(_Input const Char* path, _Input const Char* r)
{
if (!path || *path == 0)
return nullptr;
@@ -73,7 +73,7 @@ namespace Kernel
/// @param data the data.
/// @param flags the size.
/// @return
- Void NewFilesystemManager::Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT size)
+ Void NewFilesystemMgr::Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT size)
{
if (!node)
return;
@@ -89,7 +89,7 @@ namespace Kernel
/// @param flags the flags with it.
/// @param sz the size to read.
/// @return
- _Output VoidPtr NewFilesystemManager::Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT size)
+ _Output VoidPtr NewFilesystemMgr::Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT size)
{
if (!node)
return nullptr;
@@ -100,7 +100,7 @@ namespace Kernel
return this->Read(cDataForkName, node, flags, size);
}
- Void NewFilesystemManager::Write(_Input const Char* name,
+ Void NewFilesystemMgr::Write(_Input const Char* name,
_Input NodePtr node,
_Input VoidPtr data,
_Input Int32 flags,
@@ -120,7 +120,7 @@ namespace Kernel
name);
}
- _Output VoidPtr NewFilesystemManager::Read(_Input const Char* name,
+ _Output VoidPtr NewFilesystemMgr::Read(_Input const Char* name,
_Input NodePtr node,
_Input Int32 flags,
_Input SizeT sz)
@@ -146,7 +146,7 @@ namespace Kernel
/// @retval true always returns false, this is unimplemented.
/// @retval false always returns this, it is unimplemented.
- _Output Bool NewFilesystemManager::Seek(NodePtr node, SizeT off)
+ _Output Bool NewFilesystemMgr::Seek(NodePtr node, SizeT off)
{
if (!node || off == 0)
return false;
@@ -159,7 +159,7 @@ namespace Kernel
/// @retval true always returns false, this is unimplemented.
/// @retval false always returns this, it is unimplemented.
- _Output SizeT NewFilesystemManager::Tell(NodePtr node)
+ _Output SizeT NewFilesystemMgr::Tell(NodePtr node)
{
if (!node)
return kNPos;
@@ -172,7 +172,7 @@ namespace Kernel
/// @retval true always returns false, this is unimplemented.
/// @retval false always returns this, it is unimplemented.
- _Output Bool NewFilesystemManager::Rewind(NodePtr node)
+ _Output Bool NewFilesystemMgr::Rewind(NodePtr node)
{
if (!node)
return false;
@@ -182,7 +182,7 @@ namespace Kernel
/// @brief Returns the filesystem parser.
/// @return the Filesystem parser class.
- _Output NewFSParser* NewFilesystemManager::GetParser() noexcept
+ _Output NewFSParser* NewFilesystemMgr::GetParser() noexcept
{
return fImpl;
}
diff --git a/dev/ZKA/Sources/Heap.cxx b/dev/ZKA/Sources/Heap.cxx
index e036badb..615f5664 100644
--- a/dev/ZKA/Sources/Heap.cxx
+++ b/dev/ZKA/Sources/Heap.cxx
@@ -8,7 +8,7 @@
#include <KernelKit/LPC.hxx>
#include <KernelKit/Heap.hxx>
#include <NewKit/Crc32.hxx>
-#include <NewKit/PageManager.hxx>
+#include <NewKit/PageMgr.hxx>
//! @file KernelHeap.cxx
//! @brief Kernel heap allocator.
@@ -19,7 +19,7 @@
namespace Kernel
{
SizeT kHeapCount = 0UL;
- PageManager kHeapPageManager;
+ PageMgr kHeapPageMgr;
Bool kOperationInProgress = No;
/// @brief Contains data structures and algorithms for the heap.
@@ -71,13 +71,13 @@ namespace Kernel
if (!allocatedPtr || newSz < 1)
return nullptr;
- Detail::HEAP_INFORMATION_BLOCK_PTR heapInfoBlk =
+ Detail::HEAP_INFORMATION_BLOCK_PTR heap_blk =
reinterpret_cast<Detail::HEAP_INFORMATION_BLOCK_PTR>(
(UIntPtr)allocatedPtr - sizeof(Detail::HEAP_INFORMATION_BLOCK));
- heapInfoBlk->fHeapSize = newSz;
+ heap_blk->fHeapSize = newSz;
- if (heapInfoBlk->fCRC32 > 0)
+ if (heap_blk->fCRC32 > 0)
{
MUST_PASS(mm_protect_ke_heap(allocatedPtr));
}
@@ -97,9 +97,9 @@ namespace Kernel
auto szFix = sz;
if (szFix == 0)
- ++szFix;
+ return nullptr;
- auto wrapper = kHeapPageManager.Request(rw, user, No, szFix);
+ auto wrapper = kHeapPageMgr.Request(rw, user, No, szFix);
Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr =
reinterpret_cast<Detail::HEAP_INFORMATION_BLOCK_PTR>(
@@ -107,11 +107,11 @@ namespace Kernel
heap_info_ptr->fHeapSize = szFix;
heap_info_ptr->fMagic = kKernelHeapMagic;
- heap_info_ptr->fCRC32 = 0U; // dont fill it for now.
- heap_info_ptr->fHeapPtr = wrapper.VirtualAddress() + sizeof(Detail::HEAP_INFORMATION_BLOCK);
- heap_info_ptr->fPage = 0UL;
+ heap_info_ptr->fCRC32 = No; // dont fill it for now.
+ heap_info_ptr->fHeapPtr = reinterpret_cast<UIntPtr>(heap_info_ptr) + sizeof(Detail::HEAP_INFORMATION_BLOCK);
+ heap_info_ptr->fPage = No;
heap_info_ptr->fUser = user;
- heap_info_ptr->fPresent = true;
+ heap_info_ptr->fPresent = No;
++kHeapCount;
@@ -138,11 +138,11 @@ namespace Kernel
Detail::mm_alloc_init_timeout();
- Detail::HEAP_INFORMATION_BLOCK_PTR heapInfoBlk =
+ Detail::HEAP_INFORMATION_BLOCK_PTR heap_blk =
reinterpret_cast<Detail::HEAP_INFORMATION_BLOCK_PTR>(
(UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK));
- heapInfoBlk->fPage = true;
+ heap_blk->fPage = true;
Detail::mm_alloc_fini_timeout();
@@ -156,48 +156,47 @@ namespace Kernel
{
if (kHeapCount < 1)
return -kErrorInternal;
- if (((IntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)) <= 0)
- return -kErrorInternal;
- if (((IntPtr)heap_ptr - kInvalidAddress) < 0)
- return -kErrorInternal;
+
+ if (!heap_ptr)
+ return -kErrorInvalidData;
Detail::mm_alloc_init_timeout();
- Detail::HEAP_INFORMATION_BLOCK_PTR heapInfoBlk =
+ Detail::HEAP_INFORMATION_BLOCK_PTR heap_blk =
reinterpret_cast<Detail::HEAP_INFORMATION_BLOCK_PTR>(
(UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK));
- if (heapInfoBlk && heapInfoBlk->fMagic == kKernelHeapMagic)
+ if (heap_blk && heap_blk->fMagic == kKernelHeapMagic)
{
- if (!heapInfoBlk->fPresent)
+ if (!heap_blk->fPresent)
{
Detail::mm_alloc_fini_timeout();
return -kErrorHeapNotPresent;
}
- if (heapInfoBlk->fCRC32 != 0)
+ if (heap_blk->fCRC32 != 0)
{
- if (heapInfoBlk->fCRC32 !=
- ke_calculate_crc32((Char*)heapInfoBlk->fHeapPtr,
- heapInfoBlk->fHeapSize))
+ if (heap_blk->fCRC32 !=
+ ke_calculate_crc32((Char*)heap_blk->fHeapPtr,
+ heap_blk->fHeapSize))
{
- if (!heapInfoBlk->fUser)
+ if (!heap_blk->fUser)
{
ke_stop(RUNTIME_CHECK_POINTER);
}
}
}
- heapInfoBlk->fHeapSize = 0UL;
- heapInfoBlk->fPresent = false;
- heapInfoBlk->fHeapPtr = 0;
- heapInfoBlk->fCRC32 = 0;
- heapInfoBlk->fMagic = 0;
+ heap_blk->fHeapSize = 0UL;
+ heap_blk->fPresent = No;
+ heap_blk->fHeapPtr = 0;
+ heap_blk->fCRC32 = 0;
+ heap_blk->fMagic = 0;
- PTEWrapper pageWrapper(false, false, false, reinterpret_cast<UIntPtr>(heapInfoBlk) - sizeof(Detail::HEAP_INFORMATION_BLOCK));
- Ref<PTEWrapper*> pteAddress{&pageWrapper};
+ PTEWrapper pageWrapper(false, false, false, reinterpret_cast<UIntPtr>(heap_blk) - sizeof(Detail::HEAP_INFORMATION_BLOCK));
+ Ref<PTEWrapper> pteAddress{pageWrapper};
- kHeapPageManager.Free(pteAddress);
+ kHeapPageMgr.Free(pteAddress);
--kHeapCount;
@@ -239,14 +238,14 @@ namespace Kernel
{
if (heap_ptr)
{
- Detail::HEAP_INFORMATION_BLOCK_PTR heapInfoBlk =
+ Detail::HEAP_INFORMATION_BLOCK_PTR heap_blk =
reinterpret_cast<Detail::HEAP_INFORMATION_BLOCK_PTR>(
(UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK));
- if (heapInfoBlk->fPresent && kKernelHeapMagic == heapInfoBlk->fMagic)
+ if (heap_blk->fPresent && kKernelHeapMagic == heap_blk->fMagic)
{
- heapInfoBlk->fCRC32 =
- ke_calculate_crc32((Char*)heapInfoBlk->fHeapPtr, heapInfoBlk->fHeapSize);
+ heap_blk->fCRC32 =
+ ke_calculate_crc32((Char*)heap_blk->fHeapPtr, heap_blk->fHeapSize);
return true;
}
diff --git a/dev/ZKA/Sources/MP.cxx b/dev/ZKA/Sources/MP.cxx
index 7429751f..c5cab5dc 100644
--- a/dev/ZKA/Sources/MP.cxx
+++ b/dev/ZKA/Sources/MP.cxx
@@ -17,12 +17,6 @@
namespace Kernel
{
- /***********************************************************************************/
- /// @brief MP object container property.
- /***********************************************************************************/
-
- Property cSMPCoreName;
-
///! A HardwareThread class takes care of it's owned hardware thread.
///! It has a stack for it's core.
@@ -102,13 +96,13 @@ namespace Kernel
{
return mp_register_process(fStack);
}
-
- //! SMP is disabled here.
-
- mp_do_context_switch_pre();
- mp_do_context_switch(image, stack_ptr, fStack);
-
- return true;
+ else
+ {
+ mp_do_context_switch_pre();
+ mp_do_context_switch(image, stack_ptr, fStack);
+
+ return false;
+ }
}
///! @brief Tells if processor is waked up.
@@ -123,15 +117,7 @@ namespace Kernel
///! @brief Constructor and destructors.
///! @brief Default constructor.
- HardwareThreadScheduler::HardwareThreadScheduler()
- {
- kcout << "newoskrnl.exe: Initializing HardwareThreadScheduler." << endl;
-
- cSMPCoreName.GetKey() += "Property\\MPClass";
- cSMPCoreName.GetValue() = (PropertyId)this;
-
- kcout << "newoskrnl.exe: Initialized HardwareThreadScheduler." << endl;
- }
+ HardwareThreadScheduler::HardwareThreadScheduler() = default;
///! @brief Default destructor.
HardwareThreadScheduler::~HardwareThreadScheduler() = default;
diff --git a/dev/ZKA/Sources/NewFS+FileManager.cxx b/dev/ZKA/Sources/NewFS+FileMgr.cxx
index 20fb623d..dd0d4a21 100644
--- a/dev/ZKA/Sources/NewFS+FileManager.cxx
+++ b/dev/ZKA/Sources/NewFS+FileMgr.cxx
@@ -4,7 +4,7 @@
------------------------------------------- */
-#include <KernelKit/FileManager.hxx>
+#include <KernelKit/FileMgr.hxx>
#include <KernelKit/Heap.hxx>
#ifdef __FSKIT_USE_NEWFS__
@@ -15,16 +15,16 @@
namespace Kernel
{
/// @brief C++ constructor
- NewFilesystemManager::NewFilesystemManager()
+ NewFilesystemMgr::NewFilesystemMgr()
{
MUST_PASS(Detail::fs_init_newfs());
fImpl = new NewFSParser();
MUST_PASS(fImpl);
- kcout << "newoskrnl.exe: We are done here... (NewFilesystemManager).\r";
+ kcout << "newoskrnl.exe: We are done here... (NewFilesystemMgr).\r";
}
- NewFilesystemManager::~NewFilesystemManager()
+ NewFilesystemMgr::~NewFilesystemMgr()
{
kcout << "newoskrnl.exe: Destroying it...\r";
@@ -37,7 +37,7 @@ namespace Kernel
/// @brief Removes a node from the filesystem.
/// @param fileName The filename
/// @return If it was deleted or not.
- bool NewFilesystemManager::Remove(const Char* fileName)
+ bool NewFilesystemMgr::Remove(const Char* fileName)
{
if (fileName == nullptr || *fileName == 0)
return false;
@@ -48,7 +48,7 @@ namespace Kernel
/// @brief Creates a node with the specified.
/// @param path The filename path.
/// @return The Node pointer.
- NodePtr NewFilesystemManager::Create(const Char* path)
+ NodePtr NewFilesystemMgr::Create(const Char* path)
{
return node_cast(fImpl->CreateCatalog(path));
}
@@ -56,7 +56,7 @@ namespace Kernel
/// @brief Creates a node with is a directory.
/// @param path The filename path.
/// @return The Node pointer.
- NodePtr NewFilesystemManager::CreateDirectory(const Char* path)
+ NodePtr NewFilesystemMgr::CreateDirectory(const Char* path)
{
return node_cast(fImpl->CreateCatalog(path, 0, kNewFSCatalogKindDir));
}
@@ -64,7 +64,7 @@ namespace Kernel
/// @brief Creates a node with is a alias.
/// @param path The filename path.
/// @return The Node pointer.
- NodePtr NewFilesystemManager::CreateAlias(const Char* path)
+ NodePtr NewFilesystemMgr::CreateAlias(const Char* path)
{
return node_cast(fImpl->CreateCatalog(path, 0, kNewFSCatalogKindAlias));
}
@@ -72,7 +72,7 @@ namespace Kernel
/// @brief Creates a node with is a page file.
/// @param path The filename path.
/// @return The Node pointer.
- NodePtr NewFilesystemManager::CreateSwapFile(const Char* path)
+ NodePtr NewFilesystemMgr::CreateSwapFile(const Char* path)
{
return node_cast(fImpl->CreateCatalog(path, 0, kNewFSCatalogKindPage));
}
diff --git a/dev/ZKA/Sources/NewFS+IO.cxx b/dev/ZKA/Sources/NewFS+IO.cxx
index ddcecde4..e1a6ac95 100644
--- a/dev/ZKA/Sources/NewFS+IO.cxx
+++ b/dev/ZKA/Sources/NewFS+IO.cxx
@@ -4,8 +4,8 @@
------------------------------------------- */
-#include <KernelKit/DriveManager.hxx>
-#include <KernelKit/FileManager.hxx>
+#include <KernelKit/DriveMgr.hxx>
+#include <KernelKit/FileMgr.hxx>
/*************************************************************
*
diff --git a/dev/ZKA/Sources/NewFS+Journal.cxx b/dev/ZKA/Sources/NewFS+Journal.cxx
index 6504b2bc..2f63cc9a 100644
--- a/dev/ZKA/Sources/NewFS+Journal.cxx
+++ b/dev/ZKA/Sources/NewFS+Journal.cxx
@@ -5,7 +5,7 @@
------------------------------------------- */
#include <KernelKit/DebugOutput.hxx>
-#include <KernelKit/FileManager.hxx>
+#include <KernelKit/FileMgr.hxx>
#ifdef __FSKIT_USE_NEWFS__
diff --git a/dev/ZKA/Sources/PEFCodeManager.cxx b/dev/ZKA/Sources/PEFCodeMgr.cxx
index 526312e0..feafc35c 100644
--- a/dev/ZKA/Sources/PEFCodeManager.cxx
+++ b/dev/ZKA/Sources/PEFCodeMgr.cxx
@@ -6,7 +6,7 @@
#include <KernelKit/DebugOutput.hxx>
#include <KernelKit/Heap.hxx>
-#include <KernelKit/PEFCodeManager.hxx>
+#include <KernelKit/PEFCodeMgr.hxx>
#include <KernelKit/UserProcessScheduler.hxx>
#include <NewKit/Defines.hxx>
#include <NewKit/KernelCheck.hxx>
@@ -87,7 +87,7 @@ namespace Kernel
if (fCachedBlob)
mm_delete_ke_heap(fCachedBlob);
- kcout << "CodeManagerPEF: Warning: Executable format error!\r";
+ kcout << "CodeMgrPEF: Warning: Executable format error!\r";
fCachedBlob = nullptr;
}
diff --git a/dev/ZKA/Sources/PageManager.cxx b/dev/ZKA/Sources/PageMgr.cxx
index dd18709f..78b279f3 100644
--- a/dev/ZKA/Sources/PageManager.cxx
+++ b/dev/ZKA/Sources/PageMgr.cxx
@@ -5,7 +5,7 @@
------------------------------------------- */
#include <KernelKit/DebugOutput.hxx>
-#include <NewKit/PageManager.hxx>
+#include <NewKit/PageMgr.hxx>
#ifdef __ZKA_AMD64__
#include <HALKit/AMD64/HalPageAlloc.hxx>
@@ -35,7 +35,7 @@ namespace Kernel
/// @brief Flush virtual address.
/// @param VirtAddr
- Void PageManager::FlushTLB()
+ Void PageMgr::FlushTLB()
{
hal_flush_tlb();
}
@@ -58,7 +58,7 @@ namespace Kernel
/// @param User user mode?
/// @param ExecDisable disable execution on page?
/// @return
- PTEWrapper PageManager::Request(Boolean Rw, Boolean User, Boolean ExecDisable, SizeT Sz)
+ PTEWrapper PageMgr::Request(Boolean Rw, Boolean User, Boolean ExecDisable, SizeT Sz)
{
// Store PTE wrapper right after PTE.
VoidPtr ptr = Kernel::HAL::mm_alloc_bitmap(Rw, User, Sz);
@@ -69,9 +69,9 @@ namespace Kernel
/// @brief Disable BitMap.
/// @param wrapper the wrapper.
/// @return If the page bitmap was cleared or not.
- Bool PageManager::Free(Ref<PTEWrapper*>& wrapper)
+ Bool PageMgr::Free(Ref<PTEWrapper>& wrapper)
{
- if (!Kernel::HAL::mm_free_bitmap((VoidPtr)wrapper->VirtualAddress()))
+ if (!Kernel::HAL::mm_free_bitmap((VoidPtr)wrapper.Leak().VirtualAddress()))
return false;
return true;
diff --git a/dev/ZKA/Sources/Pmm.cxx b/dev/ZKA/Sources/Pmm.cxx
index b0855281..58335a2b 100644
--- a/dev/ZKA/Sources/Pmm.cxx
+++ b/dev/ZKA/Sources/Pmm.cxx
@@ -19,9 +19,9 @@ namespace Kernel
{
/// @brief Pmm constructor.
Pmm::Pmm()
- : fPageManager()
+ : fPageMgr()
{
- kcout << "[PMM] Allocate PageMemoryManager";
+ kcout << "[PMM] Allocate PageMemoryMgr";
}
Pmm::~Pmm() = default;
@@ -31,17 +31,15 @@ namespace Kernel
/// @param readWrite is it r/w?
Ref<PTEWrapper> Pmm::RequestPage(Boolean user, Boolean readWrite)
{
- PTEWrapper pt = fPageManager.Leak().Request(user, readWrite, false, kPTESize);
+ PTEWrapper pt = fPageMgr.Leak().Request(user, readWrite, false, kPTESize);
if (pt.fPresent)
{
- kcout << "[PMM]: Allocation was successful.\r";
- return Ref<PTEWrapper>(pt);
+ kcout << "[PMM]: Allocation failed.\r";
+ return {};
}
- kcout << "[PMM]: Allocation failed.\r";
-
- return {};
+ return Ref<PTEWrapper>(pt);
}
Boolean Pmm::FreePage(Ref<PTEWrapper> PageRef)
diff --git a/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx b/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx
index 183481e1..97d2e2e4 100644
--- a/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx
+++ b/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx
@@ -43,7 +43,7 @@ ATADeviceInterface& ATADeviceInterface::operator<<(MountpointInterface* Data)
if (!Data)
return *this;
- for (SizeT driveCount = 0; driveCount < kDriveManagerCount; ++driveCount)
+ for (SizeT driveCount = 0; driveCount < kDriveMgrCount; ++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 < kDriveManagerCount; ++driveCount)
+ for (SizeT driveCount = 0; driveCount < kDriveMgrCount; ++driveCount)
{
auto interface = Data->GetAddressOf(driveCount);
if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0)
diff --git a/dev/ZKA/Sources/User.cxx b/dev/ZKA/Sources/User.cxx
index 871d011f..5aa688be 100644
--- a/dev/ZKA/Sources/User.cxx
+++ b/dev/ZKA/Sources/User.cxx
@@ -13,7 +13,7 @@
#include <KernelKit/LPC.hxx>
#include <KernelKit/User.hxx>
#include <NewKit/KernelCheck.hxx>
-#include <KernelKit/FileManager.hxx>
+#include <KernelKit/FileMgr.hxx>
#include <KernelKit/UserProcessScheduler.hxx>
#include <KernelKit/Heap.hxx>
diff --git a/dev/ZKA/Sources/UserProcessScheduler.cxx b/dev/ZKA/Sources/UserProcessScheduler.cxx
index 26d8be79..48988e57 100644
--- a/dev/ZKA/Sources/UserProcessScheduler.cxx
+++ b/dev/ZKA/Sources/UserProcessScheduler.cxx
@@ -34,7 +34,7 @@ namespace Kernel
/// @brief UserProcess scheduler instance.
/***********************************************************************************/
- STATIC UserProcessScheduler* cProcessScheduler;
+ STATIC UserProcessScheduler* cProcessScheduler = nullptr;
/// @brief Gets the last exit code.
/// @note Not thread-safe.