summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-09-02 00:03:03 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-09-02 00:05:22 +0200
commitab69a596a336d9874555672a154c4f48e0ed1020 (patch)
tree5cb4abec909c1b2a63e016d60b1a83d471be1d6a
parenta65b375680f63f5d4621941f49834255b9a567fb (diff)
[ IMP ] Reserve system call interrupt for user code only.
[ FIX ] Fix mm_update_page function, which pde index instead of pte index. [ IMP ] New .drawio files. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
-rw-r--r--dev/ZKA/HALKit/AMD64/HalDescriptorLoader.cxx22
-rw-r--r--dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm17
-rw-r--r--dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm1
-rw-r--r--dev/ZKA/HALKit/AMD64/HalPageAlloc.hxx35
-rw-r--r--dev/ZKA/HALKit/AMD64/HalProcessor.cxx28
-rw-r--r--dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx2
-rw-r--r--dev/ZKA/HALKit/AMD64/HalUtils.asm2
-rw-r--r--dev/ZKA/HALKit/AMD64/Processor.hxx2
-rw-r--r--dev/ZKA/KernelKit/LPC.hxx2
-rw-r--r--dev/ZKA/KernelKit/UserProcessScheduler.hxx18
-rw-r--r--dev/ZKA/NetworkKit/IPC.hxx8
-rw-r--r--dev/ZKA/Sources/CodeManager.cxx6
-rw-r--r--dev/ZKA/Sources/DLLMain.cxx9
-rw-r--r--dev/ZKA/Sources/Network/IPC.cxx4
-rw-r--r--dev/ZKA/Sources/ProcessTeam.cxx8
-rw-r--r--dev/ZKA/Sources/UserProcessScheduler.cxx2
-rw-r--r--doc/OS-Design.drawio17
-rw-r--r--doc/OS-Scheduler-Design.drawio25
-rw-r--r--doc/OS-Timer-Design.drawio (renamed from doc/OS-Timer-Architecture.drawio)9
-rw-r--r--doc/SCHEDULER_INFO.md2
20 files changed, 130 insertions, 89 deletions
diff --git a/dev/ZKA/HALKit/AMD64/HalDescriptorLoader.cxx b/dev/ZKA/HALKit/AMD64/HalDescriptorLoader.cxx
index 2e61b249..adf8de2e 100644
--- a/dev/ZKA/HALKit/AMD64/HalDescriptorLoader.cxx
+++ b/dev/ZKA/HALKit/AMD64/HalDescriptorLoader.cxx
@@ -49,21 +49,21 @@ namespace Kernel::HAL
Void IDTLoader::Load(Register64& idt)
{
- volatile ::Kernel::UIntPtr** baseIdt = (volatile ::Kernel::UIntPtr**)idt.Base;
+ volatile ::Kernel::UIntPtr** ptr_ivt = (volatile ::Kernel::UIntPtr**)idt.Base;
- for (UInt16 i = 0; i < kKernelIdtSize; ++i)
+ for (UInt16 idt_indx = 0; idt_indx < kKernelIdtSize; ++idt_indx)
{
- MUST_PASS(baseIdt[i]);
+ MUST_PASS(ptr_ivt[idt_indx]);
- Detail::kInterruptVectorTable[i].Selector = kGdtCodeSelector;
- Detail::kInterruptVectorTable[i].Ist = 0x0;
- Detail::kInterruptVectorTable[i].TypeAttributes = kInterruptGate;
- Detail::kInterruptVectorTable[i].OffsetLow = ((UIntPtr)baseIdt[i] & __INT16_MAX__);
- Detail::kInterruptVectorTable[i].OffsetMid = (((UIntPtr)baseIdt[i] >> 16) & __INT16_MAX__);
- Detail::kInterruptVectorTable[i].OffsetHigh =
- (((UIntPtr)baseIdt[i] >> 32) & __INT32_MAX__);
+ Detail::kInterruptVectorTable[idt_indx].Selector = idt_indx == kSyscallRoute ? kGdtUserCodeSelector : kGdtCodeSelector;
+ Detail::kInterruptVectorTable[idt_indx].Ist = 0;
+ Detail::kInterruptVectorTable[idt_indx].TypeAttributes = kInterruptGate;
+ Detail::kInterruptVectorTable[idt_indx].OffsetLow = ((UIntPtr)ptr_ivt[idt_indx] & __INT16_MAX__);
+ Detail::kInterruptVectorTable[idt_indx].OffsetMid = (((UIntPtr)ptr_ivt[idt_indx] >> 16) & __INT16_MAX__);
+ Detail::kInterruptVectorTable[idt_indx].OffsetHigh =
+ (((UIntPtr)ptr_ivt[idt_indx] >> 32) & __INT32_MAX__);
- Detail::kInterruptVectorTable[i].Zero = 0x0;
+ Detail::kInterruptVectorTable[idt_indx].Zero = 0x0;
}
Detail::kRegIdt.Base = reinterpret_cast<UIntPtr>(Detail::kInterruptVectorTable);
diff --git a/dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm b/dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm
index 2eae172a..5fe8b1aa 100644
--- a/dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm
+++ b/dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm
@@ -37,6 +37,7 @@ extern idt_handle_gpf
extern idt_handle_pf
extern ke_io_write
extern idt_handle_ud
+extern idt_handle_generic
section .text
@@ -64,7 +65,21 @@ __ZKA_INT_6:
iretq
IntNormal 7
-IntExp 8
+
+;; Invalid opcode interrupt
+__ZKA_INT_8:
+ cli
+
+ push rax
+
+ mov rcx, rsp
+ call idt_handle_generic
+
+ pop rax
+
+ sti
+ iretq
+
IntNormal 9
IntExp 10
IntExp 11
diff --git a/dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm b/dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm
index b9892d74..42d5ffe5 100644
--- a/dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm
+++ b/dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm
@@ -22,6 +22,7 @@ section .text
;; rdx: stack ptr.
mp_do_context_switch:
mov r11, 0x0202
+ mov rsp, rdx
o64 sysret
;; @brief Gets the current stack frame.
diff --git a/dev/ZKA/HALKit/AMD64/HalPageAlloc.hxx b/dev/ZKA/HALKit/AMD64/HalPageAlloc.hxx
index 81ea2bd8..0cfa5ed8 100644
--- a/dev/ZKA/HALKit/AMD64/HalPageAlloc.hxx
+++ b/dev/ZKA/HALKit/AMD64/HalPageAlloc.hxx
@@ -40,18 +40,23 @@ EXTERN_C Kernel::VoidPtr hal_read_cr3(); // @brief Page table.
namespace Kernel::HAL
{
- struct PACKED PageTable64 final
+ struct PACKED ZKA_PTE final
{
- bool Present : 1;
- bool Rw : 1;
- bool User : 1;
- bool Wt : 1;
- bool Cache : 1;
- bool Accessed : 1;
- Kernel::Int32 Reserved : 6;
- Kernel::UInt64 PhysicalAddress : 36;
- Kernel::Int32 Reserved1 : 15;
- bool ExecDisable : 1;
+ UInt8 Present : 1;
+ UInt8 Rw : 1;
+ UInt8 User : 1;
+ UInt8 Wt : 1;
+ UInt8 Cache : 1;
+ UInt8 Accessed : 1;
+ UInt8 Dirty : 1;
+ UInt8 PageSize : 1;
+ UInt8 Global : 1;
+ UInt8 Available : 3;
+ UInt64 PhysicalAddress : 39;
+ UInt8 Reserved : 6;
+ UInt8 ProtectionKey : 1;
+ UInt8 ExecDisable : 1;
+ UInt8 ReservedEx : 3;
};
namespace Detail
@@ -77,9 +82,9 @@ namespace Kernel::HAL
}
} // namespace Detail
- struct PageDirectory64 final
+ struct ZKA_PDE final
{
- PageTable64 ALIGN(kPTEAlign) Pte[kPTEMax];
+ ZKA_PTE ALIGN(kPTEAlign) Pte[kPTEMax];
};
auto hal_alloc_page(Boolean rw, Boolean user, SizeT size) -> VoidPtr;
@@ -88,6 +93,6 @@ namespace Kernel::HAL
namespace Kernel
{
- typedef HAL::PageTable64 PTE;
- typedef HAL::PageDirectory64 PDE;
+ typedef HAL::ZKA_PTE PTE;
+ typedef HAL::ZKA_PDE PDE;
} // namespace Kernel
diff --git a/dev/ZKA/HALKit/AMD64/HalProcessor.cxx b/dev/ZKA/HALKit/AMD64/HalProcessor.cxx
index dffaed3e..457752b7 100644
--- a/dev/ZKA/HALKit/AMD64/HalProcessor.cxx
+++ b/dev/ZKA/HALKit/AMD64/HalProcessor.cxx
@@ -18,25 +18,31 @@ namespace Kernel::HAL
{
EXTERN_C Int32 mm_update_page(VoidPtr pd_base, VoidPtr phys_addr, VoidPtr virt_addr, UInt32 flags)
{
- UIntPtr pde_idx = (UIntPtr)virt_addr >> 22;
- UIntPtr pte_idx = (UIntPtr)virt_addr >> 12 & 0x03FF;
+ UIntPtr pte_idx = (UIntPtr)virt_addr >> 12;
- volatile PTE* pte = (volatile PTE*)((UIntPtr)pd_base + (kPTEAlign * pde_idx));
+ volatile PTE* pte = (volatile PTE*)((UIntPtr)pd_base + (kPTEAlign * pte_idx));
if (pte)
{
- if ((flags & eFlagsSetPhysAddress))
- pte->PhysicalAddress = (UInt32)(UIntPtr)phys_addr;
+ if (flags & eFlagsSetPhysAddress)
+ pte->PhysicalAddress = (UIntPtr)phys_addr >> 12;
- pte->Present = flags & eFlagsPresent;
- pte->Rw = flags & eFlagsRw;
- pte->User = flags & eFlagsUser;
- pte->ExecDisable = flags & eFlagsExecDisable;
+ if (flags & eFlagsPresent)
+ pte->Present = flags & eFlagsPresent;
- return 0;
+ if (flags & eFlagsRw)
+ pte->Rw = flags & eFlagsRw;
+
+ if (flags & eFlagsUser)
+ pte->User = flags & eFlagsUser;
+
+ if (flags & eFlagsExecDisable)
+ pte->ExecDisable = flags & eFlagsExecDisable;
+
+ return Yes;
}
- return 1;
+ return No;
}
Void Out8(UInt16 port, UInt8 value)
diff --git a/dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx b/dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx
index b3449026..e8a89f85 100644
--- a/dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx
+++ b/dev/ZKA/HALKit/AMD64/HalSchedulerCore.cxx
@@ -14,7 +14,7 @@ Void UserProcess::SetEntrypoint(VoidPtr imageStart) noexcept
if (imageStart == nullptr)
this->Crash();
- HAL::mm_update_page(hal_read_cr3(), 0, imageStart, HAL::eFlagsPresent | HAL::eFlagsRw | HAL::eFlagsUser);
+ HAL::mm_update_page(hal_read_cr3(), 0, imageStart, HAL::eFlagsPresent | HAL::eFlagsUser);
this->Image = imageStart;
}
diff --git a/dev/ZKA/HALKit/AMD64/HalUtils.asm b/dev/ZKA/HALKit/AMD64/HalUtils.asm
index 91bf216e..0e4caf2b 100644
--- a/dev/ZKA/HALKit/AMD64/HalUtils.asm
+++ b/dev/ZKA/HALKit/AMD64/HalUtils.asm
@@ -18,7 +18,7 @@ section .text
rt_install_tib:
mov rcx, gs ;; TIB -> Thread Information Block
- mov rdx, fs ;; PIB -> UserProcess Information Block
+ mov rdx, fs ;; PIB -> Process Information Block
ret
;; //////////////////////////////////////////////////// ;;
diff --git a/dev/ZKA/HALKit/AMD64/Processor.hxx b/dev/ZKA/HALKit/AMD64/Processor.hxx
index ee68a7ed..570346c1 100644
--- a/dev/ZKA/HALKit/AMD64/Processor.hxx
+++ b/dev/ZKA/HALKit/AMD64/Processor.hxx
@@ -33,7 +33,7 @@ EXTERN_C
#define kTrapGate (0xEF)
#define kTaskGate (0b10001100)
#define kGdtCodeSelector (0x08)
-#define kGdtUserCodeSelector (0x10)
+#define kGdtUserCodeSelector (0x2b)
namespace Kernel
{
diff --git a/dev/ZKA/KernelKit/LPC.hxx b/dev/ZKA/KernelKit/LPC.hxx
index 746f0d2a..9a14c798 100644
--- a/dev/ZKA/KernelKit/LPC.hxx
+++ b/dev/ZKA/KernelKit/LPC.hxx
@@ -9,7 +9,7 @@
#include <NewKit/Defines.hxx>
/// @file LPC.hxx
-/// @brief Local UserProcess Codes.
+/// @brief Local Process Codes.
#define ErrLocalIsOk() (Kernel::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() == Kernel::kErrorSuccess)
#define ErrLocalFailed() (Kernel::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() != Kernel::kErrorSuccess)
diff --git a/dev/ZKA/KernelKit/UserProcessScheduler.hxx b/dev/ZKA/KernelKit/UserProcessScheduler.hxx
index 3a393874..b881c3dc 100644
--- a/dev/ZKA/KernelKit/UserProcessScheduler.hxx
+++ b/dev/ZKA/KernelKit/UserProcessScheduler.hxx
@@ -25,11 +25,11 @@
namespace Kernel
{
- //! @brief Forward declarations.
- struct UserProcess;
+ //! @note Forward declarations.
+ class UserProcess;
class PEFDLLInterface;
- class ProcessTeam;
+ class UserProcessTeam;
class UserProcessScheduler;
class ProcessHelper;
@@ -226,13 +226,13 @@ namespace Kernel
/// \brief Processs Team (contains multiple processes inside it.)
/// Equivalent to a process batch
- class ProcessTeam final
+ class UserProcessTeam final
{
public:
- explicit ProcessTeam() = default;
- ~ProcessTeam() = default;
+ explicit UserProcessTeam() = default;
+ ~UserProcessTeam() = default;
- ZKA_COPY_DEFAULT(ProcessTeam);
+ ZKA_COPY_DEFAULT(UserProcessTeam);
Array<UserProcess, kSchedProcessLimitPerTeam>& AsArray();
Ref<UserProcess>& AsRef();
@@ -262,7 +262,7 @@ namespace Kernel
bool operator!();
public:
- ProcessTeam& CurrentTeam();
+ UserProcessTeam& CurrentTeam();
public:
SizeT Add(UserProcess& processRef);
@@ -276,7 +276,7 @@ namespace Kernel
STATIC UserProcessScheduler& The();
private:
- ProcessTeam mTeam;
+ UserProcessTeam mTeam;
};
/*
diff --git a/dev/ZKA/NetworkKit/IPC.hxx b/dev/ZKA/NetworkKit/IPC.hxx
index d71248cf..0d9bc76a 100644
--- a/dev/ZKA/NetworkKit/IPC.hxx
+++ b/dev/ZKA/NetworkKit/IPC.hxx
@@ -34,8 +34,8 @@ namespace Kernel
/// @brief 128-bit IPC address.
struct PACKED IPC_ADDRESS_STRUCT final
{
- UInt64 ProcessID;
- UInt64 ProcessTeam;
+ UInt64 UserProcessID;
+ UInt64 UserProcessTeam;
////////////////////////////////////
// some operators.
@@ -43,12 +43,12 @@ namespace Kernel
bool operator==(const IPC_ADDRESS_STRUCT& addr) noexcept
{
- return addr.ProcessID == this->ProcessID && addr.ProcessTeam == this->ProcessTeam;
+ return addr.UserProcessID == this->UserProcessID && addr.UserProcessTeam == this->UserProcessTeam;
}
bool operator==(IPC_ADDRESS_STRUCT& addr) noexcept
{
- return addr.ProcessID == this->ProcessID && addr.ProcessTeam == this->ProcessTeam;
+ return addr.UserProcessID == this->UserProcessID && addr.UserProcessTeam == this->UserProcessTeam;
}
};
diff --git a/dev/ZKA/Sources/CodeManager.cxx b/dev/ZKA/Sources/CodeManager.cxx
index c8f76309..de5417a1 100644
--- a/dev/ZKA/Sources/CodeManager.cxx
+++ b/dev/ZKA/Sources/CodeManager.cxx
@@ -19,10 +19,8 @@ namespace Kernel
if (!main)
return false;
- UserProcess proc((VoidPtr)main);
-
- if (mm_is_valid_heap((VoidPtr)main))
- proc.SetEntrypoint(reinterpret_cast<VoidPtr>(main));
+ UserProcess proc;
+ proc.SetEntrypoint(reinterpret_cast<VoidPtr>(main));
proc.Kind = UserProcess::kExeKind;
proc.StackSize = mib_cast(1);
diff --git a/dev/ZKA/Sources/DLLMain.cxx b/dev/ZKA/Sources/DLLMain.cxx
index 6684ed69..c6ec3739 100644
--- a/dev/ZKA/Sources/DLLMain.cxx
+++ b/dev/ZKA/Sources/DLLMain.cxx
@@ -39,8 +39,6 @@ EXTERN Kernel::Property cKernelVersion;
STATIC CG::UI_WINDOW_STRUCT* cKernelWnd = nullptr;
-EXTERN_C void hal_switch_to_user_code(void);
-
namespace Kernel::Detail
{
/// @brief Filesystem auto formatter, additional checks are also done by the class.
@@ -192,13 +190,6 @@ EXTERN_C Kernel::Void ke_dll_entrypoint(Kernel::Void)
CG::CGDrawStringToWnd(cKernelWnd, "newoskrnl.dll: Starting ZKA System...", 30, 10, RGB(0, 0, 0));
- auto main_logger = []() -> void {
- /// TODO: Write code which calls the login process.
- while (Yes);
- };
-
- Kernel::sched_execute_thread(main_logger, "ZKA Init Thread");
-
Kernel::ProcessHelper::StartScheduling();
Kernel::ke_stop(RUNTIME_CHECK_BOOTSTRAP);
}
diff --git a/dev/ZKA/Sources/Network/IPC.cxx b/dev/ZKA/Sources/Network/IPC.cxx
index e60742ca..34b08b88 100644
--- a/dev/ZKA/Sources/Network/IPC.cxx
+++ b/dev/ZKA/Sources/Network/IPC.cxx
@@ -98,8 +98,8 @@ namespace Kernel
(*pckt_in)->IpcEndianess = static_cast<UInt8>(endian);
(*pckt_in)->IpcPacketSize = sizeof(IPC_MESSAGE_STRUCT);
- (*pckt_in)->IpcFrom.ProcessID = Kernel::UserProcessScheduler::The().CurrentProcess().Leak().ProcessId;
- (*pckt_in)->IpcFrom.ProcessTeam = Kernel::UserProcessScheduler::The().CurrentTeam().mTeamId;
+ (*pckt_in)->IpcFrom.UserProcessID = Kernel::UserProcessScheduler::The().CurrentProcess().Leak().ProcessId;
+ (*pckt_in)->IpcFrom.UserProcessTeam = Kernel::UserProcessScheduler::The().CurrentTeam().mTeamId;
return true;
}
diff --git a/dev/ZKA/Sources/ProcessTeam.cxx b/dev/ZKA/Sources/ProcessTeam.cxx
index f7282faf..bb5726f7 100644
--- a/dev/ZKA/Sources/ProcessTeam.cxx
+++ b/dev/ZKA/Sources/ProcessTeam.cxx
@@ -5,7 +5,7 @@
------------------------------------------- */
/***********************************************************************************/
-/// @file ProcessTeam.cxx
+/// @file UserProcessTeam.cxx
/// @brief UserProcess teams implementation.
/***********************************************************************************/
@@ -15,21 +15,21 @@ namespace Kernel
{
/// @brief UserProcess list array getter.
/// @return The list of process to schedule.
- Array<UserProcess, kSchedProcessLimitPerTeam>& ProcessTeam::AsArray()
+ Array<UserProcess, kSchedProcessLimitPerTeam>& UserProcessTeam::AsArray()
{
return mProcessList;
}
/// @brief Get team ID.
/// @return The team's ID.
- ProcessID& ProcessTeam::Id() noexcept
+ ProcessID& UserProcessTeam::Id() noexcept
{
return mTeamId;
}
/// @brief Current process getter.
/// @return The current process header.
- Ref<UserProcess>& ProcessTeam::AsRef()
+ Ref<UserProcess>& UserProcessTeam::AsRef()
{
return mCurrentProcess;
}
diff --git a/dev/ZKA/Sources/UserProcessScheduler.cxx b/dev/ZKA/Sources/UserProcessScheduler.cxx
index 60dbdd1b..c20c6054 100644
--- a/dev/ZKA/Sources/UserProcessScheduler.cxx
+++ b/dev/ZKA/Sources/UserProcessScheduler.cxx
@@ -363,7 +363,7 @@ namespace Kernel
/// @brief Gets the current scheduled team.
/// @return
- ProcessTeam& UserProcessScheduler::CurrentTeam()
+ UserProcessTeam& UserProcessScheduler::CurrentTeam()
{
return mTeam;
}
diff --git a/doc/OS-Design.drawio b/doc/OS-Design.drawio
index 47a51bf6..8ef0ee79 100644
--- a/doc/OS-Design.drawio
+++ b/doc/OS-Design.drawio
@@ -1,25 +1,22 @@
<mxfile host="65bd71144e">
<diagram name="Page-1" id="lDkK2i6CeL2VbSOVDvrP">
- <mxGraphModel dx="1084" dy="442" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
+ <mxGraphModel dx="764" dy="289" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
- <mxCell id="ifhO3zQZNW-sXvZMTmu8-2" value="SCI" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
+ <mxCell id="ifhO3zQZNW-sXvZMTmu8-2" value="SCI DLL (RING 3)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="235.5" y="340" width="360" height="30" as="geometry"/>
</mxCell>
- <mxCell id="ifhO3zQZNW-sXvZMTmu8-3" value="System DLLs" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
+ <mxCell id="ifhO3zQZNW-sXvZMTmu8-3" value="DLLs, programs and services. (RING 3)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="235.5" y="295" width="360" height="35" as="geometry"/>
</mxCell>
- <mxCell id="ifhO3zQZNW-sXvZMTmu8-8" value="&lt;h1 style=&quot;margin-top: 0px;&quot;&gt;System layer.&lt;/h1&gt;&lt;p&gt;This layer describes the Kernel and it's API, which makes ZKA.&lt;/p&gt;" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
- <mxGeometry x="620" y="380" width="180" height="120" as="geometry"/>
+ <mxCell id="ifhO3zQZNW-sXvZMTmu8-8" value="&lt;h1 style=&quot;margin-top: 0px;&quot;&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;System&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: 400;&quot;&gt;This describes how ZKA is structued and how we're supposed to deal with (rings included.)&lt;/span&gt;&lt;/h1&gt;" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
+ <mxGeometry x="620" y="290" width="180" height="180" as="geometry"/>
</mxCell>
- <mxCell id="ifhO3zQZNW-sXvZMTmu8-13" value="NewOS MP Kernel, DDK and it's drivers." style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
+ <mxCell id="ifhO3zQZNW-sXvZMTmu8-13" value="NewOS MP Kernel, DDK and it's drivers. (RING 0)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="235.5" y="450" width="360" height="60" as="geometry"/>
</mxCell>
- <mxCell id="2" value="&lt;h1 style=&quot;margin-top: 0px;&quot;&gt;User layer&lt;/h1&gt;&lt;div&gt;This layer is located on user space, it is containing all of the users frameworks, SCI and SCM objects.&lt;/div&gt;" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
- <mxGeometry x="620" y="250" width="180" height="120" as="geometry"/>
- </mxCell>
- <mxCell id="4" value="Subsystems (Security, Native)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
+ <mxCell id="4" value="SCI and DDK syscalls/kerncalls (RING 0/RING 2)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="235.5" y="380" width="360" height="60" as="geometry"/>
</mxCell>
</root>
diff --git a/doc/OS-Scheduler-Design.drawio b/doc/OS-Scheduler-Design.drawio
new file mode 100644
index 00000000..0ace6148
--- /dev/null
+++ b/doc/OS-Scheduler-Design.drawio
@@ -0,0 +1,25 @@
+<mxfile host="65bd71144e">
+ <diagram name="Page-1" id="lDkK2i6CeL2VbSOVDvrP">
+ <mxGraphModel dx="764" dy="289" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
+ <root>
+ <mxCell id="0"/>
+ <mxCell id="1" parent="0"/>
+ <mxCell id="ifhO3zQZNW-sXvZMTmu8-2" value="SCI DLL inside code (RING 3)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
+ <mxGeometry x="235.5" y="340" width="360" height="30" as="geometry"/>
+ </mxCell>
+ <mxCell id="ifhO3zQZNW-sXvZMTmu8-3" value="Running code (RING 3)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
+ <mxGeometry x="235.5" y="295" width="360" height="35" as="geometry"/>
+ </mxCell>
+ <mxCell id="ifhO3zQZNW-sXvZMTmu8-8" value="&lt;h1 style=&quot;margin-top: 0px;&quot;&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;ZKA Scheduler&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: 400; background-color: initial;&quot;&gt;This describes how ZKA is structued to schedule tasks.&lt;/span&gt;&lt;br&gt;&lt;/h1&gt;&lt;div&gt;A UserProcess may be attached to another one (thread)&lt;/div&gt;&lt;div&gt;Otherwise it's a process within a team.&lt;/div&gt;" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
+ <mxGeometry x="620" y="290" width="180" height="200" as="geometry"/>
+ </mxCell>
+ <mxCell id="ifhO3zQZNW-sXvZMTmu8-13" value="UserProcess structure (RING 0)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
+ <mxGeometry x="235.5" y="380" width="360" height="60" as="geometry"/>
+ </mxCell>
+ <mxCell id="4" value="HardwareThread, HardwareThreadScheduler and UserProcessScheduler (RING 0)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
+ <mxGeometry x="234" y="450" width="360" height="60" as="geometry"/>
+ </mxCell>
+ </root>
+ </mxGraphModel>
+ </diagram>
+</mxfile> \ No newline at end of file
diff --git a/doc/OS-Timer-Architecture.drawio b/doc/OS-Timer-Design.drawio
index 16b91051..ca081fd3 100644
--- a/doc/OS-Timer-Architecture.drawio
+++ b/doc/OS-Timer-Design.drawio
@@ -1,6 +1,6 @@
<mxfile host="65bd71144e">
<diagram name="Page-1" id="SMmOiZGLec9H7ruN5qyQ">
- <mxGraphModel dx="746" dy="307" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
+ <mxGraphModel dx="764" dy="289" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
@@ -29,7 +29,7 @@
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="c-_7pHU60HQ0aR4bwu-4-8" value="Scheduler context switch (on non MT mode),&lt;br&gt;Also SoftwareTimer gets implemented." style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
- <mxGeometry x="160" y="60" width="120" height="90" as="geometry"/>
+ <mxGeometry x="130" y="75" width="120" height="90" as="geometry"/>
</mxCell>
<mxCell id="c-_7pHU60HQ0aR4bwu-4-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="c-_7pHU60HQ0aR4bwu-4-10" edge="1">
<mxGeometry relative="1" as="geometry">
@@ -40,7 +40,10 @@
<mxCell id="c-_7pHU60HQ0aR4bwu-4-10" value="Hook 2 system calls for timing purposes.&lt;br&gt;(Wait, WaitUntil)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="560" y="90" width="120" height="60" as="geometry"/>
</mxCell>
+ <mxCell id="2" value="It is either abstracted like this, or has a direct interface to it." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
+ <mxGeometry x="490" y="235" width="200" height="55" as="geometry"/>
+ </mxCell>
</root>
</mxGraphModel>
</diagram>
-</mxfile>
+</mxfile> \ No newline at end of file
diff --git a/doc/SCHEDULER_INFO.md b/doc/SCHEDULER_INFO.md
index 8b4e4379..1efbc329 100644
--- a/doc/SCHEDULER_INFO.md
+++ b/doc/SCHEDULER_INFO.md
@@ -1,6 +1,6 @@
# List of ZKA schedulers.
-- User UserProcess Scheduler.
+- User Process Scheduler.
- Hardware Thread Scheduler.
These schedulers are reserved only for the user code.