Grub report that "NOT SUPPORT TAG 0x0a"

64 views Asked by At

I'm making a OS Grub report that "NOT SUPPORT TAG 0x0a",if its real.Then I will not be able to specify the address where the kernel is loaded. So how do I link? Or is the target address specified in the standard by grub? this is my header

.section .mbt2std
tag_start:
.long 0xE85250D6
.long 0
.long tag_end-tag_start
.long -1*(tag_end-tag_start + 0 +  0xE85250D6)

.vbe:
.short 5
.short 0
.long 20
.long 1024
.long 768
.long 32
.vbe_e:
.long 0
.rl:
.short 10
.short 0
.long 24
.long 0x100000
.long 0xffffffffffffffff
.long 4096
.long 0x100000
.rl_e:

.short 0
.short 0
.long 8
tag_end:


1

There are 1 answers

0
Michael Petch On BEST ANSWER

I'm not sure all GRUB compliant loaders support all the tags in all situations. Tag 0a (10) is for relocation which doesn't apply to your statically located code. Your linker script had set the VMA to 0x100000 so GRUB2 will load your kernel and data starting at 0x100000 (1 MiB mark) in memory automatically. I've never personally used this tag myself.

Other observations:

  • You can use .balign 8 to add the 8 byte alignment required between tags which can make maintaining alignment easier. An example of that can be found in this Stackoverflow answer.