summaryrefslogtreecommitdiffhomepage
path: root/dev/SCI
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-21 23:07:43 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-21 23:07:43 +0200
commitb95b1fc42d371b08aa82fea8e92aa04b2ef5631f (patch)
tree7bde92a0378bd1be9f34c98e8620daa542f31b17 /dev/SCI
parentdc33dd4b6722d3fb60aaf10a7472162b07180f9c (diff)
Kernel+DLL: See below.
+ Document LPC functions and reworked err_bug_check function to return false when everything is OK. + Added native APIs to SCI as well (threading, loader...) + Update ReadMe(s) of the other DLLs. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/SCI')
-rw-r--r--dev/SCI/Hint.h (renamed from dev/SCI/Hint.hxx)0
-rw-r--r--dev/SCI/ReadMe.md4
-rw-r--r--dev/SCI/SCIBase.hxx60
3 files changed, 44 insertions, 20 deletions
diff --git a/dev/SCI/Hint.hxx b/dev/SCI/Hint.h
index c785f953..c785f953 100644
--- a/dev/SCI/Hint.hxx
+++ b/dev/SCI/Hint.h
diff --git a/dev/SCI/ReadMe.md b/dev/SCI/ReadMe.md
index 72732c21..00d90c14 100644
--- a/dev/SCI/ReadMe.md
+++ b/dev/SCI/ReadMe.md
@@ -1,5 +1,5 @@
-# ZKA System Call Interface.
+# ZKA's SCI.
-System Call Interface and Component Interface.
+System Call and Component Interface, used maninly to communicate with kernel and registered objects.
###### (c) ZKA Technologies, all rights reserved.
diff --git a/dev/SCI/SCIBase.hxx b/dev/SCI/SCIBase.hxx
index 1e79bbbc..982ca950 100644
--- a/dev/SCI/SCIBase.hxx
+++ b/dev/SCI/SCIBase.hxx
@@ -10,9 +10,7 @@ Purpose: SCI/M core header file (C++)
#ifndef __SCI_BASE_HXX__
#define __SCI_BASE_HXX__
-#ifdef __cplusplus
-
-#include <SCI/Hint.hxx>
+#include <SCI/Hint.h>
#define IMPORT_CXX extern "C++"
#define IMPORT_C extern "C"
@@ -96,32 +94,34 @@ typedef VoidPtr NEW_OBJECT;
typedef NEW_OBJECT DLL_OBJECT;
typedef NEW_OBJECT IO_OBJECT;
typedef NEW_OBJECT COMP_OBJECT;
+typedef NEW_OBJECT SCM_OBJECT;
// ------------------------------------------------------------------------------------------ //
// ------------------------------------------------------------------------------------------ //
-/// @note Part of NK loader API.
+/// @note Part of ZKA loader API.
// ------------------------------------------------------------------------------------------ //
-
/// @brief Get function which is part of the DLL.
/// @param symbol the symbol to look for
/// @param dll_handle the DLL handle.
/// @return the proc pointer.
-IMPORT_C VoidPtr RtlGetDLLProc(_Input const Char* symbol, _Input NEW_OBJECT dll_handle);
+IMPORT_C NEW_OBJECT LdrGetDLLProc(_Input const Char* symbol, _Input NEW_OBJECT dll_handle);
/// @brief Open DLL handle.
/// @param path
/// @param drv
/// @return
-IMPORT_C NEW_OBJECT RtlOpenDLL(_Input const Char* path, _Input const Char* drive_letter);
+IMPORT_C NEW_OBJECT LdrOpenDLL(_Input const Char* path, _Input const Char* drive_letter);
/// @brief Close DLL handle
/// @param dll_handle
/// @return
-IMPORT_C UInt0 RtlCloseDLL(_Input NEW_OBJECT dll_handle);
+IMPORT_C UInt0 LdrCloseDLL(_Input NEW_OBJECT dll_handle);
-/// @note Part of NK file API.
+// ------------------------------------------------------------------------------------------ //
+// File API.
+// ------------------------------------------------------------------------------------------ //
/// @brief Opens a file from a drive.
/// @param fs_path the filesystem path.
@@ -134,10 +134,18 @@ IMPORT_C NEW_OBJECT RtlOpenFile(const Char* fs_path, const Char* drive_letter);
/// @return
IMPORT_C UInt0 RtlCloseFile(_Input NEW_OBJECT file_desc);
+// ------------------------------------------------------------------------
+// TLS API.
+// ------------------------------------------------------------------------
+
/// @brief Installs the TIB and GIB inside the current process.
-/// @param none
+/// @param void.
/// @return > 0 error ocurred or already present, = 0 success.
-IMPORT_C UInt32 RtlInstallInfoBlocks(UInt0);
+IMPORT_C UInt32 TlsInstallIB(UInt0);
+
+// ------------------------------------------------------------------------
+// SCM API.
+// ------------------------------------------------------------------------
/// @brief Allocate new SCM object.
/// @tparam TCLS the class type.
@@ -157,27 +165,43 @@ SInt32 ScmReleaseClass(_Input TCLS* cls);
/// @brief Creates an SCM instance in the process.
/// @param handle_instance the SCM handle.
/// @param flags the SCM flags.
-SInt32 ScmCreateInstance(_Input UInt32 flags, _Output VoidPtr* handle_instance);
+IMPORT_C SInt32 ScmCreateInstance(_Input UInt32 flags, _Output SCM_OBJECT* handle_instance);
/// @brief Destroys an SCM instance of the process.
/// @param handle_instance the SCM handle.
-UInt0 ScmDestroyInstance(_Input VoidPtr handle_instance);
+IMPORT_C UInt0 ScmDestroyInstance(_Input SCM_OBJECT handle_instance);
+
+// ------------------------------------------------------------------------
+// Memory Management API.
+// ------------------------------------------------------------------------
/// @brief Creates a new heap from the process's address space.
/// @param len the length of it.
/// @param flags the flags of it.
/// @return heap pointer.
-VoidPtr RtlCreateHeap(_Input SizeT len, _Input UInt32 flags);
+IMPORT_C VoidPtr RtlCreateHeap(_Input SizeT len, _Input UInt32 flags);
/// @brief Destroys the pointer
/// @param heap the heap itself.
/// @return void.
-UInt0 RtlDestroyHeap(_Input VoidPtr heap);
+IMPORT_C UInt0 RtlDestroyHeap(_Input VoidPtr heap);
-#else
+// ------------------------------------------------------------------------
+// Error handling API.
+// ------------------------------------------------------------------------
+
+IMPORT_C SInt32 ErrGetLastError(UInt0);
+
+// ------------------------------------------------------------------------
+// Threading API.
+// ------------------------------------------------------------------------
+
+IMPORT_C UInt0 ThrExitCurrentThread(SInt32 exit_code);
+IMPORT_C UInt0 ThrExitMainThread(SInt32 exit_code);
-#include <SCI/SCIBase.h>
+IMPORT_C UInt0 ThrExitYieldThread(UInt0);
-#endif // ifdef __cplusplus
+IMPORT_C UInt0 ThrExitJoinThread(UInt0);
+IMPORT_C UInt0 ThrExitDetachThread(UInt0);
#endif // ifndef __SCI_BASE_HXX__