From 76ac1db6d286ec2f0ba1f643fea58e7b8a388a63 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 6 Dec 2025 02:19:20 -0500 Subject: chore: New readme, index.md, and updated wg02. Signed-off-by: Amlal El Mahrouss --- draft/INDEX.md | 6 +- draft/wg02/core_process_scheduler.tex | 130 ---------------------------------- draft/wg02/cpp_cps.tex | 130 ++++++++++++++++++++++++++++++++++ draft/wg03/.keep | 0 4 files changed, 133 insertions(+), 133 deletions(-) delete mode 100644 draft/wg02/core_process_scheduler.tex create mode 100644 draft/wg02/cpp_cps.tex delete mode 100644 draft/wg03/.keep (limited to 'draft') diff --git a/draft/INDEX.md b/draft/INDEX.md index e79a0b8..5ff9a1e 100644 --- a/draft/INDEX.md +++ b/draft/INDEX.md @@ -4,6 +4,6 @@ This file indexes the different working groups and their purpose. ## Working Groups -- WG01: Kernel Architecture Group. -- WG02: Multi-Tasking Group. -- WG03: Compiler Design Group. +- WG01: `Kernel Architecture Group.` +- WG02: `Multi-Tasking Group.` +- WG03: `Compiler Design Group.` diff --git a/draft/wg02/core_process_scheduler.tex b/draft/wg02/core_process_scheduler.tex deleted file mode 100644 index e0ed653..0000000 --- a/draft/wg02/core_process_scheduler.tex +++ /dev/null @@ -1,130 +0,0 @@ -\documentclass{article} -\usepackage{graphicx} -\usepackage{hyperref} - -\title{WG02: CoreProcessScheduler} -\author{Amlal El Mahrouss\\NeKernel.org} -\date{\today} - -\begin{document} - -\maketitle - -\section{Abstract} - -{The CoreProcessScheduler governs how the scheduling backend and policy of the kernel works, It is the common gateway for schedulers inside NeKernel based systems.} - -\section{Overview} - -{The CoreProcessScheduler (now referred as CPS) serves as the intermediate foundal between the scheduler backend and kernel.} {It takes care of process life-cycle management, team-based process grouping, and affinity-based CPU based allocation to mention the least.} - -\section{The Affinity System} - -{Processes are given CPU time affinity hints using an affinity kind type, these hints help the scheduler run or adjust the current process.} - -\subsection{Sample Code \#1} - -{The following sample is C++ code.} {The smaller the value, the more critical the process.} - -\begin{verbatim} -enum class AffinityKind : Int32 { - kRealTime = 100, - kVeryHigh = 150, - kHigh = 200, - kStandard = 1000, - kLowUsage = 1500, - kVeryLowUsage = 2000, -}; -\end{verbatim} - -\section{The Team System} - -{The team system holds process metadata for the backend scheduler to run on. It holds methods and fields for backend specific operations.} {One implementation of such team is the UserProcessTeam object inside NeKernel.} - -\subsection{Sample Code \#2} - -{The following sample is used to hold team metadata.} {This is part of the NeKernel source tree.} - -\begin{verbatim} -class UserProcessTeam final { - public: - explicit UserProcessTeam(); - ~UserProcessTeam() = default; - - NE_COPY_DEFAULT(UserProcessTeam) - - Array& AsArray(); - Ref& AsRef(); - ProcessID& Id() noexcept; - - public: - USER_PROCESS_ARRAY mProcessList; - USER_PROCESS_REF mCurrentProcess; - ProcessID mTeamId{0}; - ProcessID mProcessCur{0}; -}; - -\end{verbatim} - -\section{The Process Image System} - -{The process image container is a design pattern made to contain process data and metadata, its purpose comes from the lack of mainstream operating systems of such ability to hold metadata.} - -{This approach helps separate concerns and give modularity to the system, as the image and process structure are not mixed together.} - -\subsection{Sample Code \#3} - -{The following sample is a C++ container used to hold process data and metadata.} {This is part of the NeKernel source tree.} - -\begin{verbatim} -using ImagePtr = void*; - -struct PROCESS_IMAGE final { - explicit PROCESS_IMAGE() = default; - - private: - friend USER_PROCESS; - friend KERNEL_TASK; - - friend class UserProcessScheduler; - - ImagePtr fCode; - ImagePtr fBlob; - - public: - Bool HasCode() const { return this->fCode != nullptr; } - - Bool HasImage() const { return this->fBlob != nullptr; } - - ErrorOr LeakImage() { - if (this->fCode) { - return ErrorOr{this->fCode}; - } - - return ErrorOr{kErrorInvalidData}; - } - - ErrorOr LeakBlob() { - if (this->fBlob) { - return ErrorOr{this->fBlob}; - } - - return ErrorOr{kErrorInvalidData}; - } -}; - -\end{verbatim} - -\section{Conclusion} - -{The CoreProcessScheduler is a piece of systems design with robust design and useful cases, although useful in desktop/server cases, It may not be suited for every other tasks.} - -{And while one scheduler backend (such as the UserProcessScheduler) takes care of user process scheduling and fairness, the CoreProcessScheduler takes care of the foundation for those systems.} - -\section{References} - -{NeKernel}: \href{https://github.com/nekernel-org/nekernel}{NeKernel} - -{CoreProcessScheduler}: \href{https://github.com/nekernel-org/nekernel/blob/develop/src/kernel/KernelKit/CoreProcessScheduler.h}{CoreProcessScheduler} - -\end{document} \ No newline at end of file diff --git a/draft/wg02/cpp_cps.tex b/draft/wg02/cpp_cps.tex new file mode 100644 index 0000000..ad55331 --- /dev/null +++ b/draft/wg02/cpp_cps.tex @@ -0,0 +1,130 @@ +\documentclass{article} +\usepackage{graphicx} +\usepackage{hyperref} + +\title{WG02: The CoreProcessScheduler} +\author{Amlal El Mahrouss\\NeKernel.org} +\date{\today} + +\begin{document} + +\maketitle + +\section{Abstract} + +{The CoreProcessScheduler governs how the scheduling backend and policy of the kernel works, It is the common gateway for schedulers inside NeKernel based systems.} + +\section{Overview} + +{The CoreProcessScheduler (now referred as CPS) serves as the intermediate foundal between the scheduler backend and kernel.} {It takes care of process life-cycle management, team-based process grouping, and affinity-based CPU based allocation to mention the least.} + +\section{The Affinity System} + +{Processes are given CPU time affinity hints using an affinity kind type, these hints help the scheduler run or adjust the current process.} + +\subsection{Sample Code \#1} + +{The following sample is C++ code.} {The smaller the value, the more critical the process.} + +\begin{verbatim} +enum class AffinityKind : Int32 { + kRealTime = 100, + kVeryHigh = 150, + kHigh = 200, + kStandard = 1000, + kLowUsage = 1500, + kVeryLowUsage = 2000, +}; +\end{verbatim} + +\section{The Team System} + +{The team system holds process metadata for the backend scheduler to run on. It holds methods and fields for backend specific operations.} {One implementation of such team is the UserProcessTeam object inside NeKernel.} + +\subsection{Sample Code \#2} + +{The following sample is used to hold team metadata.} {This is part of the NeKernel source tree.} + +\begin{verbatim} +class UserProcessTeam final { + public: + explicit UserProcessTeam(); + ~UserProcessTeam() = default; + + NE_COPY_DEFAULT(UserProcessTeam) + + Array& AsArray(); + Ref& AsRef(); + ProcessID& Id() noexcept; + + public: + USER_PROCESS_ARRAY mProcessList; + USER_PROCESS_REF mCurrentProcess; + ProcessID mTeamId{0}; + ProcessID mProcessCur{0}; +}; + +\end{verbatim} + +\section{The Process Image System} + +{The process image container is a design pattern made to contain process data and metadata, its purpose comes from the lack of mainstream operating systems of such ability to hold metadata.} + +{This approach helps separate concerns and give modularity to the system, as the image and process structure are not mixed together.} + +\subsection{Sample Code \#3} + +{The following sample is a C++ container used to hold process data and metadata.} {This is part of the NeKernel source tree.} + +\begin{verbatim} +using ImagePtr = void*; + +struct PROCESS_IMAGE final { + explicit PROCESS_IMAGE() = default; + + private: + friend USER_PROCESS; + friend KERNEL_TASK; + + friend class UserProcessScheduler; + + ImagePtr fCode; + ImagePtr fBlob; + + public: + Bool HasCode() const { return this->fCode != nullptr; } + + Bool HasImage() const { return this->fBlob != nullptr; } + + ErrorOr LeakImage() { + if (this->fCode) { + return ErrorOr{this->fCode}; + } + + return ErrorOr{kErrorInvalidData}; + } + + ErrorOr LeakBlob() { + if (this->fBlob) { + return ErrorOr{this->fBlob}; + } + + return ErrorOr{kErrorInvalidData}; + } +}; + +\end{verbatim} + +\section{Conclusion} + +{The CoreProcessScheduler is a piece of systems design with robust design and useful cases, although useful in desktop/server cases, It may not be suited for every other tasks.} + +{And while one scheduler backend (such as the UserProcessScheduler) takes care of user process scheduling and fairness, the CoreProcessScheduler takes care of the foundation for those systems.} + +\section{References} + +{NeKernel}: \href{https://github.com/nekernel-org/nekernel}{NeKernel} + +{CoreProcessScheduler}: \href{https://github.com/nekernel-org/nekernel/blob/develop/src/kernel/KernelKit/CoreProcessScheduler.h}{CoreProcessScheduler} + +\end{document} \ No newline at end of file diff --git a/draft/wg03/.keep b/draft/wg03/.keep deleted file mode 100644 index e69de29..0000000 -- cgit v1.2.3