From a13e1c0911c0627184bc38f18c7fdda64447b3ad Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 23 Mar 2025 19:13:48 +0100 Subject: meta(kernel): Reworked repository's filesystem structure. Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss --- dev/kernel/src/CodeMgr.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dev/kernel/src/CodeMgr.cc (limited to 'dev/kernel/src/CodeMgr.cc') diff --git a/dev/kernel/src/CodeMgr.cc b/dev/kernel/src/CodeMgr.cc new file mode 100644 index 00000000..c639155d --- /dev/null +++ b/dev/kernel/src/CodeMgr.cc @@ -0,0 +1,28 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +namespace NeOS +{ + /***********************************************************************************/ + /// @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. + /***********************************************************************************/ + + ProcessID rtl_create_process(rtl_main_kind main, const Char* process_name) noexcept + { + if (!process_name || + *process_name == 0) + return kProcessInvalidID; + + return UserProcessScheduler::The().Spawn(process_name, reinterpret_cast(main), nullptr); + } +} // namespace NeOS -- cgit v1.2.3