multiboot2: Pass actual size of all tags rather than allocated size
diff --git a/stage23/protos/multiboot2.c b/stage23/protos/multiboot2.c
index d49d3aff..5792bb5c 100644
--- a/stage23/protos/multiboot2.c
+++ b/stage23/protos/multiboot2.c
@@ -281,12 +281,9 @@ bool multiboot2_load(char *config, char* cmdline) {
size_t info_idx = 0;
uint8_t *mb2_info = conv_mem_alloc(mb2_info_size);
- struct multiboot2_start_tag* mbi_start = (struct multiboot2_start_tag *)mb2_info;
+ struct multiboot2_start_tag *mbi_start = (struct multiboot2_start_tag *)mb2_info;
info_idx += sizeof(struct multiboot2_start_tag);
- mbi_start->size = mb2_info_size;
- mbi_start->reserved = 0x00;
-
//////////////////////////////////////////////
// Create modules tag
//////////////////////////////////////////////
@@ -664,6 +661,9 @@ bool multiboot2_load(char *config, char* cmdline) {
append_tag(info_idx, end_tag);
}
+ mbi_start->size = info_idx;
+ mbi_start->reserved = 0x00;
+
irq_flush_type = IRQ_PIC_ONLY_FLUSH;
common_spinup(multiboot2_spinup_32, 2,
