aboutsummaryrefslogtreecommitdiffstats
path: root/multiboot.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2024-09-30 10:59:59 -0400
committerClyne Sullivan <clyne@bitgloo.com>2024-09-30 10:59:59 -0400
commit85c8fd05f1a0c0224882c4fafa60003d3ef56cf3 (patch)
treec86b968c5a53c0767c00116c6fc03f60c8e3aa64 /multiboot.cpp
parentabfdd6eb3ed61d13a47735812eca0028caf6b6da (diff)
compile with wall,extra,error,pedantic
Diffstat (limited to 'multiboot.cpp')
-rw-r--r--multiboot.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/multiboot.cpp b/multiboot.cpp
index 719bb5c..46c505b 100644
--- a/multiboot.cpp
+++ b/multiboot.cpp
@@ -13,6 +13,7 @@ struct multiboot2_tag
std::uint32_t data[1];
} __attribute__((packed));
+template<int N>
struct multiboot2
{
static constexpr std::uint32_t MAGIC = 0xE85250D6;
@@ -21,20 +22,16 @@ struct multiboot2
static constexpr std::uint32_t CHECKSUM = -(MAGIC + FLAGS + LENGTH);
alignas(8)
- std::uint32_t magic;
- std::uint32_t flags;
- std::uint32_t length;
- std::uint32_t checksum;
+ std::uint32_t magic = MAGIC;
+ std::uint32_t flags = FLAGS;
+ std::uint32_t length = LENGTH;
+ std::uint32_t checksum = CHECKSUM;
- multiboot2_tag tags[];
+ multiboot2_tag tags[N];
} __attribute__((packed));
__attribute__((section(".multiboot2")))
multiboot2 multibootHeader = {
- .magic = multiboot2::MAGIC,
- .flags = multiboot2::FLAGS,
- .length = multiboot2::LENGTH,
- .checksum = multiboot2::CHECKSUM,
.tags = {
{
1, 0, sizeof(multiboot2_tag) + sizeof(std::uint32_t),