misc: Warn about missing limine.sys only when necessary
diff --git a/stage23/entry.s2.c b/stage23/entry.s2.c
index 60ee98b4..47003b8c 100644
--- a/stage23/entry.s2.c
+++ b/stage23/entry.s2.c
@@ -29,6 +29,7 @@ struct volume *boot_volume;
#if defined (bios)
bool stage3_loaded = false;
+static bool stage3_found = false;
extern symbol stage3_addr;
extern symbol limine_sys_size;
@@ -38,12 +39,11 @@ static bool stage3_init(struct volume *part) {
if (fopen(&stage3, part, "/limine.sys")
&& fopen(&stage3, part, "/boot/limine.sys")) {
- print("Stage 3 file not found!\n"
- "Have you copied limine.sys to the root or /boot directories of\n"
- "one of the partitions on the boot device?\n");
return false;
}
+ stage3_found = true;
+
if (stage3.size != (size_t)limine_sys_size) {
print("limine.sys size incorrect.\n");
return false;
@@ -98,6 +98,12 @@ void entry(uint8_t boot_drive, int boot_from) {
}
);
+ if (!stage3_found)
+ print("\n"
+ "!! Stage 3 file not found!\n"
+ "!! Have you copied limine.sys to the root or /boot directories of\n"
+ "!! one of the partitions on the boot device?\n\n");
+
if (!stage3_loaded)
panic("Failed to load stage 3.");
