Page 1 of 1

GrUB Error 13 and Cygwin

Posted: Thu Jun 23, 2011 9:05 am
by banici
Hi,
I was trying to implement keyboard support into my OS, but I ran into similar problem, so I started from bare bones. I have installed GCC cross-compiler with Cygwin. I have added solution from wiki, but it doesn’t work. When I compile and run it, GrUB displays “Error 13: Invalid or unsupported executable format”. What am I doing wrong?

NASM version: 2.08.02-1
GCC and G++ version: 3.4.4-999

Sorry for another Error 13 question. I didn’t found solution in other topics :oops:


PS: Can I use Eclipse with Cygwin?

Re: GrUB Error 13 and Cygwin

Posted: Thu Jun 23, 2011 6:52 pm
by thepowersgang
I've tried compiling your kernel on my setup (GCC 4.4.1 i586-elf), and the multiboot header is valid. Qemu is able to boot it with the -kernel option. So I don't know what your are doing wrong.

However, it seems that you are using the default cygwin compiler to build your kernel, instead of the cross compiler. This is probably linking the kernel as PE instead of elf, hence grub cannot understand it.

Re: GrUB Error 13 and Cygwin

Posted: Sun Jun 26, 2011 9:51 am
by banici
Yes, my command was wrong. I should cal i586-elf-ld instead of ld.

I tried to boot on real hardware, but grub wrote on screen “loading stage2 ….” I was using USB stick and boot header from iso file (generated by genisoimage).
Most likely I had wrong boot header and it couldn’t load stage2 and kernel?