From 9b7082353e9f7bd4d3ae077959de553f437316db Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 2 Sep 2024 00:22:39 +0200 Subject: Kernel fixes and improvements. Signed-off-by: Amlal El Mahrouss --- dev/ZKA/Sources/DLLMain.cxx | 4 ++-- dev/ZKA/Sources/MP.cxx | 6 +++--- dev/ZKA/Sources/Network/IPC.cxx | 9 +++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'dev') diff --git a/dev/ZKA/Sources/DLLMain.cxx b/dev/ZKA/Sources/DLLMain.cxx index c6ec3739..d8edeaaf 100644 --- a/dev/ZKA/Sources/DLLMain.cxx +++ b/dev/ZKA/Sources/DLLMain.cxx @@ -52,7 +52,7 @@ namespace Kernel::Detail { if (Kernel::FilesystemManagerInterface::GetMounted()) { - CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.dll: NewFS IFS already mounted by HAL (A:)...", 10, 10, RGB(0, 0, 0)); + CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.dll: NewFS IFS already mounted by HAL (A:)", 10, 10, RGB(0, 0, 0)); fNewFS = reinterpret_cast(Kernel::FilesystemManagerInterface::GetMounted()); } else @@ -62,7 +62,7 @@ namespace Kernel::Detail Kernel::FilesystemManagerInterface::Mount(fNewFS); - CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.dll: Mounted NewFS IFS (A:)...", 10, 10, RGB(0, 0, 0)); + CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.dll: Mounted NewFS IFS (A:)", 10, 10, RGB(0, 0, 0)); } const Kernel::SizeT cDirCount = 7UL; diff --git a/dev/ZKA/Sources/MP.cxx b/dev/ZKA/Sources/MP.cxx index b0716e77..9c7a47f3 100644 --- a/dev/ZKA/Sources/MP.cxx +++ b/dev/ZKA/Sources/MP.cxx @@ -91,13 +91,13 @@ namespace Kernel /// @retval false stack is invalid, previous code is running. Bool HardwareThread::Switch(VoidPtr image, UInt8* stack_ptr, HAL::StackFramePtr frame) { - fStack = frame; - - if (!fStack || + if (!frame || !image || !stack_ptr) return false; + fStack = frame; + auto ret = mp_register_process(fStack); if (!ret) diff --git a/dev/ZKA/Sources/Network/IPC.cxx b/dev/ZKA/Sources/Network/IPC.cxx index 34b08b88..97702cbe 100644 --- a/dev/ZKA/Sources/Network/IPC.cxx +++ b/dev/ZKA/Sources/Network/IPC.cxx @@ -92,14 +92,19 @@ namespace Kernel if (*pckt_in) { - (*pckt_in)->IpcHeaderMagic = cXPCOMHeaderMagic; - auto endian = DEDUCE_ENDIAN((*pckt_in), ((Char*)(*pckt_in))[0]); + (*pckt_in)->IpcHeaderMagic = cXPCOMHeaderMagic; + (*pckt_in)->IpcEndianess = static_cast(endian); (*pckt_in)->IpcPacketSize = sizeof(IPC_MESSAGE_STRUCT); + + (*pckt_in)->IpcTo.UserProcessID = 0; + (*pckt_in)->IpcTo.UserProcessTeam = 0; + (*pckt_in)->IpcFrom.UserProcessID = Kernel::UserProcessScheduler::The().CurrentProcess().Leak().ProcessId; (*pckt_in)->IpcFrom.UserProcessTeam = Kernel::UserProcessScheduler::The().CurrentTeam().mTeamId; + return true; } -- cgit v1.2.3