:: commit 03fdd5a6d2a349b175070e3aecfe2b3144536e23

mintsuki <mintsuki@protonmail.com> — 2021-11-25 22:06

parents: abea162c4b

multiboot1&2: Move kernel loading message to after detection code

diff --git a/stage23/protos/multiboot1.c b/stage23/protos/multiboot1.c
index ded9b085..42198b3b 100644
--- a/stage23/protos/multiboot1.c
+++ b/stage23/protos/multiboot1.c
@@ -28,8 +28,6 @@ bool multiboot1_load(char *config, char *cmdline) {
     if (kernel_path == NULL)
         panic("multiboot1: KERNEL_PATH not specified");
 
-    print("multiboot1: Loading kernel `%s`...\n", kernel_path);
-
     if ((kernel_file = uri_open(kernel_path)) == NULL)
         panic("multiboot1: Failed to open kernel with path `%s`. Is the path correct?", kernel_path);
 
@@ -57,6 +55,8 @@ bool multiboot1_load(char *config, char *cmdline) {
         return false;
     }
 
+    print("multiboot1: Loading kernel `%s`...\n", kernel_path);
+
     struct multiboot1_info *multiboot1_info = conv_mem_alloc(sizeof(struct multiboot1_info));
 
     if (header.magic + header.flags + header.checksum)
diff --git a/stage23/protos/multiboot2.c b/stage23/protos/multiboot2.c
index 8c60925b..c5162f1d 100644
--- a/stage23/protos/multiboot2.c
+++ b/stage23/protos/multiboot2.c
@@ -59,8 +59,6 @@ bool multiboot2_load(char *config, char* cmdline) {
     if (kernel_path == NULL)
         panic("multiboot2: KERNEL_PATH not specified");
 
-    print("multiboot2: Loading kernel `%s`...\n", kernel_path);
-
     if ((kernel_file = uri_open(kernel_path)) == NULL)
         panic("multiboot2: Failed to open kernel with path `%s`. Is the path correct?", kernel_path);
 
@@ -85,6 +83,8 @@ bool multiboot2_load(char *config, char* cmdline) {
         return false;
     }
 
+    print("multiboot2: Loading kernel `%s`...\n", kernel_path);
+
     if (header->magic + header->architecture + header->checksum + header->header_length) {
         panic("multiboot2: Header checksum is invalid");
     }
tab: 248 wrap: offon