diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-31 10:47:14 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-31 10:47:14 +0200 |
| commit | 2c4b02249ec4355a73b826909ab1889e45871faf (patch) | |
| tree | a904b374c7a738dd3dcb0a580e5667714b72682a /dev/ZKA/Sources/CodeManager.cxx | |
| parent | d65e85588388bf8c2e0dc8f6b106947110c0e815 (diff) | |
Saving progress on User scheduler implementation.
+ Working on RISC-V, ARM64, POWER64 HALs, to be able to distribute
mulitple versions of the product.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/Sources/CodeManager.cxx')
| -rw-r--r-- | dev/ZKA/Sources/CodeManager.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dev/ZKA/Sources/CodeManager.cxx b/dev/ZKA/Sources/CodeManager.cxx index 3dc08ca6..243e3441 100644 --- a/dev/ZKA/Sources/CodeManager.cxx +++ b/dev/ZKA/Sources/CodeManager.cxx @@ -6,12 +6,12 @@ #include <NewKit/Utils.hxx> #include <KernelKit/CodeManager.hxx> -#include <KernelKit/ProcessScheduler.hxx> +#include <KernelKit/UserProcessScheduler.hxx> namespace Kernel { - /// @brief Executes a new process from a function. kernel code only. - /// @note This sets up a new stack, anything on the main function that calls the kernel will not be accessible. + /// @brief Executes a new process from a function. Kernel code only. + /// @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 @@ -19,10 +19,12 @@ namespace Kernel if (!main) return false; - PROCESS_HEADER_BLOCK proc((VoidPtr)main); - proc.Kind = PROCESS_HEADER_BLOCK::kExeKind; + UserProcess proc((VoidPtr)main); + proc.Kind = UserProcess::kExeKind; + proc.StackSize = mib_cast(1); + rt_copy_memory((VoidPtr)processName, proc.Name, rt_string_len(processName)); - return ProcessScheduler::The().Add(proc) == kErrorSuccess; + return UserProcessScheduler::The().Add(proc) == kErrorSuccess; } } // namespace Kernel |
