From 3e30ee1749d19f5188560f9a5cdab922180c71ca Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Wed, 2 Oct 2024 16:51:45 +0200 Subject: IMP: Update setup program for ZKA OS SDK. Signed-off-by: Amlal EL Mahrouss --- dev/comm/xpcom_sms.idl | 3 ++ dev/pdm/pdf_pdm.hxx | 45 ----------------------- dev/pdm/pdm.json | 23 ------------ dev/pdm/src/pdm_pdf.cxx | 7 ---- dev/prm/pdf.hxx | 50 ++++++++++++++++++++++++++ dev/prm/prm.json | 23 ++++++++++++ dev/prm/src/pdf.cxx | 7 ++++ dev/sci/sci_base.hxx | 41 ++++++++++----------- dev/zka/Docs/Explicit Partition Map.pdf | Bin 12326 -> 0 bytes dev/zka/Docs/SPECIFICATION.md | 62 -------------------------------- dev/zka/Docs/TODO-LIST.md | 25 ------------- dev/zka/doc/Explicit Partition Map.pdf | Bin 0 -> 12326 bytes dev/zka/doc/SPECIFICATION.md | 62 ++++++++++++++++++++++++++++++++ dev/zka/doc/TODO-LIST.md | 25 +++++++++++++ 14 files changed, 191 insertions(+), 182 deletions(-) delete mode 100644 dev/pdm/pdf_pdm.hxx delete mode 100644 dev/pdm/pdm.json delete mode 100644 dev/pdm/src/pdm_pdf.cxx create mode 100644 dev/prm/pdf.hxx create mode 100644 dev/prm/prm.json create mode 100644 dev/prm/src/pdf.cxx delete mode 100644 dev/zka/Docs/Explicit Partition Map.pdf delete mode 100644 dev/zka/Docs/SPECIFICATION.md delete mode 100644 dev/zka/Docs/TODO-LIST.md create mode 100644 dev/zka/doc/Explicit Partition Map.pdf create mode 100644 dev/zka/doc/SPECIFICATION.md create mode 100644 dev/zka/doc/TODO-LIST.md (limited to 'dev') diff --git a/dev/comm/xpcom_sms.idl b/dev/comm/xpcom_sms.idl index 796b476a..2cfa53ba 100644 --- a/dev/comm/xpcom_sms.idl +++ b/dev/comm/xpcom_sms.idl @@ -2,6 +2,7 @@ Copyright ZKA Technologies. +File: xpcom_sms.idl Purpose: SMS XPCOM interface ------------------------------------------- */ @@ -11,10 +12,12 @@ Purpose: SMS XPCOM interface #define protocol class #define interface private #define interface_method + #define CONST const #define CHAR char #define INT32 __INT32_TYPE__ #define SIZE_T __SIZE_TYPE__ + #define _Output #define _Input #define clsid(X) diff --git a/dev/pdm/pdf_pdm.hxx b/dev/pdm/pdf_pdm.hxx deleted file mode 100644 index 044c7468..00000000 --- a/dev/pdm/pdf_pdm.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace Kernel::PDF -{ - class IPDFRenderViewport; - class IPDFDocument; - class IPDFTimestamp; - class IPDFTag; - - /// \brief PDF rendering class. - class IPDFRenderViewport - { - public: - explicit IPDFRenderViewport() = default; - virtual ~IPDFRenderViewport() = default; - - ZKA_COPY_DELETE(IPDFRenderViewport); - - virtual IPDFDocument* GetFirstPage() = 0; - virtual IPDFDocument* GetLastPage() = 0; - - virtual IPDFDocument* GetPage(const UInt32& page_number); - - virtual const Char* GetProducer() = 0; - virtual const Char* GetTitle() = 0; - virtual const Char* GetAuthor() = 0; - virtual const Char* GetSubject() = 0; - - virtual Bool IsFastView() = 0; - - virtual SizeT GetWidth() = 0; - virtual SizeT GetHeight() = 0; - - virtual SizeT GetPageCount() = 0; - }; -} // namespace CG::PDF diff --git a/dev/pdm/pdm.json b/dev/pdm/pdm.json deleted file mode 100644 index 790ab0f1..00000000 --- a/dev/pdm/pdm.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "../zka"], - "sources_path": ["src/*.cxx"], - "output_name": "pdm.sys", - "compiler_flags": [ - "-fPIC", - "-ffreestanding", - "-shared", - "-fno-rtti", - "-fno-exceptions", - "-Wl,--subsystem=17" - ], - "cpp_macros": [ - "__PDM_IMPL__", - "__NEWOSKRNL__", - "__ZKA_AMD64__", - "cPDMVersion=0x0100", - "cPDMVersionHighest=0x0100", - "cPDMVersionLowest=0x0100" - ] -} diff --git a/dev/pdm/src/pdm_pdf.cxx b/dev/pdm/src/pdm_pdf.cxx deleted file mode 100644 index 4932923e..00000000 --- a/dev/pdm/src/pdm_pdf.cxx +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#include diff --git a/dev/prm/pdf.hxx b/dev/prm/pdf.hxx new file mode 100644 index 00000000..24d5be01 --- /dev/null +++ b/dev/prm/pdf.hxx @@ -0,0 +1,50 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace Kernel::PDF +{ + class IPDFRenderViewport; + class IPDFDocument; + class IPDFTimestamp; + class IPDFTag; + + /// \brief PDF rendering class. + class IPDFRenderViewport + { + public: + explicit IPDFRenderViewport() = default; + virtual ~IPDFRenderViewport() = default; + + ZKA_COPY_DELETE(IPDFRenderViewport); + + virtual IPDFDocument* GetFirstPage() = 0; + virtual IPDFDocument* GetLastPage() = 0; + + virtual IPDFDocument* GetPage(const UInt32& page_number); + + virtual Void SetProducer(const Char*) = 0; + virtual Void SetTitle(const Char*) = 0; + virtual Void SetAuthor(const Char*) = 0; + virtual Void SetSubject(const Char*) = 0; + + virtual const Char* GetProducer() = 0; + virtual const Char* GetTitle() = 0; + virtual const Char* GetAuthor() = 0; + virtual const Char* GetSubject() = 0; + + virtual Bool IsFastView() = 0; + + virtual SizeT GetWidth() = 0; + virtual SizeT GetHeight() = 0; + + virtual SizeT GetPageCount() = 0; + }; +} // namespace CG::PDF diff --git a/dev/prm/prm.json b/dev/prm/prm.json new file mode 100644 index 00000000..25665c7c --- /dev/null +++ b/dev/prm/prm.json @@ -0,0 +1,23 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "../zka"], + "sources_path": ["src/*.cxx"], + "output_name": "prm.sys", + "compiler_flags": [ + "-fPIC", + "-ffreestanding", + "-shared", + "-fno-rtti", + "-fno-exceptions", + "-Wl,--subsystem=17" + ], + "cpp_macros": [ + "__PRM_IMPL__", + "__NEWOSKRNL__", + "__ZKA_AMD64__", + "cPRMVersion=0x0100", + "cPRMVersionHighest=0x0100", + "cPRMVersionLowest=0x0100" + ] +} diff --git a/dev/prm/src/pdf.cxx b/dev/prm/src/pdf.cxx new file mode 100644 index 00000000..3d9cfdf2 --- /dev/null +++ b/dev/prm/src/pdf.cxx @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#include diff --git a/dev/sci/sci_base.hxx b/dev/sci/sci_base.hxx index 92a959a7..7638ca1a 100644 --- a/dev/sci/sci_base.hxx +++ b/dev/sci/sci_base.hxx @@ -14,8 +14,9 @@ Purpose: sci/M core header file (C++) #define ATTRIBUTE(X) __attribute__((X)) -#define IMPORT_CXX extern "C++" -#define IMPORT_C extern "C" +#define IMPORT_XPCOM extern "XPCOM" +#define IMPORT_CXX extern "C++" +#define IMPORT_C extern "C" typedef bool Bool; typedef void UInt0; @@ -82,13 +83,13 @@ class IEventListener : public ClsID /// @note Handle types. // ------------------------------------------------------------------------------------------ // -typedef VoidPtr ZKAObject; +typedef VoidPtr Object; -typedef ZKAObject ZKADLLObject; -typedef ZKAObject ZKAIOObject; -typedef ZKAObject ZKASCMObject; -typedef ZKAObject ZKAThreadObject; -typedef ZKAObject ZKASocketObject; +typedef Object DLLObject; +typedef Object IOObject; +typedef Object SCMObject; +typedef Object ThreadObject; +typedef Object SocketObject; // ------------------------------------------------------------------------------------------ // @@ -100,18 +101,18 @@ typedef ZKAObject ZKASocketObject; /// @param symbol the symbol to look for /// @param dll_handle the DLL handle. /// @return the proc pointer. -IMPORT_C ZKAObject LdrGetDLLProc(_Input const Char* symbol, _Input ZKAObject dll_handle); +IMPORT_C Object LdrGetDLLProc(_Input const Char* symbol, _Input Object dll_handle); /// @brief Open DLL handle. /// @param path /// @param drv /// @return -IMPORT_C ZKAObject LdrOpenDLL(_Input const Char* path, _Input const Char* drive_letter); +IMPORT_C Object LdrOpenDLL(_Input const Char* path, _Input const Char* drive_letter); /// @brief Close DLL handle /// @param dll_handle /// @return -IMPORT_C UInt0 LdrCloseDLL(_Input ZKAObject dll_handle); +IMPORT_C UInt0 LdrCloseDLL(_Input Object dll_handle); // ------------------------------------------------------------------------------------------ // // File API. @@ -121,22 +122,22 @@ IMPORT_C UInt0 LdrCloseDLL(_Input ZKAObject dll_handle); /// @param fs_path the filesystem path. /// @param drive_letter drive name, use NULL to use default one. /// @return the file descriptor of the file. -IMPORT_C ZKAObject IoOpenFile(const Char* fs_path, const Char* drive_letter); +IMPORT_C Object IoOpenFile(const Char* fs_path, const Char* drive_letter); /// @brief Closes a file and flushes its content. /// @param file_desc the file descriptor. /// @return void. -IMPORT_C UInt0 IoCloseFile(_Input ZKAObject file_desc); +IMPORT_C UInt0 IoCloseFile(_Input Object file_desc); -IMPORT_C UInt32 IoWriteFile(_Input ZKAObject file_desc, _Output VoidPtr out_data, SizeT sz_data); +IMPORT_C UInt32 IoWriteFile(_Input Object file_desc, _Output VoidPtr out_data, SizeT sz_data); -IMPORT_C UInt32 IoReadFile(_Input ZKAObject file_desc, _Output VoidPtr* out_data, SizeT sz_data); +IMPORT_C UInt32 IoReadFile(_Input Object file_desc, _Output VoidPtr* out_data, SizeT sz_data); -IMPORT_C UInt64 IoRewindFile(_Input ZKAObject file_desc); +IMPORT_C UInt64 IoRewindFile(_Input Object file_desc); -IMPORT_C UInt64 IoTellFile(_Input ZKAObject file_desc); +IMPORT_C UInt64 IoTellFile(_Input Object file_desc); -IMPORT_C UInt64 IoSeekFile(_Input ZKAObject file_desc, UInt64 file_offset); +IMPORT_C UInt64 IoSeekFile(_Input Object file_desc, UInt64 file_offset); // ------------------------------------------------------------------------ // TLS API. @@ -171,11 +172,11 @@ SInt32 XPCOMReleaseClass(_Input TCLS* cls); /// @brief Creates an XPCOM instance in the process. /// @param handle_instance the XPCOM handle. /// @param flags the XPCOM flags. -IMPORT_C SInt32 XPCOMCreateInstance(_Input UInt32 flags, _Output ZKAObject* handle_instance); +IMPORT_C SInt32 XPCOMCreateInstance(_Input UInt32 flags, _Output Object* handle_instance); /// @brief Destroys an XPCOM instance of the process. /// @param handle_instance the XPCOM handle. -IMPORT_C UInt0 XPCOMDestroyInstance(_Input ZKAObject handle_instance); +IMPORT_C UInt0 XPCOMDestroyInstance(_Input Object handle_instance); #endif // !__SCI_IMPL__ diff --git a/dev/zka/Docs/Explicit Partition Map.pdf b/dev/zka/Docs/Explicit Partition Map.pdf deleted file mode 100644 index 1e2f5318..00000000 Binary files a/dev/zka/Docs/Explicit Partition Map.pdf and /dev/null differ diff --git a/dev/zka/Docs/SPECIFICATION.md b/dev/zka/Docs/SPECIFICATION.md deleted file mode 100644 index c38fa122..00000000 --- a/dev/zka/Docs/SPECIFICATION.md +++ /dev/null @@ -1,62 +0,0 @@ -=================================== - -# 0: General Information - -=================================== - -- ABI and Format: PEF/PE32+. -- Kernel architecture: Portable hybrid Kernel. -- Language: C++/(Assembly (AMD64, X64000, X86S, ARM64, POWER, RISCV)) - -=================================== - -# 1: The Kernel - -=================================== - -- Drive/Device Abstraction. -- SMP, Preemptive Multi Threading. -- Separation of Files/Devices. -- Networking. -- Hardware Abstraction Layer. -- Native Filesystem support (NeFS, FAT32 and ffs2). -- Program Loaders interfaces. -- TLS (Thread Local Storage) support. -- Semaphore, Locks, Timers. -- Canary mechanisms. -- Dynamic Sys. -- Cross Platform. -- Permission Selectors. - -=================================== - -# 2: The Filesystem - -=================================== - -- Catalog object with associated forks. -- Large storage support. -- Long file names. -- UNIX path style. - -================================== - -# 3: Common naming conventions: - -================================== - -- Kernel -> ke_init_x -- RunTime -> rt_copy_mem -- Hal -> hal_foo_bar - -=================================== - -# 4: The newosldr - -=================================== - -- Capable of booting from a network drive. -- Loads a PE file which is the Kernel. -- Sanity checks, based on the number of sections. -- Handover compliant. -- Does check for a valid partition (useful in the case of recovering) diff --git a/dev/zka/Docs/TODO-LIST.md b/dev/zka/Docs/TODO-LIST.md deleted file mode 100644 index 2b4ea96c..00000000 --- a/dev/zka/Docs/TODO-LIST.md +++ /dev/null @@ -1,25 +0,0 @@ -# TODO list - -- We need preemptive multi-threading. [ X ] -- We then need sync primitives. [ X ] -- We also need a system library for the OS. [ X ] -- We need a bootloader for AMD64 [ X ] - - Implement Boot Services [ X ] - - Design Handover [ X ] - - Load Kernel into memory [ X ] - - Fix bug in Kernel loader, which causes a 06 #UD. [ X ] - - Load Kernel [ X ] - - Add IDT [ X ] - - AHCI driver [ WiP ] -- Context switch x87/SSE/AVX registers [ X ] -- Framebuffer [ X ] -- ATA support [ X ] -- Make installer [ X ] - -Status: - -NEWOSLDR: Need to boot from EPM partition. [ X ] -
-newoskrnl: New Filesystem is done. [ X ] - -**Refer to Jira please!** diff --git a/dev/zka/doc/Explicit Partition Map.pdf b/dev/zka/doc/Explicit Partition Map.pdf new file mode 100644 index 00000000..1e2f5318 Binary files /dev/null and b/dev/zka/doc/Explicit Partition Map.pdf differ diff --git a/dev/zka/doc/SPECIFICATION.md b/dev/zka/doc/SPECIFICATION.md new file mode 100644 index 00000000..c38fa122 --- /dev/null +++ b/dev/zka/doc/SPECIFICATION.md @@ -0,0 +1,62 @@ +=================================== + +# 0: General Information + +=================================== + +- ABI and Format: PEF/PE32+. +- Kernel architecture: Portable hybrid Kernel. +- Language: C++/(Assembly (AMD64, X64000, X86S, ARM64, POWER, RISCV)) + +=================================== + +# 1: The Kernel + +=================================== + +- Drive/Device Abstraction. +- SMP, Preemptive Multi Threading. +- Separation of Files/Devices. +- Networking. +- Hardware Abstraction Layer. +- Native Filesystem support (NeFS, FAT32 and ffs2). +- Program Loaders interfaces. +- TLS (Thread Local Storage) support. +- Semaphore, Locks, Timers. +- Canary mechanisms. +- Dynamic Sys. +- Cross Platform. +- Permission Selectors. + +=================================== + +# 2: The Filesystem + +=================================== + +- Catalog object with associated forks. +- Large storage support. +- Long file names. +- UNIX path style. + +================================== + +# 3: Common naming conventions: + +================================== + +- Kernel -> ke_init_x +- RunTime -> rt_copy_mem +- Hal -> hal_foo_bar + +=================================== + +# 4: The newosldr + +=================================== + +- Capable of booting from a network drive. +- Loads a PE file which is the Kernel. +- Sanity checks, based on the number of sections. +- Handover compliant. +- Does check for a valid partition (useful in the case of recovering) diff --git a/dev/zka/doc/TODO-LIST.md b/dev/zka/doc/TODO-LIST.md new file mode 100644 index 00000000..2b4ea96c --- /dev/null +++ b/dev/zka/doc/TODO-LIST.md @@ -0,0 +1,25 @@ +# TODO list + +- We need preemptive multi-threading. [ X ] +- We then need sync primitives. [ X ] +- We also need a system library for the OS. [ X ] +- We need a bootloader for AMD64 [ X ] + - Implement Boot Services [ X ] + - Design Handover [ X ] + - Load Kernel into memory [ X ] + - Fix bug in Kernel loader, which causes a 06 #UD. [ X ] + - Load Kernel [ X ] + - Add IDT [ X ] + - AHCI driver [ WiP ] +- Context switch x87/SSE/AVX registers [ X ] +- Framebuffer [ X ] +- ATA support [ X ] +- Make installer [ X ] + +Status: + +NEWOSLDR: Need to boot from EPM partition. [ X ] +
+newoskrnl: New Filesystem is done. [ X ] + +**Refer to Jira please!** -- cgit v1.2.3