From 0e8609977d9738a9992244e90ce0e6ef64562d75 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 14 Jan 2022 09:27:55 +0500 Subject: [PATCH] Add field multiboot2_header_example2.tag_flags --- include/kernaux/multiboot2.h | 5 ++++- tests/multiboot2_header_example2.h | 15 +++++++++++++++ tests/test_multiboot2_header_print.c | 8 ++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/include/kernaux/multiboot2.h b/include/kernaux/multiboot2.h index 8188b8c..f98bbb8 100644 --- a/include/kernaux/multiboot2.h +++ b/include/kernaux/multiboot2.h @@ -30,7 +30,10 @@ extern "C" { #define KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base) \ (((tag_base)->size + 7) & ~7) -#define KERNAUX_MULTIBOOT2_HTAG_FLAG_OPTIONAL 1 +#define KERNAUX_MULTIBOOT2_HTAG_BASE_FLAG_OPTIONAL 1 + +#define KERNAUX_MULTIBOOT2_HTAG_FLAGS_REQUIRE_CONSOLE (1 << 0) +#define KERNAUX_MULTIBOOT2_HTAG_FLAGS_EGA_SUPPORT (1 << 1) /**************** * Common types * diff --git a/tests/multiboot2_header_example2.h b/tests/multiboot2_header_example2.h index 75b8a3e..ded7ac0 100644 --- a/tests/multiboot2_header_example2.h +++ b/tests/multiboot2_header_example2.h @@ -12,6 +12,10 @@ static const struct { uint8_t _align1[4]; + struct KernAux_Multiboot2_HTag_Flags tag_flags; + + uint8_t _align2[4]; + struct KernAux_Multiboot2_HTag_None tag_none; } multiboot2_header_example2 = { .multiboot2_header = { @@ -75,6 +79,17 @@ static const struct { }, .entry_addr = 0, }, + .tag_flags = { + .base = { + .type = KERNAUX_MULTIBOOT2_HTAG_FLAGS, + .flags = 0, + .size = sizeof(multiboot2_header_example2.tag_flags), + }, + .console_flags = ( + KERNAUX_MULTIBOOT2_HTAG_FLAGS_REQUIRE_CONSOLE | + KERNAUX_MULTIBOOT2_HTAG_FLAGS_EGA_SUPPORT + ), + }, .tag_none = { .base = { .type = KERNAUX_MULTIBOOT2_HTAG_NONE, diff --git a/tests/test_multiboot2_header_print.c b/tests/test_multiboot2_header_print.c index 27560c6..02dd2a5 100644 --- a/tests/test_multiboot2_header_print.c +++ b/tests/test_multiboot2_header_print.c @@ -14,8 +14,8 @@ static const char output2[] = "Multiboot 2 header\n" " magic: 920085129\n" " arch: 1\n" - " size: 160\n" - " checksum: 3374882006\n" + " size: 176\n" + " checksum: 3374881990\n" "Multiboot 2 header tag\n" " type: 1 (information request)\n" " flags: 0\n" @@ -29,6 +29,10 @@ static const char output2[] = " flags: 0\n" " size: 12\n" "Multiboot 2 header tag\n" + " type: 4 (flags)\n" + " flags: 0\n" + " size: 12\n" + "Multiboot 2 header tag\n" " type: 0 (none)\n" " flags: 0\n" " size: 8\n";