From a13e1c0911c0627184bc38f18c7fdda64447b3ad Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 23 Mar 2025 19:13:48 +0100 Subject: meta(kernel): Reworked repository's filesystem structure. Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss --- dev/boot/Mod/NetBoot/NetBoot.cc | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 dev/boot/Mod/NetBoot/NetBoot.cc (limited to 'dev/boot/Mod/NetBoot/NetBoot.cc') diff --git a/dev/boot/Mod/NetBoot/NetBoot.cc b/dev/boot/Mod/NetBoot/NetBoot.cc new file mode 100644 index 00000000..16a9ae1e --- /dev/null +++ b/dev/boot/Mod/NetBoot/NetBoot.cc @@ -0,0 +1,44 @@ +/* + * ======================================================== + * + * NetBoot + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#include +#include +#include + +EXTERN_C Int32 ModuleMain(NeOS::HEL::BootInfoHeader* handover) +{ + NETBOOT_INTERNET_HEADER inet{}; + + /// TODO: Read Packet from localhost + + if (inet.PatchLength < 0) + { + Boot::BootTextWriter writer; + writer.Write("NetBootLauncher: No Patch attached to packet.\r"); + + return kEfiFail; + } + + if (!inet.EEPROM) + { + Boot::BootThread thread(inet.Data); + + if (thread.IsValid()) + return thread.Start(handover, YES); + } + else + { + Boot::BootTextWriter writer; + writer.Write("NetBootLauncher: EEPROM flash not available for now.\r"); + + return kEfiFail; // TODO: Add support for EEPROM firmware update. + } + + return kEfiFail; +} -- cgit v1.2.3