diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-15 20:11:35 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-15 20:11:35 +0100 |
| commit | 617f8b0b464978abd0089fb36cfa94a0111b1bc3 (patch) | |
| tree | 386fa7be6210c99d888bd5dd8df6369b85f28b27 | |
| parent | 68d7aa8875225e87b81a8b3792ad929281f3689f (diff) | |
chore: heavy documentation improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | source/wg01/wg01.tex | 28 | ||||
| -rw-r--r-- | source/wg02/wg02.tex | 30 |
2 files changed, 23 insertions, 35 deletions
diff --git a/source/wg01/wg01.tex b/source/wg01/wg01.tex index 4d22f1f..dc342ef 100644 --- a/source/wg01/wg01.tex +++ b/source/wg01/wg01.tex @@ -1,7 +1,7 @@ % AUTHOR: Amlal El Mahrouss -% PURPOSE: Kernel C++: A Methodology for Freestanding Development +% PURPOSE: WG01: Kernel C++: A Methodology for Freestanding Development -\documentclass[11pt, a4paper]{extarticle} +\documentclass[11pt, a4paper]{article} \usepackage{graphicx} \usepackage{listings} \usepackage{xcolor} @@ -16,7 +16,7 @@ \definecolor{codepurple}{rgb}{0.58,0,0.82} \title{Kernel C++: A Methodology for Freestanding Development} -\author{Amlal El Mahrouss} +\author{Amlal El Mahrouss\\amlal@nekernel.org} \date{December 2025} \lstset{ @@ -44,7 +44,7 @@ \begin{document} -\maketitle +\bf \maketitle \begin{center} \rule[1cm]{17cm}{0.01cm} @@ -58,24 +58,18 @@ However, when correctly applying C++ principles to kernel development, it become } \section{The Three Principles of Kernel C++.} -\subsection{Part One: The C++ Runtime.} +\subsection{Part One: The Run-Time Domain.} { The problem lies in the C++ runtime, which assumes an existing host. The contrary of a hosted environment, freestanding, is a runtime which doesn't expect a hosted runtime. Such freestanding target may make use of compile-time evaluation of the C++ programming alongside a minimal C++ runtime to write such programs. } -\subsection{Part Two: Compile-Time Evaluation.} +\subsection{Part Two: The Compile-Time Evaluation Domain.} { One may avoid Virtual Method Tables or a runtime when possible. While focusing instead on meta-programming and compile-time features offered by C++. For example one may use templates to implement a scheduling policy algorithm. One example of such implementation may be: \begin{lstlisting} -/// Reference Implementation: https://github.com -/// /nekernel-org/nekernel/blob/develop/src/kernel/ -/// KernelKit/CoreProcessScheduler.h#L51-L76 -/// AND: https://github.com/nekernel-org/nekernel/blob/develop/src/kernel -/// /KernelKit/CoreProcessScheduler.h#L78-L105 - struct FileTree final { static constexpr bool is_virtual_memory = false; static constexpr bool is_memory = false; @@ -96,7 +90,6 @@ struct MemoryTree final { The Virtual Method Table (now defined as the VMT) is a big part of the problem, one may illustrate the following: \begin{lstlisting} -/// Link: https://godbolt.org/z/aK6Y98xnd /// /std:c++20 /Wall #include <iostream> @@ -124,7 +117,7 @@ int main() { B callImpl; callImpl.doImpl(); } -\end{lstlisting} The following can instead be done to achieve similar results using the Compile-Time Evaluation Domain. +\end{lstlisting} Source: \href{https://godbolt.org/z/aK6Y98xnd}{https://godbolt.org/z/aK6Y98xnd}. The following can instead be done to achieve similar results using the Compile-Time Evaluation Domain. \begin{lstlisting} inline constexpr auto kInvalidType = 0; @@ -133,7 +126,7 @@ template <class Driver> concept IsValidDriver = requires(Driver drv) { { drv.IsActive() && drv.Type() > kInvalidType }; }; -\end{lstlisting} Source: \href{https://github.com/nekernel-org/nekernel/blob/develop/src/libDDK/DriverKit/c%2B%2B/driver_base.h}{https://github.com/nekernel-org/nekernel/blob/develop/src/libDDK/DriverKit/c\%2B\%2B/driver\_base.h} Now, the problem with freestanding development is that such feature may be abused, and it is mitigated by following the TTPI. +\end{lstlisting} Source: \href{https://github.com/nekernel-org/nekernel/blob/develop/src/libDDK/DriverKit/c%2B%2B/driver_base.h}{https://github.com/nekernel-org/nekernel/blob/develop/src/libDDK/DriverKit/c\%2B\%2B/driver\_base.h}. Now, the problem with freestanding development is that such feature may be abused, and it is mitigated by following the TTPI. \subsection{The Three Prongs on Inheritance Decision Framework.} @@ -180,13 +173,12 @@ template <typename Type, FallbackType OnFallback> concept IsVettable = requires() { { Vettable<Type>::kValue ? TrueResult<Type>::kValue : OnFallback(PropertyResult<Type>::kValue) }; }; -\end{lstlisting} Source: \href{https://github.com/nekernel-org/nekernel/blob/develop/src/kernel/NeKit/Vettable.h}{https://github.com/nekernel-org/nekernel/blob/develop/src/kernel/NeKit/Vettable.h} +\end{lstlisting} Source: \href{https://github.com/nekernel-org/nekernel/blob/develop/src/kernel/NeKit/Vettable.h}{https://github.com/nekernel-org/nekernel/blob/develop/src/kernel/NeKit/Vettable.h}. \section{Conclusion} { -We can now conclude that C++ in Kernel Development is indeed possible under a subset of C++, here called Kernel C++. +Modern C++ in a freestanding domain is indeed possible granted the above concepts are applied and respected. A reference implementation of this paper exists, It's called NeKernel.org, available under the same internet address. -We are looking forward to any questions or inquiries at: contact@nekernel.org. } \section{References} diff --git a/source/wg02/wg02.tex b/source/wg02/wg02.tex index 5dd586d..cbc119b 100644 --- a/source/wg02/wg02.tex +++ b/source/wg02/wg02.tex @@ -1,5 +1,5 @@ % AUTHOR: Amlal El Mahrouss -% PURPOSE: he CoreProcessScheduler +% PURPOSE: WG02: CoreProcessScheduler \documentclass[11pt, a4paper]{article} \usepackage{graphicx} @@ -8,8 +8,8 @@ \usepackage{hyperref} \usepackage[margin=0.5in,top=1in,bottom=1in]{geometry} -\title{CoreProcessScheduler: Governance of Process and Image lifetime.} -\author{Amlal El Mahrouss} +\title{CoreProcessScheduler: Methodology for Process and Image Computation.} +\author{Amlal El Mahrouss\\amlal@nekernel.org} \date{December 2025} \definecolor{codegray}{gray}{0.95} @@ -42,7 +42,7 @@ \begin{document} -\maketitle +\bf \maketitle \begin{center} \rule[1cm]{17cm}{0.01cm} @@ -51,15 +51,15 @@ \abstract {CoreProcessScheduler governs how the scheduling backend and policy of the kernel works, It is the common gateway for schedulers inside NeKernel based systems.} -\section{Introduction} +\section{Introduction.} {CoreProcessScheduler (now referred as CPS) serves as the foundation 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.} -\subsection{The Affinity System} +\subsection{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} +\subsection{Illustration: the Affinity Kind.} {The following sample is C++ code.} {The smaller the value, the more critical the process.} @@ -74,11 +74,11 @@ enum struct AffinityKind : Int32 { }; \end{lstlisting} -\subsection{The Team System} +\subsection{The Team Domain 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} +\subsection{Illustration: Team System.} {The following sample is used to hold team metadata.} {This is part of the NeKernel source tree.} @@ -104,11 +104,9 @@ class UserProcessTeam final { \subsection{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.} +{The `ProcessImage' container is a system designed to contain process data, and metadata, its purpose comes from the need to separate data and code. Such usage is useful for validation and vettability.} {This approach helps separate concerns and give modularity to the system, as the image and process structure are not mixed together.} -{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} +\subsection{Illustration: Process Image System.} {The following sample is a C++ container used to hold process data and metadata.} {This is part of the NeKernel source tree.} @@ -150,11 +148,9 @@ struct ProcessImage final { }; \end{lstlisting} -\section{Conclusion} - -{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.} +\section{Conclusion.} -{And while one scheduler backend (such as the UserProcessScheduler) takes care of user process scheduling and fairness, CoreProcessScheduler takes care of the foundation for those systems.} +{The CPS is a system with provable domains and separation of computation, the CPS itself governs how a Process Domain shall compute its child processes, it does not provide the algorithms.} {Which is why, one scheduler backend (such as the UserProcessScheduler) takes care of user process scheduling and fairness.} \section{References} |
