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.
Error 13: Invalid or unsupported executable format
now don't get me wrong i have been searching for a way to solve this for awhile but i can't seem to find a solution in troubleshooting, and forums.
Infact i read a thread awhile ago and tried to build my kernel.bin file with mingw instead of cygwin, but it still didn't work. Also i could be doing the number of bytes divided by 512 then rounded to the next integer to find the blocks step wrong
Any help would be nice...
Last edited by nuclearmass on Wed Apr 01, 2009 5:12 pm, edited 1 time in total.
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
Infact i read a thread awhile ago and tried to build my kernel.bin file with mingw instead of cygwin
Are you using a cross-compiler to build an ELF binary? If not, you'll be using the Cygwin or Mingw toolchain - both of which will produce a PE executable which GRUB can't boot by itself.
Important: first check the size of your kernel.bin in blocks. This is the length in bytes, divided by 512 and rounded up to the next integer. You will need this number. Let us assume that the kernel size is 18 blocks.
The whole Bochs section is a bit fishy, as it makes assumptions on the sizes of stage1, stage2, and kernel.bin, but doesn't elaborate on how to determine them, so I guess it's easy to fall into the trap of merely copying the values without checking them.
Every good solution is obvious once you've found it.
I think the idea here was to avoid having to mount the image (as you would have to to install GRUB the "standard" way). But I agree - one of the biggest benefits of GRUB, IMHO, is that you can exchange the kernel image without having to rewrite stage1 and stage2...
Every good solution is obvious once you've found it.
Yes, that's obviously the idea. And for a quick success it might even be the best. But considering that you need to adapt to the new kernel size each time, I'd say after about the third non-trivial change to the kernel you would have saved time if you had done it right in the first place (even with Windows, where you need additional software to mount images).