@MichaelPetch provided this comment (Huge Appreciation)
Upon further inspection there is a similar casting issue (refering to previous comment) here as well:
tag += tag->size;You could do something liketag = (mb2_tag *) ((uint8_t *) tag + ((tag->size + 7) & ~7)))
After adjusting the code to this new traversal in multiboot2.c
// multiboot2.c
void mb2_traverse(mb2_info_header *mbd, uint32_t magic)
{
if (magic != 0x36D76289)
{
tty_printf("Multiboot2 Magic Number is invalid");
asm volatile ("hlt");
}
tty_printf("MB2 [%d]\n", mbd->total_size);
uint64_t mb2_end = mbd->total_size + (uint64_t)mbd;
mb2_tag *tag = (mb2_tag*)(mbd + sizeof(mb2_info_header));
while ((uint64_t)tag < mb2_end)
{
tty_printf("TAG %d\t[%d] @\t%x\n", tag->type, tag->size, tag);
if (tag->type == 0)
break;
switch (tag->type) {
// ...
default: break;
}
tag = (mb2_tag *) ((uint8_t *) tag + ((tag->size + 7) & ~7));
}
}