diff options
Diffstat (limited to 'dev/boot/modules/NetBoot')
| -rw-r--r-- | dev/boot/modules/NetBoot/.hgkeep | 0 | ||||
| -rw-r--r-- | dev/boot/modules/NetBoot/Boot.S | 22 | ||||
| -rw-r--r-- | dev/boot/modules/NetBoot/NetBoot.cc | 50 | ||||
| -rw-r--r-- | dev/boot/modules/NetBoot/NetBoot.h | 33 | ||||
| -rw-r--r-- | dev/boot/modules/NetBoot/amd64.json | 24 |
5 files changed, 0 insertions, 129 deletions
diff --git a/dev/boot/modules/NetBoot/.hgkeep b/dev/boot/modules/NetBoot/.hgkeep deleted file mode 100644 index e69de29b..00000000 --- a/dev/boot/modules/NetBoot/.hgkeep +++ /dev/null diff --git a/dev/boot/modules/NetBoot/Boot.S b/dev/boot/modules/NetBoot/Boot.S deleted file mode 100644 index 8ebfb352..00000000 --- a/dev/boot/modules/NetBoot/Boot.S +++ /dev/null @@ -1,22 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * BootZ -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -#ifdef __NE_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/modules/NetBoot/NetBoot.cc b/dev/boot/modules/NetBoot/NetBoot.cc deleted file mode 100644 index 4a169d33..00000000 --- a/dev/boot/modules/NetBoot/NetBoot.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* - * ======================================================== - * - * NetBoot - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#include <modules/NetBoot/NetBoot.h> -#include <BootKit/BootKit.h> -#include <BootKit/BootThread.h> - -EXTERN_C Int32 ModuleMain(NeOS::HEL::BootInfoHeader* handover) -{ - NETBOOT_INTERNET_HEADER inet{}; - - memset(&inet, 0, sizeof(NETBOOT_INTERNET_HEADER)); - - /// TODO: Read packet from JSON file 'netboot.json' - - if (inet.PatchLength < 1) - { - Boot::BootTextWriter writer; - writer.Write("NetBootLauncher: No executable attached to the packet, aborting.\r"); - - return kEfiFail; - } - - if (!inet.EEPROM) - { - Boot::BootThread thread(inet.PatchData); - - if (thread.IsValid()) - return thread.Start(handover, YES); - - return kEfiFail; - } - else - { - Boot::BootTextWriter writer; - writer.Write("NetBootLauncher: EEPROM flash is not available as of right now.\r"); - - /// TODO: Program new firmware to EEPROM (if crc and size matches) - - return kEfiFail; // TODO: Add support for EEPROM firmware update. - } - - return kEfiFail; -} diff --git a/dev/boot/modules/NetBoot/NetBoot.h b/dev/boot/modules/NetBoot/NetBoot.h deleted file mode 100644 index e250ef27..00000000 --- a/dev/boot/modules/NetBoot/NetBoot.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ======================================================== - * - * NetBoot - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#pragma once - -#include <NewKit/Defines.h> - -#define kNetBootINetMagic "NETB" -#define kNetBootINetMagicLength (4) - -#define kNetBootNameLen (256U) - -/// @brief the internet header is used to download updates OTA. -typedef struct NETBOOT_INTERNET_HEADER -{ - NeOS::Char NB1; /// magic char 1 'N' - NeOS::Char NB2; /// magic char 2 'E' - NeOS::Char NB3; /// magic char 3 'T' - NeOS::Char NB4; /// magic char 4 'B' - - NeOS::Char PatchName[kNetBootNameLen]; /// example: Modjo - NeOS::Int32 PatchLength; /// the patch length. - NeOS::Char PatchTarget[kNetBootNameLen]; /// the target file. - NeOS::Boolean EEPROM : 1; /// does it imply an EEPROM reprogram? - NeOS::Boolean Preflight : 1; /// is it a preflight packet. - NeOS::Char PatchData[]; /// non preflight packet has a patch blob for a **PatchTarget** -} ATTRIBUTE(packed) NETBOOT_INTERNET_HEADER; diff --git a/dev/boot/modules/NetBoot/amd64.json b/dev/boot/modules/NetBoot/amd64.json deleted file mode 100644 index db39cced..00000000 --- a/dev/boot/modules/NetBoot/amd64.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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": "netboot.sys", - "compiler_flags": [ - "-nostdlib", - "-std=c++20", - "-fPIC", - "-fno-rtti", - "-fno-exceptions", - "-Wl,--subsystem=17,--image-base,0x1000000,-e,ModuleMain" - ], - "cpp_macros": [ - "__NEOSKRNL__", - "__BOOTZ__", - "__BOOTZ_STANDALONE__", - "__NE_AMD64__", - "kNetBootVersionHighest=0x0100", - "kNetBootVersionLowest=0x0100", - "kNetBootVersion=0x0100" - ] -} |
