:: commit 1407f48af133b703e5e8f33e32256b535df63b21

Philipp Schuster <philipp.schuster@cyberus-technology.de> — 2024-01-31 15:15

parents: f5c449ac00

multiboot2: better logging of unknown and unsupported tags

diff --git a/common/protos/multiboot2.c b/common/protos/multiboot2.c
index fb2e4490..14697b73 100644
--- a/common/protos/multiboot2.c
+++ b/common/protos/multiboot2.c
@@ -214,8 +214,17 @@ noreturn void multiboot2_load(char *config, char* cmdline) {
             }
 
             default:
-                if (is_required)
-                    panic(true, "multiboot2: Unknown header tag type: %u\n", tag->type);
+                if (is_required) {
+                    if (tag->type <= 10 /* max specified ID */) {
+                        panic(true, "multiboot2: Unsupported header tag type: %u\n", tag->type);
+                    } else {
+                        panic(true, "multiboot2: Unknown custom header tag type: %u\n", tag->type);
+                    }
+                } else {
+                    if (tag->type > 10) {
+                        print("multiboot2: Unknown custom header tag type: %u\n", tag->type);
+                    }
+                }
         }
     }
 
tab: 248 wrap: offon