GRUB Error 13 with CPP kernel

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.
Locked
User avatar
KotuxGuy
Member
Member
Posts: 96
Joined: Wed Nov 25, 2009 1:28 pm
Location: Somewhere within 10ft of my favorite chubby penguin!

GRUB Error 13 with CPP kernel

Post 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
Attachments
caldera-0.0.3-src.tar.gz
Non-working source
(60 KiB) Downloaded 70 times
caldera-0.0.3-src.tar.gz
Working source

To test, type:

make test
(50 KiB) Downloaded 92 times
Give a man Linux, you feed the nearest optician ( Been staring at the PC too long again? ).
Give a man OS X, you feed the nearest NVidia outlet ( I need more GPU power!! )
Give a man Windows, you feed the entire Tylenol company ( Self explanatory :D )
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: GRUB Error 13 with CPP kernel

Post 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?
computafreak
Member
Member
Posts: 76
Joined: Sun Dec 14, 2008 1:53 pm

Re: GRUB Error 13 with CPP kernel

Post 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.
User avatar
KotuxGuy
Member
Member
Posts: 96
Joined: Wed Nov 25, 2009 1:28 pm
Location: Somewhere within 10ft of my favorite chubby penguin!

Re: GRUB Error 13 with CPP kernel

Post by KotuxGuy »

Yeah, you're right.How embarrassing.. :oops:
Give a man Linux, you feed the nearest optician ( Been staring at the PC too long again? ).
Give a man OS X, you feed the nearest NVidia outlet ( I need more GPU power!! )
Give a man Windows, you feed the entire Tylenol company ( Self explanatory :D )
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: GRUB Error 13 with CPP kernel

Post 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.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
User avatar
KotuxGuy
Member
Member
Posts: 96
Joined: Wed Nov 25, 2009 1:28 pm
Location: Somewhere within 10ft of my favorite chubby penguin!

Re: GRUB Error 13 with CPP kernel

Post by KotuxGuy »

I did read it. I just implemented it wrong.
Give a man Linux, you feed the nearest optician ( Been staring at the PC too long again? ).
Give a man OS X, you feed the nearest NVidia outlet ( I need more GPU power!! )
Give a man Windows, you feed the entire Tylenol company ( Self explanatory :D )
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: GRUB Error 13 with CPP kernel

Post 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".
User avatar
KotuxGuy
Member
Member
Posts: 96
Joined: Wed Nov 25, 2009 1:28 pm
Location: Somewhere within 10ft of my favorite chubby penguin!

Re: GRUB Error 13 with CPP kernel

Post 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:
Give a man Linux, you feed the nearest optician ( Been staring at the PC too long again? ).
Give a man OS X, you feed the nearest NVidia outlet ( I need more GPU power!! )
Give a man Windows, you feed the entire Tylenol company ( Self explanatory :D )
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: GRUB Error 13 with CPP kernel

Post by Solar »

OK, that's settled. Now give the man a break, please.
Every good solution is obvious once you've found it.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: GRUB Error 13 with CPP kernel

Post by AJ »

Solar wrote:OK, that's settled. Now give the man a break, please.
My thoughts exactly. Locked.
Locked