diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-29 23:10:36 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-29 23:14:16 +0100 |
| commit | 995e1580f9291c5b8e95687c59b95e561c0c4569 (patch) | |
| tree | 50616d08887f2ca193683ff188ca952a0bb0ce3e /Private/KernelKit | |
| parent | 43ae417266c3127bbae35527c95c26e01ed50bd9 (diff) | |
Kernel: See below.
- Fix ACPI.
- Parsing SDT correctly now.
- Fix ke_runtime_check line endings.
- Update Kernel heap magic and add padding to header.
- Document Code Manager add limit for process teams.
- Add execute_from_image for Code Manager.
- Add loop for scheduler inside RuntimeMain.
- Set SMP core to 4 for testing purposes.
- Check for ACPI 2.x+
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/KernelKit')
| -rw-r--r-- | Private/KernelKit/CodeManager.hpp | 17 | ||||
| -rw-r--r-- | Private/KernelKit/HError.hpp | 2 | ||||
| -rw-r--r-- | Private/KernelKit/PEFCodeManager.hxx | 5 | ||||
| -rw-r--r-- | Private/KernelKit/ProcessScheduler.hpp | 8 | ||||
| -rw-r--r-- | Private/KernelKit/UserHeap.hpp | 2 |
5 files changed, 17 insertions, 17 deletions
diff --git a/Private/KernelKit/CodeManager.hpp b/Private/KernelKit/CodeManager.hpp index 5b06e4a4..adb37ff0 100644 --- a/Private/KernelKit/CodeManager.hpp +++ b/Private/KernelKit/CodeManager.hpp @@ -21,13 +21,12 @@ #define kUPPNameLen 64 namespace NewOS { -/// \brief Much like Mac OS's UPP. -/// This is read-only by design. -/// It handles different kind of code. -/// ARM <-> AMD64 for example. -typedef struct UniversalProcedureTable final { - const Char NAME[kUPPNameLen]; - const VoidPtr TRAP; - const SizeT ARCH; -} PACKED UniversalProcedureTableType; +/// @brief Main process entrypoint. +typedef void (*MainKind)(void); + +/// @brief Executes a new process from memory. +/// @param main +/// @param processName +/// @return +bool execute_from_image(MainKind main, const char* processName); } // namespace NewOS
\ No newline at end of file diff --git a/Private/KernelKit/HError.hpp b/Private/KernelKit/HError.hpp index 6885003f..d5a16fd6 100644 --- a/Private/KernelKit/HError.hpp +++ b/Private/KernelKit/HError.hpp @@ -31,6 +31,8 @@ inline constexpr HError kErrorFormatFailed = 47; inline constexpr HError kErrorNetworkTimeout = 48; inline constexpr HError kErrorInternal = 49; inline constexpr HError kErrorForkAlreadyExists = 50; +inline constexpr HError kErrorOutOfTeamSlot = 51; +inline constexpr HError kErrorHeapNotPresent = 52; inline constexpr HError kErrorUnimplemented = 0; Boolean ke_bug_check(void) noexcept; diff --git a/Private/KernelKit/PEFCodeManager.hxx b/Private/KernelKit/PEFCodeManager.hxx index 45b475f5..ed43e924 100644 --- a/Private/KernelKit/PEFCodeManager.hxx +++ b/Private/KernelKit/PEFCodeManager.hxx @@ -11,7 +11,7 @@ #include <NewKit/ErrorOr.hpp> #include <NewKit/String.hpp> -#define kPefApplicationMime "application/x-hcore-exec" +#define kPefApplicationMime "application/x-newos-exec" namespace NewOS { /// @@ -31,9 +31,6 @@ class PEFLoader : public LoaderInterface { HCORE_COPY_DEFAULT(PEFLoader); public: - typedef void (*MainKind)(void); - - public: const char *Path() override; const char *Format() override; const char *MIME() override; diff --git a/Private/KernelKit/ProcessScheduler.hpp b/Private/KernelKit/ProcessScheduler.hpp index 0cc531b9..c9e3b379 100644 --- a/Private/KernelKit/ProcessScheduler.hpp +++ b/Private/KernelKit/ProcessScheduler.hpp @@ -14,8 +14,10 @@ #include <KernelKit/UserHeap.hpp> #include <NewKit/MutableArray.hpp> -#define kMinMicroTime AffinityKind::kHartStandard -#define kPIDInvalid (-1) +#define kSchedMinMicroTime AffinityKind::kHartStandard +#define kSchedInvalidPID (-1) + +#define kSchedProcessLimitPerTeam (100U) //////////////////////////////////////////////////// @@ -153,7 +155,7 @@ class ProcessHeader final { }; ProcessTime PTime; - PID ProcessId{kPIDInvalid}; + PID ProcessId{kSchedInvalidPID}; Int32 Ring{kRingDriverKind}; Int32 Kind{kUserKind}; diff --git a/Private/KernelKit/UserHeap.hpp b/Private/KernelKit/UserHeap.hpp index 728fcd80..c919db53 100644 --- a/Private/KernelKit/UserHeap.hpp +++ b/Private/KernelKit/UserHeap.hpp @@ -18,7 +18,7 @@ /// @brief memory heap for user programs. #define kUserHeapMaxSz (4096) -#define kUserHeapMag (0x5500A1) +#define kUserHeapMag (0xFAF0FEF0) namespace NewOS { typedef enum { |
