diff options
Diffstat (limited to 'Private/KernelKit')
| -rw-r--r-- | Private/KernelKit/CodeManager.hpp | 8 | ||||
| -rw-r--r-- | Private/KernelKit/FileManager.hpp | 35 | ||||
| -rw-r--r-- | Private/KernelKit/ProcessScheduler.hpp | 8 | ||||
| -rw-r--r-- | Private/KernelKit/Semaphore.hpp | 4 |
4 files changed, 17 insertions, 38 deletions
diff --git a/Private/KernelKit/CodeManager.hpp b/Private/KernelKit/CodeManager.hpp index adb37ff0..a6984cfc 100644 --- a/Private/KernelKit/CodeManager.hpp +++ b/Private/KernelKit/CodeManager.hpp @@ -24,9 +24,9 @@ namespace NewOS { /// @brief Main process entrypoint. typedef void (*MainKind)(void); -/// @brief Executes a new process from memory. -/// @param main -/// @param processName -/// @return +/// @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); } // namespace NewOS
\ No newline at end of file diff --git a/Private/KernelKit/FileManager.hpp b/Private/KernelKit/FileManager.hpp index 9f7249cd..2eabd4b3 100644 --- a/Private/KernelKit/FileManager.hpp +++ b/Private/KernelKit/FileManager.hpp @@ -127,18 +127,10 @@ class NewFilesystemManager final : public FilesystemManagerInterface { bool Remove(const char *node) override; public: - NodePtr Open(const char *path, const char *r) override { - if (!path || *path == 0) return nullptr; - - if (!r || *r == 0) return nullptr; - - return this->Open(path, r); - } + NodePtr Open(const char *path, const char *r) override; public: - Void Write(NodePtr node, VoidPtr data, Int32 flags) override { - this->Write(node, data, flags); - } + Void Write(NodePtr node, VoidPtr data, Int32 flags) override; public: /** @@ -146,29 +138,16 @@ class NewFilesystemManager final : public FilesystemManagerInterface { * using OpenFork. */ - VoidPtr Read(NodePtr node, Int32 flags, SizeT sz) override { - return this->Read(node, flags, sz); - } + VoidPtr Read(NodePtr node, Int32 flags, SizeT sz) override; public: - bool Seek(NodePtr node, SizeT off) override { - if (!node || off == 0) return false; - - return this->Seek(node, off); - } - + bool Seek(NodePtr node, SizeT off); public: - SizeT Tell(NodePtr node) override { - if (!node) return kNPos; - return this->Tell(node); - } + SizeT Tell(NodePtr node) override; + bool Rewind(NodePtr node) override; - bool Rewind(NodePtr node) override { - if (!node) return false; - - return this->Seek(node, 0); - } + NewFSParser* GetImpl() noexcept; public: NewFSParser *fImpl{nullptr}; diff --git a/Private/KernelKit/ProcessScheduler.hpp b/Private/KernelKit/ProcessScheduler.hpp index c9e3b379..97ba92e3 100644 --- a/Private/KernelKit/ProcessScheduler.hpp +++ b/Private/KernelKit/ProcessScheduler.hpp @@ -30,10 +30,10 @@ class ProcessHeader; class ProcessTeam; class ProcessScheduler; -//! @brief ProcessHeader identifier. +//! @brief Process identifier. typedef Int64 ProcessID; -//! @brief ProcessHeader name length. +//! @brief Process name length. inline constexpr SizeT kProcessLen = 256U; //! @brief Forward declaration. @@ -41,7 +41,7 @@ class ProcessHeader; class ProcessScheduler; class ProcessHelper; -//! @brief ProcessHeader status enum. +//! @brief Process status enum. enum class ProcessStatus : Int32 { kStarting, kRunning, @@ -209,7 +209,7 @@ class ProcessTeam final { Ref<ProcessHeader> mCurrentProcess; }; -using ProcessPtr = ProcessHeader *; +using ProcessHeaderRef = ProcessHeader *; /// @brief ProcessHeader manager class. /// The main class which you call to schedule an app. diff --git a/Private/KernelKit/Semaphore.hpp b/Private/KernelKit/Semaphore.hpp index 0e41aa49..7324093e 100644 --- a/Private/KernelKit/Semaphore.hpp +++ b/Private/KernelKit/Semaphore.hpp @@ -13,7 +13,7 @@ namespace NewOS { class ProcessHeader; - typedef ProcessHeader* ProcessPtr; + typedef ProcessHeader* ProcessHeaderRef; /// @brief Access control class, which locks a task until one is done. class Semaphore final @@ -37,7 +37,7 @@ namespace NewOS HCORE_COPY_DEFAULT(Semaphore); private: - ProcessPtr fLockingProcess{ nullptr }; + ProcessHeaderRef fLockingProcess{ nullptr }; }; } |
