summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-31 16:16:08 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-31 16:16:08 +0200
commita8eacc4a5d7f89b497b8be552491dba26fa68162 (patch)
tree83cd06ec03a662cfd51abadf762a9e77dfba2c92 /dev
parent20df23fab3e0c7c3b0559585622345f20b25e9be (diff)
[ IMP ] Improvements over PEF loader, and new thread loading API, to
load new threads form syscalls. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev')
-rw-r--r--dev/ZKA/KernelKit/CodeManager.hxx2
-rw-r--r--dev/ZKA/Sources/CodeManager.cxx2
-rw-r--r--dev/ZKA/Sources/DLLMain.cxx7
-rw-r--r--dev/ZKA/Sources/MP.cxx1
-rw-r--r--dev/ZKA/Sources/PEFCodeManager.cxx5
5 files changed, 6 insertions, 11 deletions
diff --git a/dev/ZKA/KernelKit/CodeManager.hxx b/dev/ZKA/KernelKit/CodeManager.hxx
index aa384123..ef9d18f4 100644
--- a/dev/ZKA/KernelKit/CodeManager.hxx
+++ b/dev/ZKA/KernelKit/CodeManager.hxx
@@ -27,5 +27,5 @@ namespace Kernel
/// @note This sets up a new stack, anything on the main function that calls the Kernel will not be accessible.
/// @param main the start of the process.
/// @return if the process was started or not.
- bool execute_from_image(MainKind main, const Char* process_name) noexcept;
+ bool sched_execute_thread(MainKind main, const Char* process_name) noexcept;
} // namespace Kernel
diff --git a/dev/ZKA/Sources/CodeManager.cxx b/dev/ZKA/Sources/CodeManager.cxx
index 585c7c01..c8f76309 100644
--- a/dev/ZKA/Sources/CodeManager.cxx
+++ b/dev/ZKA/Sources/CodeManager.cxx
@@ -14,7 +14,7 @@ namespace Kernel
/// @note This sets up a new stack, anything on the main function that calls the Kernel will not be accessible.
/// @param main the start of the process.
/// @return if the process was started or not.
- bool execute_from_image(MainKind main, const Char* processName) noexcept
+ bool sched_execute_thread(MainKind main, const Char* processName) noexcept
{
if (!main)
return false;
diff --git a/dev/ZKA/Sources/DLLMain.cxx b/dev/ZKA/Sources/DLLMain.cxx
index 8f5d1977..e8436411 100644
--- a/dev/ZKA/Sources/DLLMain.cxx
+++ b/dev/ZKA/Sources/DLLMain.cxx
@@ -213,13 +213,6 @@ EXTERN_C Kernel::Void ke_dll_entrypoint(Kernel::Void)
CG::CGDrawStringToWnd(cKernelWnd, kSysDrv, 20, 10 + (FONT_SIZE_X * Kernel::rt_string_len("newoskrnl.dll: Missing catalog: ")), RGB(0, 0, 0));
}
- STATIC auto main_kind = []() -> void {
- auto number_own = 8;
- while (Yes);
- };
-
- Kernel::execute_from_image(main_kind, "ZKA Logger");
-
while (Yes)
{
Kernel::ProcessHelper::StartScheduling();
diff --git a/dev/ZKA/Sources/MP.cxx b/dev/ZKA/Sources/MP.cxx
index 5be23422..5df86fd6 100644
--- a/dev/ZKA/Sources/MP.cxx
+++ b/dev/ZKA/Sources/MP.cxx
@@ -102,7 +102,6 @@ namespace Kernel
if (!ret)
{
- /// TODO: start timer to schedule another process here.
return mp_do_context_switch(image, stack_ptr, fStack) != 0;
}
diff --git a/dev/ZKA/Sources/PEFCodeManager.cxx b/dev/ZKA/Sources/PEFCodeManager.cxx
index 3d740a87..8dbfd029 100644
--- a/dev/ZKA/Sources/PEFCodeManager.cxx
+++ b/dev/ZKA/Sources/PEFCodeManager.cxx
@@ -13,6 +13,9 @@
#include <NewKit/OwnPtr.hxx>
#include <NewKit/String.hxx>
+/// @brief PEF stack size symbol.
+#define cPefStackSizeSymbol "SizeOfReserveStack"
+
namespace Kernel
{
namespace Detail
@@ -203,7 +206,7 @@ namespace Kernel
proc.SetEntrypoint(errOrStart.Leak().Leak());
proc.Kind = procKind;
- proc.StackSize = *(UIntPtr*)exec.FindSymbol("__STACK_SIZE", kPefData);
+ proc.StackSize = *(UIntPtr*)exec.FindSymbol(cPefStackSizeSymbol, kPefData);
if (!proc.StackSize)
{