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);
+ }
+ }
}
}
