Booting error

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
Tehy

Booting error

Post by Tehy »

I have make a floppy: A:\boot\grub\
there is menu.lst, stage1, stage2 and kernel.ccp.
When I'm booting from the floppy first all works perfect I can choose my os but when it try loads my kernel I got error, ERROR 13: Invalid or unsupported executable format.

Can someone tell me what is wrong?

Thanks!
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Booting error

Post by Pype.Clicker »

what about compiling "kernel.cpp" into some binary format ?
(or am i misinterpreting ".cpp" == "C++ sources" ?)
Tehy

Re:Booting error

Post by Tehy »

yes it is c++ source. can I use that or what I need to do?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Booting error

Post by Pype.Clicker »

oh no, i'm afraid you can't use it just like that ...
GRUB expect to be given an ELF file (that is unix-styled compiled executable). You at least need to compile the sources (gcc / cygwin) into some machinecode, perhaps to link them with other compiled stuff (ld) before you finally get something GRUB can use.

Moreover, you need to know that you'll have virtually NO support code, that means no standard library of whatever form you could imagine, no exception support (which is part of the so-called "runtime library"), etc.

I suggest you check out http://www.osdev.org/osfaq2/index.php/BareBonesC%2B%2B and http://www.osdev.org/osfaq2/index.php/D ... %20C%2B%2B to get an idea of what you're facing ...
Post Reply