Grub 2 Multiboot issue

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
sprints
Posts: 10
Joined: Wed Jun 02, 2010 6:59 pm

Grub 2 Multiboot issue

Post 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?
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: Grub 2 Multiboot issue

Post 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...
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Grub 2 Multiboot issue

Post 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.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
sprints
Posts: 10
Joined: Wed Jun 02, 2010 6:59 pm

Re: Grub 2 Multiboot issue

Post 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...)
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

Re: Grub 2 Multiboot issue

Post 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.
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
sprints
Posts: 10
Joined: Wed Jun 02, 2010 6:59 pm

Re: Grub 2 Multiboot issue

Post by sprints »

thanks made the fixes and it workd perfectly :D
Post Reply