diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-23 15:26:33 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-23 15:26:33 +0200 |
| commit | 58ec3282634ccf75006043017ceacffed9a4533c (patch) | |
| tree | 81dc8f3823a4c77af34be62371523b5378e05aa9 /dev/ZBA/Modules | |
| parent | f5ed9f8a41b760a659e23f8c2a72d1ca73f3b826 (diff) | |
[IMP] BootScr module, manage boot driver (TODO need a UI toolkit for
it)
[IMP] Made NetBoot compilable as well.
[IMP] Fix Thread loader to be able to load other executables.
[REFACTOR] __NEWOS_ to __ZKA_ refactor.
[WIP] Fixing catalog which can't be fetched again after being written.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZBA/Modules')
| -rw-r--r-- | dev/ZBA/Modules/BootScr/Boot.S | 28 | ||||
| -rw-r--r-- | dev/ZBA/Modules/BootScr/Module.cxx | 6 | ||||
| -rw-r--r-- | dev/ZBA/Modules/BootScr/build.json | 25 | ||||
| -rw-r--r-- | dev/ZBA/Modules/BootScr/compile_flags.txt | 2 | ||||
| -rw-r--r-- | dev/ZBA/Modules/NetBoot/Boot.S | 28 | ||||
| -rw-r--r-- | dev/ZBA/Modules/NetBoot/Module.cxx | 13 | ||||
| -rw-r--r-- | dev/ZBA/Modules/NetBoot/build.json | 25 | ||||
| -rw-r--r-- | dev/ZBA/Modules/NetBoot/compile_flags.txt | 2 |
8 files changed, 111 insertions, 18 deletions
diff --git a/dev/ZBA/Modules/BootScr/Boot.S b/dev/ZBA/Modules/BootScr/Boot.S new file mode 100644 index 00000000..ce9f36b1 --- /dev/null +++ b/dev/ZBA/Modules/BootScr/Boot.S @@ -0,0 +1,28 @@ +;; /* +;; * ======================================================== +;; * +;; * ZKA +;; * Copyright ZKA Technologies., all rights reserved. +;; * +;; * ======================================================== +;; */ + +.code64 +.intel_syntax noprefix + +#define kTypeDriver 101 +#define kArchAmd64 122 +#define kHandoverMagic 0xBADCC + +.section .ldr + +.quad kHandoverMagic +.word kTypeDriver + +.text + +.extern main +.global __main + +__main: + ret diff --git a/dev/ZBA/Modules/BootScr/Module.cxx b/dev/ZBA/Modules/BootScr/Module.cxx index 11bbb6c0..15758599 100644 --- a/dev/ZBA/Modules/BootScr/Module.cxx +++ b/dev/ZBA/Modules/BootScr/Module.cxx @@ -9,11 +9,7 @@ #include <BootKit/BootKit.hxx> -EXTERN EfiSystemTable* ST; - -EXTERN_C Int32 ModuleMain(Void) +EXTERN_C Int32 main(Kernel::HEL::HandoverInformationHeader* Handover) { - ST->ConOut->ClearScreen(ST->ConOut); - return kEfiOk; } diff --git a/dev/ZBA/Modules/BootScr/build.json b/dev/ZBA/Modules/BootScr/build.json new file mode 100644 index 00000000..c53c6faa --- /dev/null +++ b/dev/ZBA/Modules/BootScr/build.json @@ -0,0 +1,25 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "../../", "../../../ZKA", "../../../", "./"], + "sources_path": ["*.cxx", "*.S"], + "output_name": "bootscr.sys", + "compiler_flags": [ + "-ffreestanding", + "-nostdlib", + "-std=c++20", + "-fPIC", + "-fno-rtti", + "-fno-exceptions", + "-Wl,--subsystem=17,--image-base 0x10000000" + ], + "cpp_macros": [ + "__NEWOSKRNL__", + "__NEWOSLDR__", + "__ZKA_AMD64__", + "__BOOTSCR__", + "cSCRVersionHighest=0x0100", + "cSCRVersionLowest=0x0100", + "cSCRVersion=0x0100" + ] +} diff --git a/dev/ZBA/Modules/BootScr/compile_flags.txt b/dev/ZBA/Modules/BootScr/compile_flags.txt index f9ca281f..18bc8512 100644 --- a/dev/ZBA/Modules/BootScr/compile_flags.txt +++ b/dev/ZBA/Modules/BootScr/compile_flags.txt @@ -2,7 +2,7 @@ -I../ -I../../ -I../../Kernel --D__NEWOS_AMD64__ +-D__ZKA_AMD64__ -std=c++20 -D__x86_64__ -D__NEWOS_OTA__ diff --git a/dev/ZBA/Modules/NetBoot/Boot.S b/dev/ZBA/Modules/NetBoot/Boot.S new file mode 100644 index 00000000..ce9f36b1 --- /dev/null +++ b/dev/ZBA/Modules/NetBoot/Boot.S @@ -0,0 +1,28 @@ +;; /* +;; * ======================================================== +;; * +;; * ZKA +;; * Copyright ZKA Technologies., all rights reserved. +;; * +;; * ======================================================== +;; */ + +.code64 +.intel_syntax noprefix + +#define kTypeDriver 101 +#define kArchAmd64 122 +#define kHandoverMagic 0xBADCC + +.section .ldr + +.quad kHandoverMagic +.word kTypeDriver + +.text + +.extern main +.global __main + +__main: + ret diff --git a/dev/ZBA/Modules/NetBoot/Module.cxx b/dev/ZBA/Modules/NetBoot/Module.cxx index 9bc65eda..ea30569b 100644 --- a/dev/ZBA/Modules/NetBoot/Module.cxx +++ b/dev/ZBA/Modules/NetBoot/Module.cxx @@ -7,19 +7,10 @@ * ======================================================== */ +#include <NetBoot.hxx> #include <BootKit/BootKit.hxx> -#include <NetBoot/NetBoot.hxx> -EXTERN EfiSystemTable* ST; - -EXTERN_C Int32 ModuleMain(Void) +EXTERN_C Int32 main(Kernel::HEL::HandoverInformationHeader* Handover) { - ST->ConOut->ClearScreen(ST->ConOut); - - /// @todo - /// - Find a network drive called "\.\newoskrnl.dll" with fork 'For-NewOSLdr' in the network path. (NewFS formatted disk as well!) - /// - Download our image - /// - Boot from it. - return kEfiOk; } diff --git a/dev/ZBA/Modules/NetBoot/build.json b/dev/ZBA/Modules/NetBoot/build.json new file mode 100644 index 00000000..78336241 --- /dev/null +++ b/dev/ZBA/Modules/NetBoot/build.json @@ -0,0 +1,25 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "../../", "../../../ZKA", "../../../", "./"], + "sources_path": ["*.cxx", "*.S"], + "output_name": "netboot.sys", + "compiler_flags": [ + "-ffreestanding", + "-nostdlib", + "-std=c++20", + "-fPIC", + "-fno-rtti", + "-fno-exceptions", + "-Wl,--subsystem=17,--image-base 0x10000000" + ], + "cpp_macros": [ + "__NEWOSKRNL__", + "__NEWOSLDR__", + "__ZKA_AMD64__", + "__BOOTSCR__", + "cSCRVersionHighest=0x0100", + "cSCRVersionLowest=0x0100", + "cSCRVersion=0x0100" + ] +} diff --git a/dev/ZBA/Modules/NetBoot/compile_flags.txt b/dev/ZBA/Modules/NetBoot/compile_flags.txt index f9ca281f..18bc8512 100644 --- a/dev/ZBA/Modules/NetBoot/compile_flags.txt +++ b/dev/ZBA/Modules/NetBoot/compile_flags.txt @@ -2,7 +2,7 @@ -I../ -I../../ -I../../Kernel --D__NEWOS_AMD64__ +-D__ZKA_AMD64__ -std=c++20 -D__x86_64__ -D__NEWOS_OTA__ |
