diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-31 09:42:54 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-31 09:42:54 +0100 |
| commit | fc55f0d69d24fb4908cbd811681f2c3fac53614d (patch) | |
| tree | ba09a2cdbb225df7ba1a9ec5a12bcbb90b673ead /Public | |
| parent | 7bed9287589293bd9d712d152539591dee0b28c0 (diff) | |
kernel: add GKit, improve AMD64 HAL.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Public')
| -rw-r--r-- | Public/Kits/.gitkeep (renamed from Public/SDK/.gitkeep) | 0 | ||||
| -rw-r--r-- | Public/Kits/GKit/.gitkeep (renamed from Public/SDK/GPUKit/.gitkeep) | 0 | ||||
| -rw-r--r-- | Public/Kits/GKit/Core.cxx | 14 | ||||
| -rw-r--r-- | Public/Kits/GKit/Core.hpp | 112 | ||||
| -rw-r--r-- | Public/Kits/GKit/Dim2d.cxx | 20 | ||||
| -rw-r--r-- | Public/Kits/GKit/Dim2d.hpp | 37 | ||||
| -rw-r--r-- | Public/Kits/GKit/GFrame.cxx | 16 | ||||
| -rw-r--r-- | Public/Kits/GKit/GFrame.hpp | 59 | ||||
| -rw-r--r-- | Public/Kits/GKit/Makefile | 21 | ||||
| -rw-r--r-- | Public/Kits/GKit/compile_flags.txt | 4 | ||||
| -rw-r--r-- | Public/Kits/GPUKit/.gitkeep (renamed from Public/SDK/SystemKit/.gitkeep) | 0 | ||||
| -rw-r--r-- | Public/Kits/SystemKit/.gitkeep | 0 | ||||
| -rw-r--r-- | Public/Kits/SystemKit/CoreAPI.hxx (renamed from Public/SDK/SystemKit/CoreAPI.hxx) | 0 | ||||
| -rw-r--r-- | Public/Kits/SystemKit/FileAPI.hxx (renamed from Public/SDK/SystemKit/FileAPI.hxx) | 0 | ||||
| -rw-r--r-- | Public/Kits/SystemKit/HeapAPI.hxx (renamed from Public/SDK/SystemKit/HeapAPI.hxx) | 0 | ||||
| -rw-r--r-- | Public/Kits/SystemKit/SystemCall.hxx | 16 | ||||
| -rw-r--r-- | Public/Kits/SystemKit/SystemKit.hxx (renamed from Public/SDK/SystemKit/SystemKit.hxx) | 0 | ||||
| -rw-r--r-- | Public/Kits/SystemKit/ThreadAPI.hxx (renamed from Public/SDK/SystemKit/ThreadAPI.hxx) | 0 | ||||
| -rw-r--r-- | Public/Kits/ZipKit/Defines.hpp (renamed from Public/SDK/ZipKit/Defines.hpp) | 0 | ||||
| -rw-r--r-- | Public/Kits/ZipKit/Makefile (renamed from Public/SDK/ZipKit/Makefile) | 0 | ||||
| -rw-r--r-- | Public/Kits/ZipKit/NewFS-Addon.hpp (renamed from Public/SDK/ZipKit/NewFS-Addon.hpp) | 0 | ||||
| -rw-r--r-- | Public/Kits/ZipKit/Zip.cxx (renamed from Public/SDK/ZipKit/Zip.cxx) | 0 | ||||
| -rw-r--r-- | Public/Kits/ZipKit/Zip.hpp (renamed from Public/SDK/ZipKit/Zip.hpp) | 0 | ||||
| -rw-r--r-- | Public/Kits/ZipKit/zconf.hpp (renamed from Public/SDK/ZipKit/zconf.hpp) | 0 | ||||
| -rw-r--r-- | Public/Kits/ZipKit/zlib.hpp (renamed from Public/SDK/ZipKit/zlib.hpp) | 0 |
25 files changed, 299 insertions, 0 deletions
diff --git a/Public/SDK/.gitkeep b/Public/Kits/.gitkeep index e69de29b..e69de29b 100644 --- a/Public/SDK/.gitkeep +++ b/Public/Kits/.gitkeep diff --git a/Public/SDK/GPUKit/.gitkeep b/Public/Kits/GKit/.gitkeep index e69de29b..e69de29b 100644 --- a/Public/SDK/GPUKit/.gitkeep +++ b/Public/Kits/GKit/.gitkeep diff --git a/Public/Kits/GKit/Core.cxx b/Public/Kits/GKit/Core.cxx new file mode 100644 index 00000000..1e694734 --- /dev/null +++ b/Public/Kits/GKit/Core.cxx @@ -0,0 +1,14 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: Core.cpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#include <GKit/Core.hpp> diff --git a/Public/Kits/GKit/Core.hpp b/Public/Kits/GKit/Core.hpp new file mode 100644 index 00000000..5fcf6546 --- /dev/null +++ b/Public/Kits/GKit/Core.hpp @@ -0,0 +1,112 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: Core.hpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include <NewKit/Array.hpp> +#include <NewKit/Defines.hpp> +#include <NewKit/Ref.hpp> +#include <NewKit/String.hpp> + +namespace HCore { +template <typename... T> +class GAction; + +class GString; +class GNumber; +class GVector2; +class GBoolean; + +class GBoolean { + private: + explicit GBoolean() : m_Value(false) {} + + HCore::Boolean m_Value; + + friend class Form; + + public: + static const GBoolean Construct(HCore::StringView& sw, HCore::Boolean value) { + GBoolean boolean; + boolean.m_Value = value; + + return boolean; + } +}; + +template <typename... T> +class GAction { + explicit GAction(HCore::StringView& sw) { m_Name = sw; } + + HCore::StringView m_Name; + void (*m_Action)(T&&... args); + + friend class Form; + + public: + static const GAction Construct(HCore::StringView& sw, + void (*action)(T&&... args)) { + GAction actcls{sw}; + actcls.m_Action = action; + + return actcls; + } +}; + +class GVector2 { + explicit GVector2(HCore::StringView& sw) : m_Vec2() {} + + HCore::Array<HCore::Int, 3> m_Vec2; + + friend class Form; + + public: + static const GVector2 Construct(HCore::StringView& sw, + HCore::Array<HCore::Int, 3>& vec2) { + GVector2 vec{sw}; + vec.m_Vec2 = vec2; + + return vec; + } +}; + +class GNumber { + HCore::Int m_Number{0}; + friend class Form; + + public: + static const GNumber Construct(HCore::Int& number) { + GNumber num; + num.m_Number = number; + + return num; + } +}; + +class GString { + explicit GString(HCore::StringView& content) { + m_Content = new HCore::StringView(); + *m_Content = content; + } + + HCore::StringView* m_Content; + + friend class Form; + + public: + static const GString Construct(HCore::StringView& value) { + GString str{value}; + return str; + } +}; +} // namespace HCore diff --git a/Public/Kits/GKit/Dim2d.cxx b/Public/Kits/GKit/Dim2d.cxx new file mode 100644 index 00000000..9d791ba2 --- /dev/null +++ b/Public/Kits/GKit/Dim2d.cxx @@ -0,0 +1,20 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: Dim2d.cpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#include <GKit/Dim2d.hpp> + +namespace HCore { +HCore::UInt& Dim2d::X() { return m_X; } + +HCore::UInt& Dim2d::Y() { return m_Y; } +} // namespace HCore diff --git a/Public/Kits/GKit/Dim2d.hpp b/Public/Kits/GKit/Dim2d.hpp new file mode 100644 index 00000000..39d441d4 --- /dev/null +++ b/Public/Kits/GKit/Dim2d.hpp @@ -0,0 +1,37 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: Dim2d.hpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#ifndef __GORG__DIM2D_HPP__ +#define __GORG__DIM2D_HPP__ + +#include <GKit/Core.hpp> + +namespace HCore { +class Dim2d final { + public: + Dim2d() = delete; + 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/GFrame.cxx b/Public/Kits/GKit/GFrame.cxx new file mode 100644 index 00000000..427c95ba --- /dev/null +++ b/Public/Kits/GKit/GFrame.cxx @@ -0,0 +1,16 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: GFrame.cpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#include <GKit/GFrame.hpp> + +namespace HCore {} diff --git a/Public/Kits/GKit/GFrame.hpp b/Public/Kits/GKit/GFrame.hpp new file mode 100644 index 00000000..e1262e3f --- /dev/null +++ b/Public/Kits/GKit/GFrame.hpp @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: GFrame.hpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include <GKit/Core.hpp> +#include <GKit/Dim2d.hpp> +#include <NewKit/MutableArray.hpp> + +namespace HCore { +class GFrame { + public: + explicit GFrame(GFrame* parent = nullptr) : m_ParentFrame(parent) {} + ~GFrame() {} + + GFrame& operator=(const GFrame&) = default; + GFrame(const GFrame&) = default; + + virtual void Update() { + if (m_Frames.Count() == 0) return; + + for (int x = 0; x < m_Frames.Count(); ++x) { + if (!m_Frames[x]->ShouldBeUpdated()) continue; + + m_Frames[x]->Update(); + } + + this->Paint(); + } + + virtual void UpdateInput() { + if (m_Frames.Count() == 0) return; + + for (int x = 0; x < m_Frames.Count(); ++x) { + if (!m_Frames[x]->ShouldBeUpdated()) continue; + + m_Frames[x]->UpdateInput(); + } + } + + virtual bool ShouldBeUpdated() { return false; } + + virtual void Paint() = 0; + + private: + HCore::MutableArray<GFrame*> m_Frames; + GFrame* m_ParentFrame; +}; +} // namespace HCore diff --git a/Public/Kits/GKit/Makefile b/Public/Kits/GKit/Makefile new file mode 100644 index 00000000..95ab0ee2 --- /dev/null +++ b/Public/Kits/GKit/Makefile @@ -0,0 +1,21 @@ +################################################## +# ; (C) Mahrouss Logic, 2024, all rights reserved. +# This is the GKit Makefile. +################################################## + +CC=x86_64-w64-mingw32-g++ +CCFLAGS=-c -ffreestanding -fno-rtti -fno-exceptions -std=c++20 +ASM=nasm +ASMFLAGS=-f elf64 + +.PHONY: build-gkit +build-gkit: + $(CC) -I../ -I../../../Private/ $(CCFLAGS) *.cxx + +.PHONY: all +all: build-gkit + @echo "[GKit] done." + +.PHONY: clean +clean: + rm -f *.o diff --git a/Public/Kits/GKit/compile_flags.txt b/Public/Kits/GKit/compile_flags.txt new file mode 100644 index 00000000..6e721e73 --- /dev/null +++ b/Public/Kits/GKit/compile_flags.txt @@ -0,0 +1,4 @@ +-I./ +-I../ +-I../../../Private +-std=c++20 diff --git a/Public/SDK/SystemKit/.gitkeep b/Public/Kits/GPUKit/.gitkeep index e69de29b..e69de29b 100644 --- a/Public/SDK/SystemKit/.gitkeep +++ b/Public/Kits/GPUKit/.gitkeep diff --git a/Public/Kits/SystemKit/.gitkeep b/Public/Kits/SystemKit/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Public/Kits/SystemKit/.gitkeep diff --git a/Public/SDK/SystemKit/CoreAPI.hxx b/Public/Kits/SystemKit/CoreAPI.hxx index f3e67e96..f3e67e96 100644 --- a/Public/SDK/SystemKit/CoreAPI.hxx +++ b/Public/Kits/SystemKit/CoreAPI.hxx diff --git a/Public/SDK/SystemKit/FileAPI.hxx b/Public/Kits/SystemKit/FileAPI.hxx index c55d26ff..c55d26ff 100644 --- a/Public/SDK/SystemKit/FileAPI.hxx +++ b/Public/Kits/SystemKit/FileAPI.hxx diff --git a/Public/SDK/SystemKit/HeapAPI.hxx b/Public/Kits/SystemKit/HeapAPI.hxx index 11d4c265..11d4c265 100644 --- a/Public/SDK/SystemKit/HeapAPI.hxx +++ b/Public/Kits/SystemKit/HeapAPI.hxx diff --git a/Public/Kits/SystemKit/SystemCall.hxx b/Public/Kits/SystemKit/SystemCall.hxx new file mode 100644 index 00000000..77614099 --- /dev/null +++ b/Public/Kits/SystemKit/SystemCall.hxx @@ -0,0 +1,16 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: SystemCall.hxx + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +/// @brief System Call Interface diff --git a/Public/SDK/SystemKit/SystemKit.hxx b/Public/Kits/SystemKit/SystemKit.hxx index eca53757..eca53757 100644 --- a/Public/SDK/SystemKit/SystemKit.hxx +++ b/Public/Kits/SystemKit/SystemKit.hxx diff --git a/Public/SDK/SystemKit/ThreadAPI.hxx b/Public/Kits/SystemKit/ThreadAPI.hxx index a9490033..a9490033 100644 --- a/Public/SDK/SystemKit/ThreadAPI.hxx +++ b/Public/Kits/SystemKit/ThreadAPI.hxx diff --git a/Public/SDK/ZipKit/Defines.hpp b/Public/Kits/ZipKit/Defines.hpp index fc5e6068..fc5e6068 100644 --- a/Public/SDK/ZipKit/Defines.hpp +++ b/Public/Kits/ZipKit/Defines.hpp diff --git a/Public/SDK/ZipKit/Makefile b/Public/Kits/ZipKit/Makefile index 7665c614..7665c614 100644 --- a/Public/SDK/ZipKit/Makefile +++ b/Public/Kits/ZipKit/Makefile diff --git a/Public/SDK/ZipKit/NewFS-Addon.hpp b/Public/Kits/ZipKit/NewFS-Addon.hpp index 140c7c1f..140c7c1f 100644 --- a/Public/SDK/ZipKit/NewFS-Addon.hpp +++ b/Public/Kits/ZipKit/NewFS-Addon.hpp diff --git a/Public/SDK/ZipKit/Zip.cxx b/Public/Kits/ZipKit/Zip.cxx index 71523143..71523143 100644 --- a/Public/SDK/ZipKit/Zip.cxx +++ b/Public/Kits/ZipKit/Zip.cxx diff --git a/Public/SDK/ZipKit/Zip.hpp b/Public/Kits/ZipKit/Zip.hpp index f0337ffa..f0337ffa 100644 --- a/Public/SDK/ZipKit/Zip.hpp +++ b/Public/Kits/ZipKit/Zip.hpp diff --git a/Public/SDK/ZipKit/zconf.hpp b/Public/Kits/ZipKit/zconf.hpp index 14ab12d7..14ab12d7 100644 --- a/Public/SDK/ZipKit/zconf.hpp +++ b/Public/Kits/ZipKit/zconf.hpp diff --git a/Public/SDK/ZipKit/zlib.hpp b/Public/Kits/ZipKit/zlib.hpp index 540ab3e8..540ab3e8 100644 --- a/Public/SDK/ZipKit/zlib.hpp +++ b/Public/Kits/ZipKit/zlib.hpp |
