From 383fcb41331d8fb96efa8bead50b89232826033c Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sat, 17 Dec 2022 05:05:48 +0400 Subject: [PATCH] Improve Multiboot 2 printing (#147) --- ChangeLog | 4 + src/multiboot2/header_print.c | 216 ++++++++++++++++++++------- src/multiboot2/info_print.c | 34 ++--- tests/multiboot2_header_example1.h | 2 +- tests/test_multiboot2_header_print.c | 78 +++++----- tests/test_multiboot2_info_print.c | 84 +++++------ 6 files changed, 268 insertions(+), 150 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef58b7b..4958063 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2022-12-17 Alex Kotov + + * src/multiboot2/*_print.c: Print some values in hex + 2022-12-16 Alex Kotov * configure.ac: Feature "--with[out]-multiboot2" has been added diff --git a/src/multiboot2/header_print.c b/src/multiboot2/header_print.c index b514a2e..8950475 100644 --- a/src/multiboot2/header_print.c +++ b/src/multiboot2/header_print.c @@ -7,13 +7,15 @@ #include #include +#include #include #include +#define PRINT(s) do { KernAux_Display_print (display, s); } while (0) #define PRINTLN(s) do { KernAux_Display_println(display, s); } while (0) #define PRINTF(format, ...) \ - do { KernAux_Display_printf(display, format, __VA_ARGS__); } while (0) + do { KernAux_Display_printf (display, format, __VA_ARGS__); } while (0) #define PRINTLNF(format, ...) \ do { KernAux_Display_printlnf(display, format, __VA_ARGS__); } while (0) @@ -25,20 +27,74 @@ PRINTLN("Multiboot 2 header tag // invalid!"); \ } \ \ - KERNAUX_CAST_CONST(unsigned long, flags, tag->base.flags); \ KERNAUX_CAST_CONST(unsigned long, size, tag->base.size); \ \ - PRINTLN("Multiboot 2 header tag {"); \ + PRINTLN ("Multiboot 2 header tag {"); \ PRINTLNF(" u16 type: %u (%s)", \ tag->base.type, \ KernAux_Multiboot2_HTag_to_str(tag->base.type) \ ); \ - PRINTLNF(" u16 flags: %lu", flags); \ + PRINT (" u16 flags: "); \ + KernAux_Multiboot2_HTagBase_Flags_print( \ + tag->base.flags, \ + display, \ + 2, \ + 2, \ + false \ + ); \ PRINTLNF(" u32 size: %lu", size); \ } while (0) #define FOOTER do { PRINTLN("}"); } while (0) +#define INDENT do { \ + for (unsigned index = 0; index < basic_indentation; ++index) PRINT(" "); \ +} while (0) + +#define INDENT_MORE do { \ + for (unsigned index = 0; index < indentation_delta; ++index) PRINT(" "); \ +} while (0) + +static const struct { + uint32_t number; + const char *name; +} base_flag_names[] = { + { + .number = KERNAUX_MULTIBOOT2_HTAG_BASE_FLAG_OPTIONAL, + .name = "OPTIONAL", + }, +}; + +static const struct { + uint32_t number; + const char *name; +} console_flag_names[] = { + { + .number = KERNAUX_MULTIBOOT2_HTAG_FLAGS_REQUIRE_CONSOLE, + .name = "REQUIRE_CONSOLE", + }, + { + .number = KERNAUX_MULTIBOOT2_HTAG_FLAGS_EGA_SUPPORT, + .name = "EGA_SUPPORT", + } +}; + +static void KernAux_Multiboot2_HTagBase_Flags_print( + uint16_t flags, + KernAux_Display display, + unsigned basic_indentation, + unsigned indentation_delta, + bool indent_first +); + +static void KernAux_Multiboot2_HTag_Flags_ConsoleFlags_print( + uint32_t console_flags, + KernAux_Display display, + unsigned basic_indentation, + unsigned indentation_delta, + bool indent_first +); + void KernAux_Multiboot2_Header_print( const struct KernAux_Multiboot2_Header *const multiboot2_header, const KernAux_Display display @@ -51,13 +107,13 @@ void KernAux_Multiboot2_Header_print( KERNAUX_CAST_CONST(unsigned long, checksum, multiboot2_header->checksum); PRINTLN("Multiboot 2 header {"); - PRINTLNF(" u32 magic: %lu", magic); + PRINTLNF(" u32 magic: 0x%lx", magic); PRINTLNF(" u32 arch: %u (%s)", multiboot2_header->arch, KernAux_Multiboot2_Header_Arch_to_str(multiboot2_header->arch) ); PRINTLNF(" u32 size: %lu", total_size); - PRINTLNF(" u32 checksum: %lu", checksum); + PRINTLNF(" u32 checksum: 0x%lx", checksum); PRINTLN("}"); const struct KernAux_Multiboot2_HTagBase *tag_base = @@ -201,10 +257,10 @@ void KernAux_Multiboot2_HTag_Addr_print( KERNAUX_CAST_CONST(unsigned long, load_end_addr, tag->load_end_addr); KERNAUX_CAST_CONST(unsigned long, bss_end_addr, tag->bss_end_addr); - PRINTLNF(" u32 header_addr: %lu", header_addr); - PRINTLNF(" u32 load_addr: %lu", load_addr); - PRINTLNF(" u32 load_end_addr: %lu", load_end_addr); - PRINTLNF(" u32 bss_end_addr: %lu", bss_end_addr); + PRINTLNF(" u32 header_addr: 0x%lx", header_addr); + PRINTLNF(" u32 load_addr: 0x%lx", load_addr); + PRINTLNF(" u32 load_end_addr: 0x%lx", load_end_addr); + PRINTLNF(" u32 bss_end_addr: 0x%lx", bss_end_addr); FOOTER; } @@ -217,7 +273,7 @@ void KernAux_Multiboot2_HTag_EntryAddr_print( KERNAUX_CAST_CONST(unsigned long, entry_addr, tag->entry_addr); - PRINTLNF(" u32 entry_addr: %lu", entry_addr); + PRINTLNF(" u32 entry_addr: 0x%lx", entry_addr); FOOTER; } @@ -228,42 +284,14 @@ void KernAux_Multiboot2_HTag_Flags_print( ) { HEADER(Flags); - KERNAUX_CAST_CONST(unsigned long, console_flags, tag->console_flags); - - PRINTF(" u32 console_flags: %lu (", console_flags); - - static const struct { - uint32_t number; - const char *name; - } flags[] = { - { - .number = KERNAUX_MULTIBOOT2_HTAG_FLAGS_REQUIRE_CONSOLE, - .name = "REQUIRE_CONSOLE", - }, - { - .number = KERNAUX_MULTIBOOT2_HTAG_FLAGS_EGA_SUPPORT, - .name = "EGA_SUPPORT", - } - }; - - bool is_first = true; - for (size_t index = 0; index < sizeof(flags) / sizeof(flags[0]); ++index) { - if (tag->console_flags & flags[index].number) { - if (is_first) { - PRINTLN(""); - } else { - PRINTLN(" |"); - } - PRINTF(" %s", flags[index].name); - is_first = false; - } - } - if (is_first) { - PRINTLN(")"); - } else { - PRINTLN(""); - PRINTLN(" )"); - } + PRINT(" u32 console_flags: "); + KernAux_Multiboot2_HTag_Flags_ConsoleFlags_print( + tag->console_flags, + display, + 2, + 2, + false + ); FOOTER; } @@ -311,7 +339,7 @@ void KernAux_Multiboot2_HTag_EFII386EntryAddr_print( KERNAUX_CAST_CONST(unsigned long, entry_addr, tag->entry_addr); - PRINTLNF(" u32 entry_addr: %lu", entry_addr); + PRINTLNF(" u32 entry_addr: 0x%lx", entry_addr); FOOTER; } @@ -324,7 +352,7 @@ void KernAux_Multiboot2_HTag_EFIAmd64EntryAddr_print( KERNAUX_CAST_CONST(unsigned long, entry_addr, tag->entry_addr); - PRINTLNF(" u32 entry_addr: %lu", entry_addr); + PRINTLNF(" u32 entry_addr: 0x%lx", entry_addr); FOOTER; } @@ -339,9 +367,93 @@ void KernAux_Multiboot2_HTag_RelocatableHeader_print( KERNAUX_CAST_CONST(unsigned long, max_addr, tag->max_addr); KERNAUX_CAST_CONST(unsigned long, align, tag->align); - PRINTLNF(" u32 min_addr: %lu", min_addr); - PRINTLNF(" u32 max_addr: %lu", max_addr); - PRINTLNF(" u32 align: %lu", align); + PRINTLNF(" u32 min_addr: 0x%lx", min_addr); + PRINTLNF(" u32 max_addr: 0x%lx", max_addr); + PRINTLNF(" u32 align: %lu", align); FOOTER; } + +void KernAux_Multiboot2_HTagBase_Flags_print( + const uint16_t flags, + const KernAux_Display display, + const unsigned basic_indentation, + const unsigned indentation_delta, + const bool indent_first +) { + KERNAUX_CAST_CONST(unsigned long, flags_ul, flags); + + if (indent_first) INDENT; + PRINTF("0x%lx (", flags_ul); + + bool is_first = true; + + for ( + size_t index = 0; + index < sizeof(base_flag_names) / sizeof(base_flag_names[0]); + ++index + ) { + if (flags & base_flag_names[index].number) { + if (is_first) { + PRINTLN(""); + } else { + PRINTLN(" |"); + } + + INDENT; + INDENT_MORE; + PRINTF("%s", base_flag_names[index].name); + is_first = false; + } + } + + if (is_first) { + PRINTLN(")"); + } else { + PRINTLN(""); + INDENT; + PRINTLN(")"); + } +} + +void KernAux_Multiboot2_HTag_Flags_ConsoleFlags_print( + const uint32_t console_flags, + const KernAux_Display display, + const unsigned basic_indentation, + const unsigned indentation_delta, + const bool indent_first +) { + KERNAUX_CAST_CONST(unsigned long, console_flags_ul, console_flags); + + if (indent_first) INDENT; + PRINTF("0x%lx (", console_flags_ul); + + bool is_first = true; + + for ( + size_t index = 0; + index < sizeof(console_flag_names) / sizeof(console_flag_names[0]); + ++index + ) { + if (console_flags & console_flag_names[index].number) { + if (is_first) { + PRINTLN(""); + } else { + PRINTLN(" |"); + } + + INDENT; + INDENT_MORE; + PRINTF("%s", console_flag_names[index].name); + is_first = false; + } + } + + if (is_first) { + PRINTLN(")"); + } else { + PRINTLN(""); + INDENT; + PRINTLN(")"); + } +} diff --git a/src/multiboot2/info_print.c b/src/multiboot2/info_print.c index 0d000d4..011a42d 100644 --- a/src/multiboot2/info_print.c +++ b/src/multiboot2/info_print.c @@ -49,8 +49,8 @@ void KernAux_Multiboot2_Info_print( KERNAUX_CAST_CONST(unsigned long, reserved, multiboot2_info->reserved); PRINTLN("Multiboot 2 info {"); - PRINTLNF(" u32 size: %lu", total_size); - PRINTLNF(" u32 reserved: %lu", reserved); + PRINTLNF(" u32 size: %lu", total_size); + PRINTLNF(" u32 reserved: 0x%lx", reserved); PRINTLN("}"); const struct KernAux_Multiboot2_ITagBase *tag_base = @@ -252,8 +252,8 @@ void KernAux_Multiboot2_ITag_Module_print( KERNAUX_CAST_CONST(unsigned long, mod_start, tag->mod_start); KERNAUX_CAST_CONST(unsigned long, mod_end, tag->mod_end); - PRINTLNF(" u32 mod_start: %lu", mod_start); - PRINTLNF(" u32 mod_end: %lu", mod_end); + PRINTLNF(" u32 mod_start: 0x%lx", mod_start); + PRINTLNF(" u32 mod_end: 0x%lx", mod_end); // Print data: PRINTLNF(" char cmdline[]: \"%s\"", KERNAUX_MULTIBOOT2_DATA(tag)); @@ -324,10 +324,10 @@ void KernAux_Multiboot2_ITag_MemoryMap_print( KERNAUX_CAST_CONST(unsigned long, reserved, entries[index].reserved); PRINTLNF(" [%zu] entry: {", index); - PRINTLNF(" u64 base_addr: %llu", base_addr); - PRINTLNF(" u64 length: %llu", length); - PRINTLNF(" u32 type: %lu", type); - PRINTLNF(" u32 reserved: %lu", reserved); + PRINTLNF(" u64 base_addr: 0x%llx", base_addr); + PRINTLNF(" u64 length: %llu", length); + PRINTLNF(" u32 type: %lu", type); + PRINTLNF(" u32 reserved: 0x%lx", reserved); PRINTLN (" }"); } @@ -398,13 +398,13 @@ void KernAux_Multiboot2_ITag_FramebufferInfo_print( KERNAUX_CAST_CONST(unsigned long, type, tag->framebuffer_type); KERNAUX_CAST_CONST(unsigned long, reserved, tag->reserved); - PRINTLNF(" u64 framebuffer_addr: %llu", addr); - PRINTLNF(" u32 framebuffer_pitch: %lu", pitch); - PRINTLNF(" u32 framebuffer_width: %lu", width); - PRINTLNF(" u32 framebuffer_height: %lu", height); - PRINTLNF(" u8 framebuffer_bpp: %lu", bpp); - PRINTLNF(" u8 framebuffer_type: %lu", type); - PRINTLNF(" u16 reserved: %lu", reserved); + PRINTLNF(" u64 framebuffer_addr: 0x%llx", addr); + PRINTLNF(" u32 framebuffer_pitch: %lu", pitch); + PRINTLNF(" u32 framebuffer_width: %lu", width); + PRINTLNF(" u32 framebuffer_height: %lu", height); + PRINTLNF(" u8 framebuffer_bpp: %lu", bpp); + PRINTLNF(" u8 framebuffer_type: %lu", type); + PRINTLNF(" u16 reserved: 0x%lx", reserved); // TODO: Print data? @@ -502,7 +502,7 @@ void KernAux_Multiboot2_ITag_SMBIOSTables_print( PRINTLNF(" u8 major: %lu", major); PRINTLNF(" u8 minor: %lu", minor); - PRINTLNF(" u8 reserved[6]: [%lu, %lu, %lu, %lu, %lu, %lu]", + PRINTLNF(" u8 reserved[6]: [0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx]", reserved0, reserved1, reserved2, reserved3, reserved4, reserved5 ); @@ -605,7 +605,7 @@ void KernAux_Multiboot2_ITag_ImageLoadBasePhysAddr_print( KERNAUX_CAST_CONST(unsigned long, load_base_addr, tag->load_base_addr); - PRINTLNF(" u32 load_base_addr: %lu", load_base_addr); + PRINTLNF(" u32 load_base_addr: 0x%lx", load_base_addr); FOOTER; } diff --git a/tests/multiboot2_header_example1.h b/tests/multiboot2_header_example1.h index 8c1ad62..5d86a00 100644 --- a/tests/multiboot2_header_example1.h +++ b/tests/multiboot2_header_example1.h @@ -76,7 +76,7 @@ multiboot2_header_example1 = { .tag = { .base = { .type = KERNAUX_MULTIBOOT2_HTAG_INFO_REQ, - .flags = 0, + .flags = KERNAUX_MULTIBOOT2_HTAG_BASE_FLAG_OPTIONAL, .size = sizeof(multiboot2_header_example1.tag_info_req), }, }, diff --git a/tests/test_multiboot2_header_print.c b/tests/test_multiboot2_header_print.c index 4b173a1..e73fe25 100644 --- a/tests/test_multiboot2_header_print.c +++ b/tests/test_multiboot2_header_print.c @@ -11,58 +11,60 @@ static const char output0[] = "Multiboot 2 header {\n" - " u32 magic: 3897708758\n" + " u32 magic: 0xe85250d6\n" " u32 arch: 0 (i386)\n" " u32 size: 24\n" - " u32 checksum: 397258514\n" + " u32 checksum: 0x17adaf12\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 0 (none)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 8\n" "}\n"; static const char output1[] = "Multiboot 2 header {\n" - " u32 magic: 3897708758\n" + " u32 magic: 0xe85250d6\n" " u32 arch: 4 (MIPS32)\n" " u32 size: 104\n" - " u32 checksum: 397258430\n" + " u32 checksum: 0x17adaebe\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 4 (flags)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 12\n" - " u32 console_flags: 0 ()\n" + " u32 console_flags: 0x0 ()\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 4 (flags)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 12\n" - " u32 console_flags: 1 (\n" + " u32 console_flags: 0x1 (\n" " REQUIRE_CONSOLE\n" " )\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 4 (flags)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 12\n" - " u32 console_flags: 2 (\n" + " u32 console_flags: 0x2 (\n" " EGA_SUPPORT\n" " )\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 4 (flags)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 12\n" - " u32 console_flags: 3 (\n" + " u32 console_flags: 0x3 (\n" " REQUIRE_CONSOLE |\n" " EGA_SUPPORT\n" " )\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 1 (information request)\n" - " u16 flags: 0\n" + " u16 flags: 0x1 (\n" + " OPTIONAL\n" + " )\n" " u32 size: 12\n" " u32 mbi_tag_types[]: [\n" " 0 (none)\n" @@ -70,20 +72,20 @@ static const char output1[] = "}\n" "Multiboot 2 header tag {\n" " u16 type: 0 (none)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 8\n" "}\n"; static const char output2[] = "Multiboot 2 header {\n" - " u32 magic: 3897708758\n" + " u32 magic: 0xe85250d6\n" " u32 arch: 0 (i386)\n" " u32 size: 272\n" - " u32 checksum: 397258266\n" + " u32 checksum: 0x17adae1a\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 1 (information request)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 96\n" " u32 mbi_tag_types[]: [\n" " 0 (none)\n" @@ -112,28 +114,28 @@ static const char output2[] = "}\n" "Multiboot 2 header tag {\n" " u16 type: 2 (address)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 24\n" - " u32 header_addr: 3405691582\n" - " u32 load_addr: 3735928495\n" - " u32 load_end_addr: 3735927486\n" - " u32 bss_end_addr: 3405692591\n" + " u32 header_addr: 0xcafebabe\n" + " u32 load_addr: 0xdeadbeaf\n" + " u32 load_end_addr: 0xdeadbabe\n" + " u32 bss_end_addr: 0xcafebeaf\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 3 (entry address)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 12\n" - " u32 entry_addr: 3405691582\n" + " u32 entry_addr: 0xcafebabe\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 4 (flags)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 12\n" - " u32 console_flags: 0 ()\n" + " u32 console_flags: 0x0 ()\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 5 (framebuffer)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 20\n" " u32 width: 80\n" " u32 height: 25\n" @@ -141,37 +143,37 @@ static const char output2[] = "}\n" "Multiboot 2 header tag {\n" " u16 type: 6 (module alignment)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 8\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 7 (EFI boot services)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 8\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 8 (EFI i386 entry address)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 12\n" - " u32 entry_addr: 3405691582\n" + " u32 entry_addr: 0xcafebabe\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 9 (EFI amd64 entry address)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 12\n" - " u32 entry_addr: 3735928495\n" + " u32 entry_addr: 0xdeadbeaf\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 10 (relocatable header)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 24\n" - " u32 min_addr: 3405691582\n" - " u32 max_addr: 3735928495\n" + " u32 min_addr: 0xcafebabe\n" + " u32 max_addr: 0xdeadbeaf\n" " u32 align: 8\n" "}\n" "Multiboot 2 header tag {\n" " u16 type: 0 (none)\n" - " u16 flags: 0\n" + " u16 flags: 0x0 ()\n" " u32 size: 8\n" "}\n"; diff --git a/tests/test_multiboot2_info_print.c b/tests/test_multiboot2_info_print.c index 1ecc1fa..2f5d7cf 100644 --- a/tests/test_multiboot2_info_print.c +++ b/tests/test_multiboot2_info_print.c @@ -14,7 +14,7 @@ static const char output0[] = "Multiboot 2 info {\n" " u32 size: 16\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 0 (none)\n" @@ -24,12 +24,12 @@ static const char output0[] = static const char output1[] = "Multiboot 2 info {\n" " u32 size: 864\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 21 (image load base phys addr)\n" " u32 size: 12\n" - " u32 load_base_addr: 4194304\n" + " u32 load_base_addr: 0x400000\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 1 (boot cmd line)\n" @@ -57,15 +57,15 @@ static const char output1[] = "Multiboot 2 info tag {\n" " u32 type: 3 (module)\n" " u32 size: 29\n" - " u32 mod_start: 1056768\n" - " u32 mod_end: 1061532\n" + " u32 mod_start: 0x102000\n" + " u32 mod_end: 0x10329c\n" " char cmdline[]: \"hello module\"\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 3 (module)\n" " u32 size: 17\n" - " u32 mod_start: 1064960\n" - " u32 mod_end: 1069652\n" + " u32 mod_start: 0x104000\n" + " u32 mod_end: 0x105254\n" " char cmdline[]: \"\"\n" "}\n" "Multiboot 2 info tag {\n" @@ -75,40 +75,40 @@ static const char output1[] = " u32 entry_version: 0\n" " varies(entry_size) entries[]: [\n" " [0] entry: {\n" - " u64 base_addr: 0\n" + " u64 base_addr: 0x0\n" " u64 length: 654336\n" " u32 type: 1\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [1] entry: {\n" - " u64 base_addr: 654336\n" + " u64 base_addr: 0x9fc00\n" " u64 length: 1024\n" " u32 type: 2\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [2] entry: {\n" - " u64 base_addr: 983040\n" + " u64 base_addr: 0xf0000\n" " u64 length: 65536\n" " u32 type: 2\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [3] entry: {\n" - " u64 base_addr: 1048576\n" + " u64 base_addr: 0x100000\n" " u64 length: 133038080\n" " u32 type: 1\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [4] entry: {\n" - " u64 base_addr: 134086656\n" + " u64 base_addr: 0x7fe0000\n" " u64 length: 131072\n" " u32 type: 2\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [5] entry: {\n" - " u64 base_addr: 4294705152\n" + " u64 base_addr: 0xfffc0000\n" " u64 length: 262144\n" " u32 type: 2\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " ]\n" "}\n" @@ -135,13 +135,13 @@ static const char output1[] = "Multiboot 2 info tag {\n" " u32 type: 8 (framebuffer info)\n" " u32 size: 32\n" - " u64 framebuffer_addr: 753664\n" + " u64 framebuffer_addr: 0xb8000\n" " u32 framebuffer_pitch: 160\n" " u32 framebuffer_width: 80\n" " u32 framebuffer_height: 25\n" " u8 framebuffer_bpp: 16\n" " u8 framebuffer_type: 2\n" - " u16 reserved: 0\n" + " u16 reserved: 0x0\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 14 (ACPI old RSDP)\n" @@ -155,7 +155,7 @@ static const char output1[] = static const char output2_part1[] = "Multiboot 2 info {\n" " u32 size: 1816\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 1 (boot cmd line)\n" @@ -170,15 +170,15 @@ static const char output2_part1[] = "Multiboot 2 info tag {\n" " u32 type: 3 (module)\n" " u32 size: 33\n" - " u32 mod_start: 123\n" - " u32 mod_end: 456\n" + " u32 mod_start: 0x7b\n" + " u32 mod_end: 0x1c8\n" " char cmdline[]: \"Hello, Module 1!\"\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 3 (module)\n" " u32 size: 33\n" - " u32 mod_start: 123\n" - " u32 mod_end: 456\n" + " u32 mod_start: 0x7b\n" + " u32 mod_end: 0x1c8\n" " char cmdline[]: \"Hello, Module 2!\"\n" "}\n" "Multiboot 2 info tag {\n" @@ -201,40 +201,40 @@ static const char output2_part1[] = " u32 entry_version: 0\n" " varies(entry_size) entries[]: [\n" " [0] entry: {\n" - " u64 base_addr: 0\n" + " u64 base_addr: 0x0\n" " u64 length: 654336\n" " u32 type: 1\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [1] entry: {\n" - " u64 base_addr: 654336\n" + " u64 base_addr: 0x9fc00\n" " u64 length: 1024\n" " u32 type: 2\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [2] entry: {\n" - " u64 base_addr: 983040\n" + " u64 base_addr: 0xf0000\n" " u64 length: 65536\n" " u32 type: 2\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [3] entry: {\n" - " u64 base_addr: 1048576\n" + " u64 base_addr: 0x100000\n" " u64 length: 133038080\n" " u32 type: 1\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [4] entry: {\n" - " u64 base_addr: 134086656\n" + " u64 base_addr: 0x7fe0000\n" " u64 length: 131072\n" " u32 type: 2\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " [5] entry: {\n" - " u64 base_addr: 4294705152\n" + " u64 base_addr: 0xfffc0000\n" " u64 length: 262144\n" " u32 type: 2\n" - " u32 reserved: 0\n" + " u32 reserved: 0x0\n" " }\n" " ]\n" "}\n"; @@ -305,13 +305,13 @@ static const char output2_part3[] = "Multiboot 2 info tag {\n" " u32 type: 8 (framebuffer info)\n" " u32 size: 40\n" - " u64 framebuffer_addr: 123\n" + " u64 framebuffer_addr: 0x7b\n" " u32 framebuffer_pitch: 456\n" " u32 framebuffer_width: 123\n" " u32 framebuffer_height: 456\n" " u8 framebuffer_bpp: 8\n" " u8 framebuffer_type: 1\n" - " u16 reserved: 0\n" + " u16 reserved: 0x0\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 9 (ELF symbols)\n" @@ -348,7 +348,7 @@ static const char output2_part3[] = " u32 size: 24\n" " u8 major: 1\n" " u8 minor: 2\n" - " u8 reserved[6]: [0, 0, 0, 0, 0, 0]\n" + " u8 reserved[6]: [0x0, 0x0, 0x0, 0x0, 0x0, 0x0]\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 14 (ACPI old RSDP)\n" @@ -385,7 +385,7 @@ static const char output2_part3[] = "Multiboot 2 info tag {\n" " u32 type: 21 (image load base phys addr)\n" " u32 size: 12\n" - " u32 load_base_addr: 123\n" + " u32 load_base_addr: 0x7b\n" "}\n" "Multiboot 2 info tag {\n" " u32 type: 0 (none)\n"