Why is grub not properly parsing my multiboot2 header?
Posted: Tue Nov 01, 2016 9:55 pm
My multiboot header code looks like this:
I can look in the resulting elf file and see the header as follows:
When I try to load my kernel with grub, I get an error message stating that 0x10002 is not a valid information request type. So grub is interpreting the beginning of the address tag header as another information request type. But why? That tag has the proper size and the multiboot spec doesn't mention anything about sentinel values or anything like that.
Code: Select all
#multiboot section
.section .multiboot
.align 8
multiboot_start:
.long MAGIC
.long ARCH
.long HEADER_LENGTH
.long CHECKSUM
#information requests
info_tag_start:
.short INFO_REQUEST_TAG
.short NOT_OPTIONAL
.long info_tag_end - info_tag_start
.long BASIC_MEMINFO_TYPE
info_tag_end:
#address tag
address_tag_start:
.short ADDRESS_TAG
.short OPTIONAL
.long address_tag_end - address_tag_start
.long multiboot_start
.long _start #text start
.long _edata #data end
.long _end #bss end
address_tag_end:
#entry tag
entry_tag_start:
.short ENTRY_TAG
.short OPTIONAL
.long entry_tag_end - entry_tag_start
.long _start
entry_tag_end:
#end tag
.short END_TAG
.short NOT_OPTIONAL
.long 8
multiboot_end:
Code: Select all
0xe85250d6 //checksum
0x00000000 //i386 arch
0x00000048 //header size
0x17adaee2 //checksum
0x0001 //information request
0x0000 //non-optional
0x0000000c //size
0x00000004 //request basic memory info
0x0002 //address info
0x0001 //optional
0x00000018 //size
0x00100000 //multiboot header start
0x00100048 //code start
0x00101098 //end of .data
0x00101098 //end of .bss
0x0003 //entry tag
0x0001 //optional
0x0000000c //size
0x00100048 //entry point
0x0000 //end tag
0x0000
0x00000008