summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/KernelKit
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/KernelKit')
-rw-r--r--dev/kernel/KernelKit/CodeMgr.h8
-rw-r--r--dev/kernel/KernelKit/DriveMgr.h2
-rw-r--r--dev/kernel/KernelKit/IDylibObject.h2
-rw-r--r--dev/kernel/KernelKit/IPEFDylibObject.h2
-rw-r--r--dev/kernel/KernelKit/KPC.h72
-rw-r--r--dev/kernel/KernelKit/PECodeMgr.h2
-rw-r--r--dev/kernel/KernelKit/PEFCodeMgr.h6
-rw-r--r--dev/kernel/KernelKit/ProcessScheduler.h (renamed from dev/kernel/KernelKit/UserProcessScheduler.h)2
-rw-r--r--dev/kernel/KernelKit/ProcessScheduler.inl (renamed from dev/kernel/KernelKit/UserProcessScheduler.inl)4
-rw-r--r--dev/kernel/KernelKit/ThreadLocalStorage.inl2
-rw-r--r--dev/kernel/KernelKit/XCOFF.h28
11 files changed, 69 insertions, 61 deletions
diff --git a/dev/kernel/KernelKit/CodeMgr.h b/dev/kernel/KernelKit/CodeMgr.h
index 15ec420e..c781263e 100644
--- a/dev/kernel/KernelKit/CodeMgr.h
+++ b/dev/kernel/KernelKit/CodeMgr.h
@@ -33,5 +33,11 @@ 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 The team's process id.
- ProcessID rtl_create_process(rtl_main_kind main, const Char* process_name) noexcept;
+ ProcessID rtl_create_kernel_process(rtl_main_kind main, const Char* process_name) noexcept;
+
+ /// @brief Executes a new process from a function. User 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 The team's process id.
+ ProcessID rtl_create_user_process(rtl_main_kind main, const Char* process_name) noexcept;
} // namespace Kernel
diff --git a/dev/kernel/KernelKit/DriveMgr.h b/dev/kernel/KernelKit/DriveMgr.h
index 9d461703..a8c3dec5 100644
--- a/dev/kernel/KernelKit/DriveMgr.h
+++ b/dev/kernel/KernelKit/DriveMgr.h
@@ -7,7 +7,7 @@
#ifndef INC_DRIVE_MANAGER_H
#define INC_DRIVE_MANAGER_H
-#include <KernelKit/UserProcessScheduler.h>
+#include <KernelKit/ProcessScheduler.h>
#include <CompilerKit/CompilerKit.h>
#include <KernelKit/DebugOutput.h>
#include <KernelKit/DeviceMgr.h>
diff --git a/dev/kernel/KernelKit/IDylibObject.h b/dev/kernel/KernelKit/IDylibObject.h
index f02fb9d3..faecede0 100644
--- a/dev/kernel/KernelKit/IDylibObject.h
+++ b/dev/kernel/KernelKit/IDylibObject.h
@@ -16,7 +16,7 @@
namespace Kernel
{
- /// @brief DLL class object. A handle to a shared library.
+ /// @brief Dylib class object. A handle to a shared library.
class IDylibObject
{
public:
diff --git a/dev/kernel/KernelKit/IPEFDylibObject.h b/dev/kernel/KernelKit/IPEFDylibObject.h
index 22360e50..8c4ec22a 100644
--- a/dev/kernel/KernelKit/IPEFDylibObject.h
+++ b/dev/kernel/KernelKit/IPEFDylibObject.h
@@ -13,7 +13,7 @@
#include <KernelKit/PEF.h>
#include <NewKit/Defines.h>
#include <KernelKit/PEFCodeMgr.h>
-#include <KernelKit/UserProcessScheduler.h>
+#include <KernelKit/ProcessScheduler.h>
#include <KernelKit/IDylibObject.h>
namespace Kernel
diff --git a/dev/kernel/KernelKit/KPC.h b/dev/kernel/KernelKit/KPC.h
index c6724282..3e52be64 100644
--- a/dev/kernel/KernelKit/KPC.h
+++ b/dev/kernel/KernelKit/KPC.h
@@ -21,44 +21,44 @@
namespace Kernel
{
- typedef Int32 HError;
+ typedef Int32 KPCError;
- inline HError kErrorLocalNumber = 0UL;
+ inline KPCError kErrorLocalNumber = 0UL;
- inline constexpr HError kErrorSuccess = 0;
- inline constexpr HError kErrorExecutable = 33;
- inline constexpr HError kErrorExecutableLib = 34;
- inline constexpr HError kErrorFileNotFound = 35;
- inline constexpr HError kErrorDirectoryNotFound = 36;
- inline constexpr HError kErrorDiskReadOnly = 37;
- inline constexpr HError kErrorDiskIsFull = 38;
- inline constexpr HError kErrorProcessFault = 39;
- inline constexpr HError kErrorSocketHangUp = 40;
- inline constexpr HError kErrorThreadLocalStorage = 41;
- inline constexpr HError kErrorMath = 42;
- inline constexpr HError kErrorNoNetwork = 43;
- inline constexpr HError kErrorHeapOutOfMemory = 44;
- inline constexpr HError kErrorNoSuchDisk = 45;
- inline constexpr HError kErrorFileExists = 46;
- 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 kErrorNoEntrypoint = 53;
- inline constexpr HError kErrorDiskIsCorrupted = 54;
- inline constexpr HError kErrorDisk = 55;
- inline constexpr HError kErrorInvalidData = 56;
- inline constexpr HError kErrorAsync = 57;
- inline constexpr HError kErrorNonBlocking = 58;
- inline constexpr HError kErrorIPC = 59;
- inline constexpr HError kErrorSign = 60;
- inline constexpr HError kErrorInvalidCreds = 61;
- inline constexpr HError kErrorCDTrayBroken = 62;
- inline constexpr HError kErrorUnrecoverableDisk = 63;
- inline constexpr HError kErrorFileLocked = 64;
- inline constexpr HError kErrorUnimplemented = -1;
+ inline constexpr KPCError kErrorSuccess = 0;
+ inline constexpr KPCError kErrorExecutable = 33;
+ inline constexpr KPCError kErrorExecutableLib = 34;
+ inline constexpr KPCError kErrorFileNotFound = 35;
+ inline constexpr KPCError kErrorDirectoryNotFound = 36;
+ inline constexpr KPCError kErrorDiskReadOnly = 37;
+ inline constexpr KPCError kErrorDiskIsFull = 38;
+ inline constexpr KPCError kErrorProcessFault = 39;
+ inline constexpr KPCError kErrorSocketHangUp = 40;
+ inline constexpr KPCError kErrorThreadLocalStorage = 41;
+ inline constexpr KPCError kErrorMath = 42;
+ inline constexpr KPCError kErrorNoNetwork = 43;
+ inline constexpr KPCError kErrorHeapOutOfMemory = 44;
+ inline constexpr KPCError kErrorNoSuchDisk = 45;
+ inline constexpr KPCError kErrorFileExists = 46;
+ inline constexpr KPCError kErrorFormatFailed = 47;
+ inline constexpr KPCError kErrorNetworkTimeout = 48;
+ inline constexpr KPCError kErrorInternal = 49;
+ inline constexpr KPCError kErrorForkAlreadyExists = 50;
+ inline constexpr KPCError kErrorOutOfTeamSlot = 51;
+ inline constexpr KPCError kErrorHeapNotPresent = 52;
+ inline constexpr KPCError kErrorNoEntrypoint = 53;
+ inline constexpr KPCError kErrorDiskIsCorrupted = 54;
+ inline constexpr KPCError kErrorDisk = 55;
+ inline constexpr KPCError kErrorInvalidData = 56;
+ inline constexpr KPCError kErrorAsync = 57;
+ inline constexpr KPCError kErrorNonBlocking = 58;
+ inline constexpr KPCError kErrorIPC = 59;
+ inline constexpr KPCError kErrorSign = 60;
+ inline constexpr KPCError kErrorInvalidCreds = 61;
+ inline constexpr KPCError kErrorCDTrayBroken = 62;
+ inline constexpr KPCError kErrorUnrecoverableDisk = 63;
+ inline constexpr KPCError kErrorFileLocked = 64;
+ inline constexpr KPCError kErrorUnimplemented = -1;
/// @brief Does a system wide bug check.
/// @param void no params are needed.
diff --git a/dev/kernel/KernelKit/PECodeMgr.h b/dev/kernel/KernelKit/PECodeMgr.h
index 1e445b9f..cf7f625d 100644
--- a/dev/kernel/KernelKit/PECodeMgr.h
+++ b/dev/kernel/KernelKit/PECodeMgr.h
@@ -3,7 +3,7 @@
Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
File: PECodeMgr.h
- Purpose: PE32+ Code Mgr and DLL mgr.
+ Purpose: PE32+ Code Mgr and Dylib mgr.
Revision History:
diff --git a/dev/kernel/KernelKit/PEFCodeMgr.h b/dev/kernel/KernelKit/PEFCodeMgr.h
index aa82f84d..3d96c6c0 100644
--- a/dev/kernel/KernelKit/PEFCodeMgr.h
+++ b/dev/kernel/KernelKit/PEFCodeMgr.h
@@ -13,10 +13,10 @@
#include <KernelKit/FileMgr.h>
#ifndef INC_PROCESS_SCHEDULER_H
-#include <KernelKit/UserProcessScheduler.h>
+#include <KernelKit/ProcessScheduler.h>
#endif
-#define kPefApplicationMime "application/vnd-zka-executable"
+#define kPefApplicationMime "application/vnd-amlal-executable"
namespace Kernel
{
@@ -65,7 +65,7 @@ namespace Kernel
namespace Utils
{
- ProcessID rtl_create_process(PEFLoader& exec, const Int32& procKind) noexcept;
+ ProcessID rtl_create_user_process(PEFLoader& exec, const Int32& procKind) noexcept;
} // namespace Utils
} // namespace Kernel
diff --git a/dev/kernel/KernelKit/UserProcessScheduler.h b/dev/kernel/KernelKit/ProcessScheduler.h
index b9c1676b..5e88d1ec 100644
--- a/dev/kernel/KernelKit/UserProcessScheduler.h
+++ b/dev/kernel/KernelKit/ProcessScheduler.h
@@ -370,7 +370,7 @@ namespace Kernel
} // namespace Kernel
#include <KernelKit/ThreadLocalStorage.h>
-#include <KernelKit/UserProcessScheduler.inl>
+#include <KernelKit/ProcessScheduler.inl>
////////////////////////////////////////////////////
// END
diff --git a/dev/kernel/KernelKit/UserProcessScheduler.inl b/dev/kernel/KernelKit/ProcessScheduler.inl
index 4b3d5820..b624e623 100644
--- a/dev/kernel/KernelKit/UserProcessScheduler.inl
+++ b/dev/kernel/KernelKit/ProcessScheduler.inl
@@ -2,7 +2,7 @@
Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
- FILE: UserProcessScheduler.inl
+ FILE: ProcessScheduler.inl
PURPOSE: Low level/Ring-3 Process scheduler.
------------------------------------------- */
@@ -21,7 +21,7 @@ namespace Kernel
if (!this->ProcessMemoryHeap)
{
- kout << "Process Memory is empty.\r";
+ kout << "Process's heap is empty.\r";
return No;
}
diff --git a/dev/kernel/KernelKit/ThreadLocalStorage.inl b/dev/kernel/KernelKit/ThreadLocalStorage.inl
index 0517dada..f9f9da12 100644
--- a/dev/kernel/KernelKit/ThreadLocalStorage.inl
+++ b/dev/kernel/KernelKit/ThreadLocalStorage.inl
@@ -8,7 +8,7 @@
//! @brief Allocate resources from the process's heap storage.
#ifndef INC_PROCESS_SCHEDULER_H
-#include <KernelKit/UserProcessScheduler.h>
+#include <KernelKit/ProcessScheduler.h>
#endif
template <typename T>
diff --git a/dev/kernel/KernelKit/XCOFF.h b/dev/kernel/KernelKit/XCOFF.h
index d38c2e02..eb536c01 100644
--- a/dev/kernel/KernelKit/XCOFF.h
+++ b/dev/kernel/KernelKit/XCOFF.h
@@ -16,18 +16,19 @@
#include <NewKit/Defines.h>
-#define kXCOFF64Magic (0x01F7)
+#define kXCOFF64Magic (0x01F7)
+#define kXCOFF64ForkNameLen (256U)
#define kXCOFFRelFlg (0x0001)
#define kXCOFFExecutable (0x0002)
#define kXCOFFLnno (0x0004)
#define kXCOFFLSyms (0x0008)
-struct XCoffFileHeader;
-struct XCoffForkHeader;
+struct XCOFF_FILE_HEADER;
+struct XCOFF_FORK_HEADER;
/// @brief XCoff file header, meant for POWER apps.
-typedef struct XCoffFileHeader
+typedef struct XCOFF_FILE_HEADER
{
Kernel::UInt16 fMagic;
Kernel::UInt16 fTarget;
@@ -36,16 +37,17 @@ typedef struct XCoffFileHeader
Kernel::UIntPtr fSymPtr;
Kernel::UInt32 fNumSyms;
Kernel::UInt16 fOptHdr; // ?: Number of bytes in optional header
-} XCoffFileHeader64;
+} XCOFF_FILE_HEADER, XCOFF_FILE_HEADER32, XCOFF_FILE_HEADER64;
-#define kForkNameLen (256U)
-
-/// @brief This the executable manifest fork.
-typedef struct XCoffForkHeader
+/// @brief This the executable's manifest fork, designed for NeFS.
+/// @param fPropertiesXMLFork The XML fork of the executable.
+/// @param fDynamicLoaderFork The DYLD fork metadata.
+/// @param fCodeSignFork Executable's certificate contained in a fork.
+typedef struct XCOFF_FORK_HEADER
{
- Kernel::Char fPropertiesXMLFork[kForkNameLen];
- Kernel::Char fDynamicLoaderFork[kForkNameLen];
- Kernel::Char fCodeSignFork[kForkNameLen];
-} XCoffForkHeader;
+ Kernel::Char fPropertiesXMLFork[kXCOFF64ForkNameLen];
+ Kernel::Char fDynamicLoaderFork[kXCOFF64ForkNameLen];
+ Kernel::Char fCodeSignFork[kXCOFF64ForkNameLen];
+} XCOFF_FORK_HEADER;
#endif // ifndef INC_XOCFF_H