From b038c3eff8c80be2e6e10bea16634523fff4a6b5 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sun, 14 Jul 2024 00:37:06 +0200 Subject: [IMP] - IsUndefined returns const bool& now. - Replace kUndefined with kNull now. - Remove ML_ from macros in newstd.hxx. - Rename NSyscall to NSyscallInterface, which is a ref counted class now. - Rename MBCIType to PowerID - Update ToDos. - Update NewFS root catalog name. - Fix JSON 'null' initialization. - Add Json to variant object. - Replace kPointer with kBlob in variant kinds. - Add Leak() method to variant. Signed-off-by: Amlal --- Boot/Modules/NetBoot/.hgkeep | 0 Boot/Modules/NetBoot/Module.cxx | 20 ++++++++++++++++++++ Boot/Modules/NetBoot/NetBoot.hxx | 26 ++++++++++++++++++++++++++ Boot/Modules/NetBoot/compile_flags.txt | 8 ++++++++ Boot/Modules/NetBoot/manifest.json | 4 ++++ 5 files changed, 58 insertions(+) create mode 100644 Boot/Modules/NetBoot/.hgkeep create mode 100644 Boot/Modules/NetBoot/Module.cxx create mode 100644 Boot/Modules/NetBoot/NetBoot.hxx create mode 100644 Boot/Modules/NetBoot/compile_flags.txt create mode 100644 Boot/Modules/NetBoot/manifest.json (limited to 'Boot/Modules/NetBoot') diff --git a/Boot/Modules/NetBoot/.hgkeep b/Boot/Modules/NetBoot/.hgkeep new file mode 100644 index 00000000..e69de29b diff --git a/Boot/Modules/NetBoot/Module.cxx b/Boot/Modules/NetBoot/Module.cxx new file mode 100644 index 00000000..3bc71d0e --- /dev/null +++ b/Boot/Modules/NetBoot/Module.cxx @@ -0,0 +1,20 @@ +/* + * ======================================================== + * + * NetBoot + * Copyright ZKA Technologies, all rights reserved. + * + * ======================================================== + */ + +#include +#include + +EXTERN_C Int32 ModuleMain(Void) +{ + /// - Find a network drive called "/Remote/newoskrnl" + /// - Download our image + /// - Boot from it. + + return kEfiOk; +} diff --git a/Boot/Modules/NetBoot/NetBoot.hxx b/Boot/Modules/NetBoot/NetBoot.hxx new file mode 100644 index 00000000..1a474501 --- /dev/null +++ b/Boot/Modules/NetBoot/NetBoot.hxx @@ -0,0 +1,26 @@ +/* + * ======================================================== + * + * NetBoot + * Copyright ZKA Technologies, all rights reserved. + * + * ======================================================== + */ + +#pragma once + +#include + +/// @brief the internet header is used to download updates OTA. +typedef struct NetBootInternetHeader +{ + Kernel::Char NB1; /// magic char 1 'N' + Kernel::Char NB2; /// magic char 2 'E' + Kernel::Char NB3; /// magic char 3 'T' + Kernel::Char NB4; /// magic char 4 'B' + + Kernel::Char PatchName[255]; /// example: ColdChoco + Kernel::Int32 PatchLength; /// the patch length. + Kernel::Char PatchTarget[255]; /// the target file. + Kernel::Boolean ImpliesROM; /// does it imply an EEPROM reprogram? +} NetBootInternetHeader; diff --git a/Boot/Modules/NetBoot/compile_flags.txt b/Boot/Modules/NetBoot/compile_flags.txt new file mode 100644 index 00000000..f9ca281f --- /dev/null +++ b/Boot/Modules/NetBoot/compile_flags.txt @@ -0,0 +1,8 @@ +-std=c++20 +-I../ +-I../../ +-I../../Kernel +-D__NEWOS_AMD64__ +-std=c++20 +-D__x86_64__ +-D__NEWOS_OTA__ diff --git a/Boot/Modules/NetBoot/manifest.json b/Boot/Modules/NetBoot/manifest.json new file mode 100644 index 00000000..5f94c677 --- /dev/null +++ b/Boot/Modules/NetBoot/manifest.json @@ -0,0 +1,4 @@ +{ + "pluginName": "iBoot", + "description": "OTA updates." +} -- cgit v1.2.3 From 14769b940725a9e323d237179e812ccfdae08382 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Fri, 26 Jul 2024 09:18:51 +0200 Subject: [IMP] DDK compiles as a DLL now. [IMP] DDK versioning symbols. [UPD] manifest.json of NetBoot has been updated. [UPD] update OS-Design.drawio to replace launcher to UI and CF and CG at the same level, SCI is the lowest level of abstraction as it should be. Signed-off-by: Amlal EL Mahrouss --- Boot/Modules/NetBoot/manifest.json | 4 +- DDK/KernelAlloc.c | 2 +- DDK/KernelCall.c | 2 +- DDK/KernelCxxRt.cxx | 2 +- DDK/KernelDev.c | 2 +- DDK/KernelDev.h | 2 +- DDK/KernelPrint.c | 2 +- DDK/KernelPrint.h | 2 +- DDK/KernelStd.h | 15 ++++-- DDK/KernelString.c | 2 +- DDK/KernelString.h | 2 +- DDK/KernelVersion.c | 21 ++++++++ DDK/x86_64.make | 14 ++++++ Kernel/KernelRsrc.rsrc | 2 +- Kernel/amd64-efi.make | 2 +- Meta/OS-Design.drawio | 98 +++++++++++++++++++------------------- 16 files changed, 109 insertions(+), 65 deletions(-) create mode 100644 DDK/KernelVersion.c create mode 100644 DDK/x86_64.make (limited to 'Boot/Modules/NetBoot') diff --git a/Boot/Modules/NetBoot/manifest.json b/Boot/Modules/NetBoot/manifest.json index 5f94c677..708c451e 100644 --- a/Boot/Modules/NetBoot/manifest.json +++ b/Boot/Modules/NetBoot/manifest.json @@ -1,4 +1,4 @@ { - "pluginName": "iBoot", - "description": "OTA updates." + "pluginName": "NetBoot", + "description": "Over the Air update module." } diff --git a/DDK/KernelAlloc.c b/DDK/KernelAlloc.c index 17e49d6a..1eadd4e2 100644 --- a/DDK/KernelAlloc.c +++ b/DDK/KernelAlloc.c @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Standard library. + Purpose: DDK allocator. ------------------------------------------- */ diff --git a/DDK/KernelCall.c b/DDK/KernelCall.c index 18d544ef..ffc2ded6 100644 --- a/DDK/KernelCall.c +++ b/DDK/KernelCall.c @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Kernel Definitions. + Purpose: DDK kernel call. ------------------------------------------- */ diff --git a/DDK/KernelCxxRt.cxx b/DDK/KernelCxxRt.cxx index 8a5f4c66..08fab7b9 100644 --- a/DDK/KernelCxxRt.cxx +++ b/DDK/KernelCxxRt.cxx @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Driver C++ Definitions. + Purpose: DDK C++ runtime. ------------------------------------------- */ diff --git a/DDK/KernelDev.c b/DDK/KernelDev.c index a7c29b9e..07a64bdd 100644 --- a/DDK/KernelDev.c +++ b/DDK/KernelDev.c @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Kernel Text I/O. + Purpose: DDK Text I/O. ------------------------------------------- */ diff --git a/DDK/KernelDev.h b/DDK/KernelDev.h index c97c2acc..d7c13a13 100644 --- a/DDK/KernelDev.h +++ b/DDK/KernelDev.h @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Kernel Devices. + Purpose: DDK Devices. ------------------------------------------- */ diff --git a/DDK/KernelPrint.c b/DDK/KernelPrint.c index ad14fbf5..eee90e3c 100644 --- a/DDK/KernelPrint.c +++ b/DDK/KernelPrint.c @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Kernel Text I/O. + Purpose: DDK Text I/O. ------------------------------------------- */ diff --git a/DDK/KernelPrint.h b/DDK/KernelPrint.h index c7101107..25b702e1 100644 --- a/DDK/KernelPrint.h +++ b/DDK/KernelPrint.h @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Kernel Text I/O. + Purpose: DDK Text I/O. ------------------------------------------- */ diff --git a/DDK/KernelStd.h b/DDK/KernelStd.h index af7bb306..5d8af8cd 100644 --- a/DDK/KernelStd.h +++ b/DDK/KernelStd.h @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Kernel Definitions. + Purpose: DDK Definitions. ------------------------------------------- */ @@ -44,11 +44,20 @@ DK_EXTERN void* kernelCall(const char* kernelRpcName, int32_t cnt, void* dat, si /// @param slotFn, syscall slot. DK_EXTERN void kernelAddSyscall(const int slot, void (*slotFn)(void* a0)); -/// @brief allocate ptr. +/// @brief allocate heap ptr. /// @param sz size of ptr. /// @return the pointer allocated or **nil**. DK_EXTERN void* kernelAlloc(size_t sz); -/// @brief allocate ptr. +/// @brief free heap ptr. /// @param pointer to free DK_EXTERN void kernelFree(void*); + +/// @brief The highest API version of the DDK. +DK_EXTERN int32_t c_api_version_highest; + +/// @brief The lowest API version of the DDK. +DK_EXTERN int32_t c_api_version_least; + +/// @brief c_api_version_least+c_api_version_highest combined version. +DK_EXTERN int32_t c_api_version; \ No newline at end of file diff --git a/DDK/KernelString.c b/DDK/KernelString.c index 52e71e0f..2cb6adcc 100644 --- a/DDK/KernelString.c +++ b/DDK/KernelString.c @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Kernel Strings. + Purpose: DDK Strings. ------------------------------------------- */ diff --git a/DDK/KernelString.h b/DDK/KernelString.h index 0d244dc8..dd6fdce6 100644 --- a/DDK/KernelString.h +++ b/DDK/KernelString.h @@ -2,7 +2,7 @@ Copyright ZKA Technologies - Purpose: Kernel Strings. + Purpose: DDK Strings. ------------------------------------------- */ diff --git a/DDK/KernelVersion.c b/DDK/KernelVersion.c new file mode 100644 index 00000000..0f27d345 --- /dev/null +++ b/DDK/KernelVersion.c @@ -0,0 +1,21 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies + + Purpose: DDK versioning. + +------------------------------------------- */ + +#include + +#ifndef cDDKVersionHighest +#define cDDKVersionHighest 1 +#endif // cDDKVersionHighest + +#ifndef cDDKVersionLowest +#define cDDKVersionLowest 1 +#endif // cDDKVersionLowest + +int32_t c_api_version_highest = cDDKVersionHighest; +int32_t c_api_version_least = cDDKVersionLowest; +int32_t c_api_version = cDDKVersionHighest | cDDKVersionLowest; \ No newline at end of file diff --git a/DDK/x86_64.make b/DDK/x86_64.make new file mode 100644 index 00000000..61cafeee --- /dev/null +++ b/DDK/x86_64.make @@ -0,0 +1,14 @@ +################################################## +# (C) ZKA Technologies, all rights reserved. +# This is the DDK's makefile. +################################################## + +CC=x86_64-w64-mingw32-gcc +INC=-I./ -I../ +FLAGS=-ffreestanding -shared -std=c17 -std=c++20 -fno-rtti -fno-exceptions -D__DDK_AMD64__ -Wl,--subsystem=17 +VERSION=-DcDDKVersionLowest=1 -DcDDKVersionHighest=1 +OUTPUT=libDDK.dll + +.PHONY: all +all: + $(CC) $(INC) $(FLAGS) $(VERSION) $(wildcard *.c) $(wildcard *.S) $(wildcard *.cxx) -o $(OUTPUT) \ No newline at end of file diff --git a/Kernel/KernelRsrc.rsrc b/Kernel/KernelRsrc.rsrc index ae3ebe1e..97432f54 100644 --- a/Kernel/KernelRsrc.rsrc +++ b/Kernel/KernelRsrc.rsrc @@ -14,7 +14,7 @@ BEGIN VALUE "FileDescription", "NewOS Kernel." VALUE "FileVersion", KERNEL_VERSION VALUE "InternalName", "newoskrnl" - VALUE "LegalCopyright", "ZKA Technologies" + VALUE "LegalCopyright", "(c) ZKA Technologies, all rights reserved." VALUE "OriginalFilename", "newoskrnl.exe" VALUE "ProductName", "newoskrnl" VALUE "ProductVersion", KERNEL_VERSION diff --git a/Kernel/amd64-efi.make b/Kernel/amd64-efi.make index a6a60405..be59f2e9 100644 --- a/Kernel/amd64-efi.make +++ b/Kernel/amd64-efi.make @@ -1,6 +1,6 @@ ################################################## # (C) ZKA Technologies, all rights reserved. -# This is the microkernel makefile. +# This is the newoskrnl's makefile. ################################################## CC = x86_64-w64-mingw32-g++ diff --git a/Meta/OS-Design.drawio b/Meta/OS-Design.drawio index 61eef7f5..539e0bf9 100644 --- a/Meta/OS-Design.drawio +++ b/Meta/OS-Design.drawio @@ -1,49 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3