From fdc8aaab2ad3c2f2f3f4bb4ffb71bc2d797366aa Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 24 Aug 2024 17:30:52 +0200 Subject: [IMP] Better kernel design. + If the process has a parent, and it's exited, that means that the thread must go down as well. Signed-off-by: Amlal El Mahrouss --- dev/ZKA/KernelKit/ProcessScheduler.hxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'dev/ZKA/KernelKit/ProcessScheduler.hxx') diff --git a/dev/ZKA/KernelKit/ProcessScheduler.hxx b/dev/ZKA/KernelKit/ProcessScheduler.hxx index 810886ab..826f8a89 100644 --- a/dev/ZKA/KernelKit/ProcessScheduler.hxx +++ b/dev/ZKA/KernelKit/ProcessScheduler.hxx @@ -125,7 +125,8 @@ namespace Kernel using HeapPtrKind = VoidPtr; /// @name PROCESS_HEADER_BLOCK - /// @brief Process Header (PHB). Holds information about the running process. Thread execution the THREAD_INFORMATION_BLOCK. + /// @brief Process Header Block (PHB). + /// Holds information about the running process/thread. struct PROCESS_HEADER_BLOCK final { public: @@ -145,7 +146,7 @@ namespace Kernel public: Char Name[kProcessLen] = {"PROCESS #0 (TEAM 0)"}; ProcessSubsystem SubSystem{ProcessSubsystem::eProcessSubsystemInvalid}; - ProcessLevelRing Selector{ProcessLevelRing::kRingStdUser}; + User* AssignedOwner{nullptr}; HAL::StackFramePtr StackFrame{nullptr}; AffinityKind Affinity{AffinityKind::kStandard}; ProcessStatus Status{ProcessStatus::kDead}; @@ -158,6 +159,8 @@ namespace Kernel // shared library handle, reserved for kSharedObjectKind types of executables only. PEFSharedObjectInterface* DLLPtr{nullptr}; + PROCESS_HEADER_BLOCK* Parent{nullptr}; + // Memory usage. SizeT UsedMemory{0}; SizeT FreeMemory{0}; @@ -209,7 +212,7 @@ namespace Kernel //! @return Int32 local error code. Int32& GetLocalCode() noexcept; - const ProcessLevelRing& GetLevelRing() noexcept; + const User* GetOwner() noexcept; const ProcessStatus& GetStatus() noexcept; const AffinityKind& GetAffinity() noexcept; -- cgit v1.2.3