Page 1 of 1

Grub 2 Multiboot issue

Posted: Wed Aug 04, 2010 6:45 am
by sprints
Ok

Grub hates my kernel when i have more than 20 idt entries. It links and compiles fine but when i try to run it from the grub console with the multiboot command i get the "multiboot header not found" error.

Any ideas on what could be causing this or alternatives if grub just hates me?

Re: Grub 2 Multiboot issue

Posted: Wed Aug 04, 2010 7:18 am
by Candy
Maybe it's too obvious, but is the idt before the multiboot header in the file?

If so, modify the linker script so the multiboot header will be before the idt...

Re: Grub 2 Multiboot issue

Posted: Wed Aug 04, 2010 8:04 am
by xenos
The multiboot header must be within the first 8kb of the multiboot kernel, so the best is to place it in its own section at the beginning of your kernel image.

Re: Grub 2 Multiboot issue

Posted: Wed Aug 04, 2010 9:08 am
by sprints
thanks i objdumped my kernel.bin and the header seems to not be inside of the 8kb range.

also have any examples been posed on how to get ld to put the symbol for the header at the top of the .bin (i dont really know ld too well...)

Re: Grub 2 Multiboot issue

Posted: Wed Aug 04, 2010 10:07 am
by Jezze
http://wiki.osdev.org/Grub_Error_13

Use the section keyword in your assembler file and add the section to your .ld file as described above.

Re: Grub 2 Multiboot issue

Posted: Wed Aug 04, 2010 7:15 pm
by sprints
thanks made the fixes and it workd perfectly :D