From a22ddb45201f40e41902b4c189c31c6418742c8a Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 10 Mar 2024 09:29:31 +0100 Subject: Very important changes. - Update user land dlls output name. - Define process team methods in ProcessTeam.cxx. - Add rt_std in HALKit\AMD64. - Breaking changes in System.Graphics.dll: Replace all header files extensions starting with .hpp to .hxx. - Makefile don't rely on winasm anymore. Signed-off-by: Amlal El Mahrouss --- Private/HALKit/AMD64/HalProcessor.cpp | 2 ++ Private/HALKit/AMD64/Processor.hpp | 1 + Private/KernelKit/ProcessManager.hpp | 4 ++-- Private/ObjectKit/Object.hxx | 20 ++++++++++++++++++ Private/Source/ProcessTeam.cxx | 7 +++++-- Private/makefile | 2 +- Public/Kits/GKit/Core.hxx | 6 +++--- Public/Kits/GKit/Dim2d.cxx | 2 +- Public/Kits/GKit/Dim2d.hpp | 37 ---------------------------------- Public/Kits/GKit/Dim2d.hxx | 38 +++++++++++++++++++++++++++++++++++ Public/Kits/GKit/Frame.cxx | 4 +++- Public/Kits/GKit/Frame.hxx | 2 +- Public/Kits/GKit/Makefile | 4 ++-- Public/Kits/GKit/Stylesheet.hxx | 2 +- Public/Kits/ZipKit/Makefile | 4 ++-- SPECIFICATION.TXT | 12 ++++++----- 16 files changed, 89 insertions(+), 58 deletions(-) create mode 100644 Private/ObjectKit/Object.hxx delete mode 100644 Public/Kits/GKit/Dim2d.hpp create mode 100644 Public/Kits/GKit/Dim2d.hxx diff --git a/Private/HALKit/AMD64/HalProcessor.cpp b/Private/HALKit/AMD64/HalProcessor.cpp index 0c246a9d..9596a82b 100644 --- a/Private/HALKit/AMD64/HalProcessor.cpp +++ b/Private/HALKit/AMD64/HalProcessor.cpp @@ -52,4 +52,6 @@ void rt_cli() { asm volatile("cli"); } void rt_sti() { asm volatile("sti"); } void rt_cld() { asm volatile("cld"); } + +void rt_std() { asm volatile("std"); } } // namespace HCore::HAL diff --git a/Private/HALKit/AMD64/Processor.hpp b/Private/HALKit/AMD64/Processor.hpp index e94d055f..02951540 100644 --- a/Private/HALKit/AMD64/Processor.hpp +++ b/Private/HALKit/AMD64/Processor.hpp @@ -60,6 +60,7 @@ EXTERN_C void rt_halt(); EXTERN_C void rt_cli(); EXTERN_C void rt_sti(); EXTERN_C void rt_cld(); +EXTERN_C void rt_std(); struct PACKED Register64 final { UShort Limit; diff --git a/Private/KernelKit/ProcessManager.hpp b/Private/KernelKit/ProcessManager.hpp index 0eb3f80e..c7c69093 100644 --- a/Private/KernelKit/ProcessManager.hpp +++ b/Private/KernelKit/ProcessManager.hpp @@ -193,8 +193,8 @@ public: HCORE_COPY_DEFAULT(ProcessTeam); - MutableArray>& AsArray() { return mProcessList; } - Ref& AsRef() { return mCurrentProcess; } + MutableArray>& AsArray(); + Ref& AsRef(); public: MutableArray> mProcessList; diff --git a/Private/ObjectKit/Object.hxx b/Private/ObjectKit/Object.hxx new file mode 100644 index 00000000..1cb9e084 --- /dev/null +++ b/Private/ObjectKit/Object.hxx @@ -0,0 +1,20 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include + +namespace HCore { +/// \brief Object Manager handle. +typedef struct Object { + Void(*Release)(Void); + Void(*Invoke)(Void); + Void(*QueryInterface)(Void); +} Ojbect, *ObjectPtr; +} // namespace HCore + +#define object_cast reinterpret_cast diff --git a/Private/Source/ProcessTeam.cxx b/Private/Source/ProcessTeam.cxx index d7979cf3..569d417d 100644 --- a/Private/Source/ProcessTeam.cxx +++ b/Private/Source/ProcessTeam.cxx @@ -9,8 +9,11 @@ /// @brief Process Team API. /***********************************************************************************/ -#include -#include #include +namespace HCore { +MutableArray>& ProcessTeam::AsArray() { return mProcessList; } +Ref& ProcessTeam::AsRef() { return mCurrentProcess; } +} // namespace HCore + // last rev 05-03-24 diff --git a/Private/makefile b/Private/makefile index 9b5d1595..5267bc9c 100644 --- a/Private/makefile +++ b/Private/makefile @@ -13,7 +13,7 @@ ifeq ($(UNAME), Darwin) ASM = nasm else # Otherwise Windows NT. -ASM = $(WINASM) +ASM = nasm.exe endif # Add assembler, linker, and object files variables. diff --git a/Public/Kits/GKit/Core.hxx b/Public/Kits/GKit/Core.hxx index 98a25f72..db9aa36f 100644 --- a/Public/Kits/GKit/Core.hxx +++ b/Public/Kits/GKit/Core.hxx @@ -22,10 +22,10 @@ #define $() HCore::GApplication::Shared()->Document() -#ifdef __EXPORT_LIB -#define G_API __attribute__((pef_container(".EXPORT"))) -#else +#ifdef __IMPORT_LIB #define G_API __attribute__((pef_container(".IMPORT"))) +#else +#define G_API __attribute__((pef_container(".EXPORT"))) #endif // ifdef __EXPORT_LIB namespace HCore { diff --git a/Public/Kits/GKit/Dim2d.cxx b/Public/Kits/GKit/Dim2d.cxx index 9d791ba2..a7df5cef 100644 --- a/Public/Kits/GKit/Dim2d.cxx +++ b/Public/Kits/GKit/Dim2d.cxx @@ -11,7 +11,7 @@ ------------------------------------------- */ -#include +#include namespace HCore { HCore::UInt& Dim2d::X() { return m_X; } diff --git a/Public/Kits/GKit/Dim2d.hpp b/Public/Kits/GKit/Dim2d.hpp deleted file mode 100644 index 23d1e100..00000000 --- a/Public/Kits/GKit/Dim2d.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - - File: Dim2d.hpp - Purpose: - - Revision History: - - 31/01/24: Added file (amlel) - -------------------------------------------- */ - -#ifndef __GORG__DIM2D_HPP__ -#define __GORG__DIM2D_HPP__ - -#include - -namespace HCore { -class Dim2d final { - public: - explicit Dim2d() = delete; - explicit Dim2d(const HCore::UInt& x, const HCore::UInt& y) : m_X(x), m_Y(y) {} - - Dim2d& operator=(const Dim2d&) = default; - Dim2d(const Dim2d&) = default; - - HCore::UInt& X(); - HCore::UInt& Y(); - - private: - HCore::UInt m_X{0}; - HCore::UInt m_Y{0}; -}; -} // namespace HCore - -#endif /* ifndef __GORG__DIM2D_HPP__ */ diff --git a/Public/Kits/GKit/Dim2d.hxx b/Public/Kits/GKit/Dim2d.hxx new file mode 100644 index 00000000..0e6c1519 --- /dev/null +++ b/Public/Kits/GKit/Dim2d.hxx @@ -0,0 +1,38 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: Dim2d.hpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + 3/10/24: Remname extension to .hxx + +------------------------------------------- */ + +#ifndef __DIM2D__ +#define __DIM2D__ + +#include + +namespace HCore { +class G_API Dim2d final { + public: + explicit Dim2d() = delete; + explicit Dim2d(const HCore::UInt& x, const HCore::UInt& y) : m_X(x), m_Y(y) {} + + Dim2d& operator=(const Dim2d&) = default; + Dim2d(const Dim2d&) = default; + + HCore::UInt& X(); + HCore::UInt& Y(); + + private: + HCore::UInt m_X{0}; + HCore::UInt m_Y{0}; +}; +} // namespace HCore + +#endif /* ifndef __DIM2D__ */ diff --git a/Public/Kits/GKit/Frame.cxx b/Public/Kits/GKit/Frame.cxx index c1f1df2c..ee2d3a3f 100644 --- a/Public/Kits/GKit/Frame.cxx +++ b/Public/Kits/GKit/Frame.cxx @@ -13,4 +13,6 @@ #include -namespace HCore {} +namespace HCore { + +} // namespace HCore diff --git a/Public/Kits/GKit/Frame.hxx b/Public/Kits/GKit/Frame.hxx index efa46fa3..1d87c41a 100644 --- a/Public/Kits/GKit/Frame.hxx +++ b/Public/Kits/GKit/Frame.hxx @@ -14,7 +14,7 @@ #pragma once #include -#include +#include #include namespace HCore { diff --git a/Public/Kits/GKit/Makefile b/Public/Kits/GKit/Makefile index 2873f91b..b8c8949d 100644 --- a/Public/Kits/GKit/Makefile +++ b/Public/Kits/GKit/Makefile @@ -5,7 +5,7 @@ CC=x86_64-w64-mingw32-g++ CCFLAGS=-shared -ffreestanding -fno-rtti -fno-exceptions -std=c++20 -OUTPUT=GKit.dll +OUTPUT=System.Graphics.dll .PHONY: build-gkit build-gkit: @@ -13,7 +13,7 @@ build-gkit: .PHONY: all all: build-gkit - @echo "[GKit] done." + @echo "[System.Graphics.dll] Build done." .PHONY: clean clean: diff --git a/Public/Kits/GKit/Stylesheet.hxx b/Public/Kits/GKit/Stylesheet.hxx index 55291f73..d9c88660 100644 --- a/Public/Kits/GKit/Stylesheet.hxx +++ b/Public/Kits/GKit/Stylesheet.hxx @@ -16,7 +16,7 @@ /// TODO: Stylesheets for GUI. #include -#include +#include #include namespace HCore { diff --git a/Public/Kits/ZipKit/Makefile b/Public/Kits/ZipKit/Makefile index e055d993..f27eb6ce 100644 --- a/Public/Kits/ZipKit/Makefile +++ b/Public/Kits/ZipKit/Makefile @@ -7,7 +7,7 @@ CC=x86_64-w64-mingw32-g++ CCFLAGS=-shared -ffreestanding -fno-rtti -fno-exceptions -std=c++20 ASM=nasm ASMFLAGS=-f elf64 -OUTPUT=ZipKit.dll +OUTPUT=System.Zip.dll .PHONY: build-zipkit build-zipkit: @@ -15,7 +15,7 @@ build-zipkit: .PHONY: all all: build-zipkit - @echo "Done." + @echo "[System.Zip.dll] Done." .PHONY: clean clean: diff --git a/SPECIFICATION.TXT b/SPECIFICATION.TXT index 2b62521b..c2e30c6c 100644 --- a/SPECIFICATION.TXT +++ b/SPECIFICATION.TXT @@ -17,10 +17,12 @@ - Hardware Abstraction Layer. - Native Filesystem support (NewFS). - Program Loader. -- TLS. +- Thread Local Storage. +- Semaphore, Locks, Timers. - Canary bird. - Dynamic Libraries. -- Cross platform code (it has to work for each platform) +- Cross Platform. +- Permission Selectors. =================================== 2: The Filesystem @@ -32,9 +34,9 @@ - UNIX path style. ================================== -3: The Executives -=================================== +3: Common naming conventions: +================================== - Kernel -> ke_init_x - RunTime -> rt_copy_mem -- Hal -> HalFooBar \ No newline at end of file +- Hal -> hal_foo_bar \ No newline at end of file -- cgit v1.2.3