diff options
Diffstat (limited to 'dev/Boot/Mod/SysChk')
| -rw-r--r-- | dev/Boot/Mod/SysChk/.hgkeep | 0 | ||||
| -rw-r--r-- | dev/Boot/Mod/SysChk/Boot.S | 22 | ||||
| -rw-r--r-- | dev/Boot/Mod/SysChk/Module.cc | 36 | ||||
| -rw-r--r-- | dev/Boot/Mod/SysChk/amd64.json | 25 | ||||
| -rw-r--r-- | dev/Boot/Mod/SysChk/arm64.json | 26 |
5 files changed, 109 insertions, 0 deletions
diff --git a/dev/Boot/Mod/SysChk/.hgkeep b/dev/Boot/Mod/SysChk/.hgkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dev/Boot/Mod/SysChk/.hgkeep diff --git a/dev/Boot/Mod/SysChk/Boot.S b/dev/Boot/Mod/SysChk/Boot.S new file mode 100644 index 00000000..b5795450 --- /dev/null +++ b/dev/Boot/Mod/SysChk/Boot.S @@ -0,0 +1,22 @@ +;; /* +;; * ======================================================== +;; * +;; * BootZ +;; * Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved., all rights reserved. +;; * +;; * ======================================================== +;; */ + +#ifdef __ZKA_AMD64__ +.code64 +.intel_syntax noprefix +#endif + +#define kTypeDriver 101 +#define kArchAmd64 122 +#define kHandoverMagic 0xBADCC + +.section .ldr + +.quad kHandoverMagic +.word kTypeDriver diff --git a/dev/Boot/Mod/SysChk/Module.cc b/dev/Boot/Mod/SysChk/Module.cc new file mode 100644 index 00000000..0297b177 --- /dev/null +++ b/dev/Boot/Mod/SysChk/Module.cc @@ -0,0 +1,36 @@ +/* + * ======================================================== + * + * NetBoot + * Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved., all rights reserved. + * + * ======================================================== + */ + +#include <BootKit/BootKit.h> +#include <Mod/CoreGfx/FBMgr.h> +#include <Mod/CoreGfx/TextMgr.h> +#include <FirmwareKit/EFI.h> +#include <FirmwareKit/EFI/API.h> +#include <FirmwareKit/Handover.h> +#include <KernelKit/MSDOS.h> +#include <KernelKit/PE.h> +#include <KernelKit/PEF.h> +#include <NewKit/Macros.h> +#include <NewKit/Ref.h> +#include <BootKit/BootThread.h> +#include <Mod/CoreGfx/FBMgr.h> + +EXTERN_C Int32 ModuleMain(Kernel::HEL::BootInfoHeader* handover) +{ +#ifdef __ZKA_AMD64__ + Boot::BDiskFormatFactory<BootDeviceATA> partition_factory; + + if (partition_factory.IsPartitionValid()) + return kEfiOk; + + return kEfiFail; +#else + return kEfiOk; +#endif +} diff --git a/dev/Boot/Mod/SysChk/amd64.json b/dev/Boot/Mod/SysChk/amd64.json new file mode 100644 index 00000000..2c079889 --- /dev/null +++ b/dev/Boot/Mod/SysChk/amd64.json @@ -0,0 +1,25 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "../../", "../../../Kernel", "../../../", "./"], + "sources_path": ["*.cc", "*.S", "../../src/HEL/AMD64/*.cc", "../../src/HEL/AMD64/*.S", "../../src/*.cc"], + "output_name": "syschk.sys", + "compiler_flags": [ + "-ffreestanding", + "-nostdlib", + "-std=c++20", + "-fPIC", + "-fno-rtti", + "-fno-exceptions", + "-Wl,--subsystem=17,--image-base,0x10000000,-e,ModuleMain" + ], + "cpp_macros": [ + "__MINOSKRNL__", + "__ZBAOSLDR__", + "__BOOTLDR_STANDALONE__", + "__ZKA_AMD64__", + "kChkVersionHighest=0x0100", + "kChkVersionLowest=0x0100", + "kChkVersion=0x0100" + ] +} diff --git a/dev/Boot/Mod/SysChk/arm64.json b/dev/Boot/Mod/SysChk/arm64.json new file mode 100644 index 00000000..46cfb081 --- /dev/null +++ b/dev/Boot/Mod/SysChk/arm64.json @@ -0,0 +1,26 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": ["../", "../../", "../../../Kernel", "../../../", "./"], + "sources_path": ["*.cc", "*.S", "../../src/HEL/ARM64/*.cc", "../../src/HEL/ARM64/*.S", "../../src/*.cc"], + "output_name": "syschk.sys", + "compiler_flags": [ + "-ffreestanding", + "-nostdlib", + "-std=c++20", + "-fno-rtti", + "-fno-exceptions", + "-fuse-ld=lld", + "-Wl,-subsystem:efi_application,-entry:ModuleMain", + "-target aarch64-unknown-windows" + ], + "cpp_macros": [ + "__MINOSKRNL__", + "__ZBAOSLDR__", + "__BOOTLDR_STANDALONE__", + "__ZKA_ARM64__", + "kChkVersionHighest=0x0100", + "kChkVersionLowest=0x0100", + "kChkVersion=0x0100" + ] +} |
