summaryrefslogtreecommitdiffhomepage
path: root/dev/boot/modules/NetBoot
diff options
context:
space:
mode:
Diffstat (limited to 'dev/boot/modules/NetBoot')
-rw-r--r--dev/boot/modules/NetBoot/Boot.S10
-rw-r--r--dev/boot/modules/NetBoot/NetBoot.cc8
-rw-r--r--dev/boot/modules/NetBoot/amd64.json4
3 files changed, 10 insertions, 12 deletions
diff --git a/dev/boot/modules/NetBoot/Boot.S b/dev/boot/modules/NetBoot/Boot.S
index 2095b91d..8ebfb352 100644
--- a/dev/boot/modules/NetBoot/Boot.S
+++ b/dev/boot/modules/NetBoot/Boot.S
@@ -7,8 +7,10 @@
;; * ========================================================
;; */
+#ifdef __NE_AMD64__
.code64
.intel_syntax noprefix
+#endif
#define kTypeDriver 101
#define kArchAmd64 122
@@ -18,11 +20,3 @@
.quad kHandoverMagic
.word kTypeDriver
-
-.text
-
-.extern main
-.global __main
-
-__main:
- ret
diff --git a/dev/boot/modules/NetBoot/NetBoot.cc b/dev/boot/modules/NetBoot/NetBoot.cc
index 1787045e..4a169d33 100644
--- a/dev/boot/modules/NetBoot/NetBoot.cc
+++ b/dev/boot/modules/NetBoot/NetBoot.cc
@@ -15,12 +15,14 @@ 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 < 0)
+ if (inet.PatchLength < 1)
{
Boot::BootTextWriter writer;
- writer.Write("NetBootLauncher: No Patch attached to packet.\r");
+ writer.Write("NetBootLauncher: No executable attached to the packet, aborting.\r");
return kEfiFail;
}
@@ -31,6 +33,8 @@ EXTERN_C Int32 ModuleMain(NeOS::HEL::BootInfoHeader* handover)
if (thread.IsValid())
return thread.Start(handover, YES);
+
+ return kEfiFail;
}
else
{
diff --git a/dev/boot/modules/NetBoot/amd64.json b/dev/boot/modules/NetBoot/amd64.json
index db035094..db39cced 100644
--- a/dev/boot/modules/NetBoot/amd64.json
+++ b/dev/boot/modules/NetBoot/amd64.json
@@ -10,12 +10,12 @@
"-fPIC",
"-fno-rtti",
"-fno-exceptions",
- "-Wl,--subsystem=17,--image-base,0x10000000,-e,ModuleMain"
+ "-Wl,--subsystem=17,--image-base,0x1000000,-e,ModuleMain"
],
"cpp_macros": [
"__NEOSKRNL__",
"__BOOTZ__",
- "__BOOTLDR_STANDALONE__",
+ "__BOOTZ_STANDALONE__",
"__NE_AMD64__",
"kNetBootVersionHighest=0x0100",
"kNetBootVersionLowest=0x0100",