Page 1 of 1

GRUB Error 13 with CPP kernel

Posted: Mon Feb 22, 2010 4:49 pm
by KotuxGuy
Hey, KotuxGuy here (again!).

Well, the problem is this:
My C++ kernel(w/o the GDT and IDT) is about 15KB.
When I add the GDT/IDT part back in(which brings the kernel size to 19.6KB), mbchk declares "No Multiboot header."
Obviously,I have looked at the Grub Error 13 wiki page(and the forum link at the top). Plus, I searched Google,the wiki, and osdever.net.
Anyone know what's going on?

Non-working and working source distro is included.

EDIT: Files are now validated(i.e, they will compile, and the case of the second one, run), you guys can help now!

KotuxGuy

Re: GRUB Error 13 with CPP kernel

Posted: Tue Feb 23, 2010 2:30 am
by pcmattman
Make sure the multiboot header is within the first 8 KB of your binary.

You usually do that by creating a new section in your linker script for the multiboot header, ensuring it's placed first, and making sure the declaration in your start.asm file or whatever has a section .mbheader above it.

EDIT: Which is exactly what the wiki page says. Perhaps post your linker script and entry point assembly code?

Re: GRUB Error 13 with CPP kernel

Posted: Tue Feb 23, 2010 5:20 am
by computafreak
From what I can tell, you create a section for your multiboot header by using a linker script, but place the header in .text. Change the 'section .text' line to the name of the multiboot header's section.

Re: GRUB Error 13 with CPP kernel

Posted: Tue Feb 23, 2010 11:58 am
by KotuxGuy
Yeah, you're right.How embarrassing.. :oops:

Re: GRUB Error 13 with CPP kernel

Posted: Tue Feb 23, 2010 1:14 pm
by gravaera
Hi,

I would usually leave it alone, but you even claimed to have read the article. How could you possibly have missed what it said? It literally says exactly what everyone else here said.

No. You didn't read it. You couldn't possibly be that intellectually stunted. Read the article next time please. When you're a super-elite ultra guru, and you know everything, then you will have the privilege of being able to skim. Until then, read.

Re: GRUB Error 13 with CPP kernel

Posted: Tue Feb 23, 2010 2:59 pm
by KotuxGuy
I did read it. I just implemented it wrong.

Re: GRUB Error 13 with CPP kernel

Posted: Tue Feb 23, 2010 5:07 pm
by pcmattman
Honestly, if you understood your assembler enough, you wouldn't have had this problem.

The GRUB Error 13 article is just so explicit when it talks about the solution, so you're either incompetent, or just plain stupid to have "implemented it wrong".

Re: GRUB Error 13 with CPP kernel

Posted: Tue Feb 23, 2010 5:16 pm
by KotuxGuy
You're absolutely right. I'll put more effort into being competent with ASM.
To tell the truth,I'm not that good with ASM at all... :oops:

Re: GRUB Error 13 with CPP kernel

Posted: Wed Feb 24, 2010 2:50 am
by Solar
OK, that's settled. Now give the man a break, please.

Re: GRUB Error 13 with CPP kernel

Posted: Wed Feb 24, 2010 2:52 am
by AJ
Solar wrote:OK, that's settled. Now give the man a break, please.
My thoughts exactly. Locked.