diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-25 16:43:00 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-25 16:43:00 +0100 |
| commit | be29b406526c931a606d4d4de545f71e62bc893a (patch) | |
| tree | 99a37a287dda888803653df9e13cb1336150cb85 /Public | |
| parent | f5e0bc85b06c84e0c6bc1da471630d02ff2ed7a3 (diff) | |
Kernel: A lot of preliminary changes before AHCI and SMP support.
Diffstat (limited to 'Public')
18 files changed, 86 insertions, 80 deletions
diff --git a/Public/Documentation/SPECIFICATION.TXT b/Public/Documentation/SPECIFICATION.TXT index 11ee62e3..ce6c9893 100644 --- a/Public/Documentation/SPECIFICATION.TXT +++ b/Public/Documentation/SPECIFICATION.TXT @@ -7,7 +7,7 @@ - Language: C++/(Assembly (AMD64, X64000, X86S, ARM64)) =================================== -1: The HCore Microkernel +1: The NewKernel =================================== - Drive/Device Abstraction. @@ -42,7 +42,7 @@ - Hal -> hal_foo_bar =================================== -4: The HCore Bootloader +4: The NewBoot =================================== - Capable of booting from a network drive. diff --git a/Public/SDK/System.Core/Headers/Containers/ODF.hxx b/Public/SDK/System.Core/Headers/Containers/ODF.hxx deleted file mode 100644 index e0cb0bc1..00000000 --- a/Public/SDK/System.Core/Headers/Containers/ODF.hxx +++ /dev/null @@ -1,43 +0,0 @@ -/** =========================================== - (C) Mahrouss Logic - ===========================================*/ - -#ifndef __ODF__ -#define __ODF__ - -#include <System.Core/Headers/Defines.hxx> - -/** - * @brief Open Document Format - * @file ODF.hxx -*/ - -/// @brief four-character code for ODF. -#define kFourCCLength_ODF 4 - -/// @brief Document file header. -typedef struct ODFFileHeader -{ - CharacterTypeUTF8 f_Ident[kFourCCLength_ODF]; - - Int32Type f_DocumentKind; - Int32Type f_DocumentSize; - - Int64Type f_MetaForkOffset; - Int64Type f_DocumentForkOffset; - - CharacterTypeUTF8 f_Padding[4]; -} PACKED ODFFileHeader; - -/// @brief ODF Fork header -typedef struct ODFForkHeader -{ - CharacterTypeUTF8 f_MetadataName[255]; - - Int32Type f_MetadataKind; - Int32Type f_MetadataSize; - - CharacterTypeUTF8 f_Padding; -} PACKED ODFForkHeader; - -#endif // !__ODF__
\ No newline at end of file diff --git a/Public/SDK/System.Core/Headers/Defines.hxx b/Public/SDK/System.Core/Headers/Defines.hxx index 3cbf22fd..867dac76 100644 --- a/Public/SDK/System.Core/Headers/Defines.hxx +++ b/Public/SDK/System.Core/Headers/Defines.hxx @@ -247,4 +247,4 @@ typedef struct Object final { CA_EXTERN_C ObjectPtr HcGetInstanceObject(void); -CA_INLINE ObjectPtr kInstanceObject; +CA_INLINE ObjectPtr kApplicationObject; diff --git a/Public/SDK/System.Core/Headers/File.hxx b/Public/SDK/System.Core/Headers/File.hxx index f8efd75a..60c37cc6 100644 --- a/Public/SDK/System.Core/Headers/File.hxx +++ b/Public/SDK/System.Core/Headers/File.hxx @@ -29,12 +29,12 @@ enum { class FileInterface final { public: explicit FileInterface(const char *path) { - mHandle = kInstanceObject->Invoke(kInstanceObject, kProcessCallOpenHandle, + mHandle = kApplicationObject->Invoke(kApplicationObject, kProcessCallOpenHandle, 0, path); } ~FileInterface() { - kInstanceObject->Invoke(kInstanceObject, kProcessCallCloseHandle, 0, + kApplicationObject->Invoke(kApplicationObject, kProcessCallCloseHandle, 0, mHandle); } @@ -43,25 +43,25 @@ class FileInterface final { public: PtrVoidType Read(UIntPtrType off, SizeType sz) { - return (PtrVoidType)kInstanceObject->Invoke(kInstanceObject, mHandle, 2, + return (PtrVoidType)kApplicationObject->Invoke(kApplicationObject, mHandle, 2, off, sz); } PtrVoidType Read(SizeType sz) { - return (PtrVoidType)kInstanceObject->Invoke(kInstanceObject, mHandle, 3, + return (PtrVoidType)kApplicationObject->Invoke(kApplicationObject, mHandle, 3, sz); } void Write(PtrVoidType buf, UIntPtrType off, SizeType sz) { - kInstanceObject->Invoke(kInstanceObject, mHandle, 4, buf, off, sz); + kApplicationObject->Invoke(kApplicationObject, mHandle, 4, buf, off, sz); } void Write(PtrVoidType buf, SizeType sz) { - kInstanceObject->Invoke(kInstanceObject, mHandle, 5, buf, sz); + kApplicationObject->Invoke(kApplicationObject, mHandle, 5, buf, sz); } void Seek(UIntPtrType off) { - kInstanceObject->Invoke(kInstanceObject, mHandle, 5); + kApplicationObject->Invoke(kApplicationObject, mHandle, 5); } - void Rewind() { kInstanceObject->Invoke(kInstanceObject, mHandle, 6); } + void Rewind() { kApplicationObject->Invoke(kApplicationObject, mHandle, 6); } public: const char *MIME(); @@ -95,7 +95,7 @@ inline IntPtrType MakeSymlink(const char *from, const char *outputWhere) { CA_MUST_PASS(from); CA_MUST_PASS(outputWhere); - return kInstanceObject->Invoke(kInstanceObject, kProcessCallOpenHandle, 1, + return kApplicationObject->Invoke(kApplicationObject, kProcessCallOpenHandle, 1, from); } } // namespace System diff --git a/Public/SDK/System.Core/Headers/FormatManager/ODF.hxx b/Public/SDK/System.Core/Headers/FormatManager/ODF.hxx new file mode 100644 index 00000000..266726bf --- /dev/null +++ b/Public/SDK/System.Core/Headers/FormatManager/ODF.hxx @@ -0,0 +1,41 @@ +/** =========================================== + (C) Mahrouss Logic + ===========================================*/ + +#ifndef __ODF__ +#define __ODF__ + +#include <System.Core/Headers/Defines.hxx> + +/** + * @brief Open Document Format + * @file ODF.hxx + */ + +/// @brief four-character code for ODF. +#define kFourCCLength_ODF 4 + +/// @brief Document file header. +typedef struct ODFFileHeader { + CharacterTypeUTF8 f_Ident[kFourCCLength_ODF]; + + Int32Type f_DocumentKind; + Int32Type f_DocumentSize; + + Int64Type f_MetaForkOffset; + Int64Type f_DocumentForkOffset; + + CharacterTypeUTF8 f_Padding[4]; +} PACKED ODFFileHeader; + +/// @brief ODF Fork header +typedef struct ODFForkHeader { + CharacterTypeUTF8 f_MetadataName[255]; + + Int32Type f_MetadataKind; + Int32Type f_MetadataSize; + + CharacterTypeUTF8 f_Padding; +} PACKED ODFForkHeader; + +#endif // !__ODF__
\ No newline at end of file diff --git a/Public/SDK/System.Core/Headers/Containers/XIFF.hxx b/Public/SDK/System.Core/Headers/FormatManager/XIFF.hxx index 2531abce..2531abce 100644 --- a/Public/SDK/System.Core/Headers/Containers/XIFF.hxx +++ b/Public/SDK/System.Core/Headers/FormatManager/XIFF.hxx diff --git a/Public/SDK/System.Core/Headers/Heap.hxx b/Public/SDK/System.Core/Headers/Heap.hxx index 0d7103c5..06f5d38e 100644 --- a/Public/SDK/System.Core/Headers/Heap.hxx +++ b/Public/SDK/System.Core/Headers/Heap.hxx @@ -61,4 +61,17 @@ class HeapException : public SystemException { const char *mReason{"System.Core: HeapException: Catastrophic failure!"}; }; -} // namespace System
\ No newline at end of file +} // namespace System + +#define kAllocationTypes 2 + +enum HcAllocationKind { + kStandardAllocation = 0xC, + kArrayAllocation = 0xD, +}; + +CA_EXTERN_C PtrVoidType HcAllocateProcessHeap(ObjectPtr refObj, QWordType sz, + DWordType flags); +CA_EXTERN_C BooleanType HcProcessHeapExists(ObjectPtr refObj, PtrVoidType ptr); +CA_EXTERN_C QWordType HcProcessHeapSize(ObjectPtr refObj, PtrVoidType ptr); +CA_EXTERN_C VoidType HcFreeProcessHeap(ObjectPtr refObj, PtrVoidType ptr);
\ No newline at end of file diff --git a/Public/SDK/System.Core/Headers/UI/.gitkeep b/Public/SDK/System.Core/Headers/UI/.gitkeep deleted file mode 100644 index e69de29b..00000000 --- a/Public/SDK/System.Core/Headers/UI/.gitkeep +++ /dev/null diff --git a/Public/SDK/System.Core/Headers/UI/Dialog.hxx b/Public/SDK/System.Core/Headers/UIManager/Dialog.hxx index 2a02b434..2a02b434 100644 --- a/Public/SDK/System.Core/Headers/UI/Dialog.hxx +++ b/Public/SDK/System.Core/Headers/UIManager/Dialog.hxx diff --git a/Public/SDK/System.Core/Headers/UI/Imaging.hxx b/Public/SDK/System.Core/Headers/UIManager/Image.hxx index 2a02b434..2a02b434 100644 --- a/Public/SDK/System.Core/Headers/UI/Imaging.hxx +++ b/Public/SDK/System.Core/Headers/UIManager/Image.hxx diff --git a/Public/SDK/System.Core/Headers/UI/Menu.hxx b/Public/SDK/System.Core/Headers/UIManager/Menu.hxx index 2a02b434..2a02b434 100644 --- a/Public/SDK/System.Core/Headers/UI/Menu.hxx +++ b/Public/SDK/System.Core/Headers/UIManager/Menu.hxx diff --git a/Public/SDK/System.Core/Headers/UI/Rsrc.hxx b/Public/SDK/System.Core/Headers/UIManager/Rsrc.hxx index 2a02b434..2a02b434 100644 --- a/Public/SDK/System.Core/Headers/UI/Rsrc.hxx +++ b/Public/SDK/System.Core/Headers/UIManager/Rsrc.hxx diff --git a/Public/SDK/System.Core/Headers/UIManager/TrueType.hxx b/Public/SDK/System.Core/Headers/UIManager/TrueType.hxx new file mode 100644 index 00000000..62ed1255 --- /dev/null +++ b/Public/SDK/System.Core/Headers/UIManager/TrueType.hxx @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once diff --git a/Public/SDK/System.Core/Headers/UI/Window.hxx b/Public/SDK/System.Core/Headers/UIManager/Window.hxx index 2a02b434..2a02b434 100644 --- a/Public/SDK/System.Core/Headers/UI/Window.hxx +++ b/Public/SDK/System.Core/Headers/UIManager/Window.hxx diff --git a/Public/SDK/System.Core/Sources/Heap.cxx b/Public/SDK/System.Core/Sources/Heap.cxx index 3803af3a..18106f41 100644 --- a/Public/SDK/System.Core/Sources/Heap.cxx +++ b/Public/SDK/System.Core/Sources/Heap.cxx @@ -60,24 +60,24 @@ HeapInterface* HeapInterface::Shared() noexcept { } HeapInterface::HeapInterface() { - CA_MUST_PASS(HcProcessHeapExists(kInstanceObject, (PtrVoidType)this)); + CA_MUST_PASS(HcProcessHeapExists(kApplicationObject, (PtrVoidType)this)); } HeapInterface::~HeapInterface() { delete this; } void HeapInterface::Delete(PtrHeapType me) noexcept { CA_MUST_PASS(me); - HcFreeProcessHeap(kInstanceObject, me); + HcFreeProcessHeap(kApplicationObject, me); } SizeType HeapInterface::Size(PtrHeapType me) noexcept { CA_MUST_PASS(me); - return HcProcessHeapSize(kInstanceObject, me); + return HcProcessHeapSize(kApplicationObject, me); } PtrHeapType HeapInterface::New(const SizeType& sz, const DWordType flags) { SizeType _sz = sz; if (!_sz) ++_sz; - return HcAllocateProcessHeap(kInstanceObject, _sz, flags); + return HcAllocateProcessHeap(kApplicationObject, _sz, flags); } diff --git a/Public/SDK/System.Core/Sources/DllMain.cxx b/Public/SDK/System.Core/Sources/LibEntrypoint.cxx index 9412cbbb..b874ef55 100644 --- a/Public/SDK/System.Core/Sources/DllMain.cxx +++ b/Public/SDK/System.Core/Sources/LibEntrypoint.cxx @@ -7,8 +7,8 @@ /// @brief Inits the DLL. /// @return if it was succesful or not. DWordType __DllMain(VoidType) { - kInstanceObject = HcGetInstanceObject(); - CA_MUST_PASS(kInstanceObject); + kApplicationObject = HcGetInstanceObject(); + CA_MUST_PASS(kApplicationObject); return 0; }
\ No newline at end of file diff --git a/Public/SDK/System.Core/Sources/New+Delete.cxx b/Public/SDK/System.Core/Sources/New+Delete.cxx index fe8ed43f..678aacce 100644 --- a/Public/SDK/System.Core/Sources/New+Delete.cxx +++ b/Public/SDK/System.Core/Sources/New+Delete.cxx @@ -5,44 +5,32 @@ ------------------------------------------- */ #include <System.Core/Headers/Heap.hxx> - -#define kAllocationTypes 2 - -enum HcAllocationKind { - kStandardAllocation = 0xC, - kArrayAllocation = 0xD, -}; - -CA_EXTERN_C PtrVoidType HcAllocateProcessHeap(ObjectPtr refObj, QWordType sz, - DWordType flags); -CA_EXTERN_C BooleanType HcProcessHeapExists(ObjectPtr refObj, PtrVoidType ptr); -CA_EXTERN_C QWordType HcProcessHeapSize(ObjectPtr refObj, PtrVoidType ptr); -CA_EXTERN_C VoidType HcFreeProcessHeap(ObjectPtr refObj, PtrVoidType ptr); +#include <System.Core/Headers/Heap.hxx> typedef SizeType size_t; void* operator new[](size_t sz) { if (sz == 0) ++sz; - return HcAllocateProcessHeap(kInstanceObject, sz, kStandardAllocation); + return HcAllocateProcessHeap(kApplicationObject, sz, kStandardAllocation); } void* operator new(size_t sz) { if (sz == 0) ++sz; - return HcAllocateProcessHeap(kInstanceObject, sz, kArrayAllocation); + return HcAllocateProcessHeap(kApplicationObject, sz, kArrayAllocation); } void operator delete[](void* ptr) { if (ptr == nullptr) return; - HcFreeProcessHeap(kInstanceObject, ptr); + HcFreeProcessHeap(kApplicationObject, ptr); } void operator delete(void* ptr) { if (ptr == nullptr) return; - HcFreeProcessHeap(kInstanceObject, ptr); + HcFreeProcessHeap(kApplicationObject, ptr); } void operator delete(void* ptr, size_t sz) { @@ -50,5 +38,5 @@ void operator delete(void* ptr, size_t sz) { (void)sz; - HcFreeProcessHeap(kInstanceObject, ptr); + HcFreeProcessHeap(kApplicationObject, ptr); } diff --git a/Public/Servers/.gitkeep b/Public/Servers/.gitkeep deleted file mode 100644 index e69de29b..00000000 --- a/Public/Servers/.gitkeep +++ /dev/null |
