From 7efcf975fe61b2d20d2379f6151b6cdd99391dff Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Tue, 13 Aug 2024 13:00:12 +0200 Subject: [IMP] Add WIP Thread scheduler inside kernel DLL. [META] PE loader: Fix uneven macros inside PE.hxx. [FIX] Add more checks to Thread loader inside bootloader for PE32+ [IMP] Refactor KernelLoader to Thread inside loader EXE. Signed-off-by: Amlal EL Mahrouss --- SCIKit/ReadMe.md | 3 +++ SCIKit/SCIBase.hxx | 41 ++++++++++++++++++++++++----------------- SCIKit/scm.internal.inl | 6 +++--- 3 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 SCIKit/ReadMe.md (limited to 'SCIKit') diff --git a/SCIKit/ReadMe.md b/SCIKit/ReadMe.md new file mode 100644 index 00000000..b5f76a9f --- /dev/null +++ b/SCIKit/ReadMe.md @@ -0,0 +1,3 @@ +# Official SCM implementation for New OS + +Read the specs for + information... \ No newline at end of file diff --git a/SCIKit/SCIBase.hxx b/SCIKit/SCIBase.hxx index c685a081..8bc09afe 100644 --- a/SCIKit/SCIBase.hxx +++ b/SCIKit/SCIBase.hxx @@ -12,6 +12,8 @@ Purpose: SCIKit foundation header. #define IMPORT_CXX extern "C++" #define IMPORT_C extern "C" +#define OBJECT_PATH "\\::\\OBJDLL\\" + typedef bool Bool; typedef void UInt0; @@ -63,8 +65,8 @@ public: UnknownInterface(const UnknownInterface&) = default; virtual SInt32 Release() = 0; - virtual void DecrementRef() = 0; - virtual UnknownInterface* IncrementRef() = 0; + virtual void RemoveRef() = 0; + virtual UnknownInterface* AddRef() = 0; virtual VoidPtr QueryInterface(UUID* p_uuid) = 0; }; @@ -82,8 +84,27 @@ public: }; #endif +// ------------------------------------------------------------------------------------------ // +/// @note Handle types. +// ------------------------------------------------------------------------------------------ // + +typedef VoidPtr NEW_OBJECT; + +typedef NEW_OBJECT DLL_OBJECT; +typedef NEW_OBJECT IO_OBJECT; +typedef NEW_OBJECT COMP_OBJECT; + +// ------------------------------------------------------------------------------------------ // + +// ------------------------------------------------------------------------------------------ // /// @note Part of NK 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(const char* symbol, VoidPtr dll_handle); /// @brief Open DLL handle. @@ -113,21 +134,7 @@ IMPORT_C UInt0 RtlCloseFile(UInt64 file_desc); /// @brief Installs the TIB and GIB inside the current process. /// @param none /// @return > 0 error ocurred or already present, = 0 success. -IMPORT_C UInt32 RtlInstallTIB(UInt0); - -/// @brief Asks for the process's own framebuffer. (Not a GPU one) -/// @param flags -/// @param fb_ptr -/// @param fb_out_sz -/// @return -IMPORT_C UInt32 RtlRequestFB(SInt32* type, VoidPtr* fb_ptr, SizeT* fb_out_sz); - -enum -{ - eFBGPU, - eFBCPU, - eFBInvalid, -}; +IMPORT_C UInt32 RtlInstallInfoBlocks(UInt0); /// @brief Allocate new SCM object. /// @tparam TCLS the class type. diff --git a/SCIKit/scm.internal.inl b/SCIKit/scm.internal.inl index 96210889..8a5a85fa 100644 --- a/SCIKit/scm.internal.inl +++ b/SCIKit/scm.internal.inl @@ -34,8 +34,8 @@ public: UnknownInterface(const UnknownInterface&) = default; virtual SInt32 Release() = 0; - virtual void DecrementRef() = 0; - virtual UnknownInterface* IncrementRef() = 0; + virtual void RemoveRef() = 0; + virtual UnknownInterface* AddRef() = 0; virtual VoidPtr QueryInterface(UUID* p_uuid) = 0; }; @@ -78,7 +78,7 @@ public: virtual EventListenerInterface& operator +=(FnSign arg) { - this->AddEvent(arg); + this->AddEventListener(arg); return *this; } }; -- cgit v1.2.3