Skip to contentSkip to conversation

Test GRUB2 compiled by MingW

DISCUSSION Hanzac Chen 3 participants 6 messages Apr 1, 2005 – Apr 2, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

After I get the GRUB2 successfully compiled by MingW (since it now can handle binary output with its latest version of binutils), I can't boot it after making the image according to the README.

1. boot it with QEMU, got "GRUB loading kernel..." then it seemed to be dead.
2. boot it with Bochs, got a little bit further and displayed "no upper memory".

BTW: When generate the kernel_syms.lst, every symbol should have a underline at the beginning when compiling with some kind of compiler like MingW.

Bye,
Hanzac

#1 lore raw

Hanzac Chen <[email protected]> writes:

Hi Hanzac,

Quoted 8 lines

After I get the GRUB2 successfully compiled by MingW (since it now can handle binary output with its latest version of binutils), I can't boot it after making the image according to the README.

1. boot it with QEMU, got "GRUB loading kernel..." then it seemed to be dead.
2. boot it with Bochs, got a little bit further and displayed "no upper memory".

This is not normal. Perhaps there is still a problem with the compiler or linker or so. MingW is just a modified gcc, right?

Quoted 3 lines

BTW: When generate the kernel_syms.lst, every symbol should have a underline at the beginning when compiling with some kind of compiler like MingW.

Is there a way to fix this so everything remains working on the supported OS'es and making things work on MingW as well?

--
Marco

#2 lore raw
Quoted 2 lines · Marco Gerards

This is not normal. Perhaps there is still a problem with the compiler or linker or so. MingW is just a modified gcc, right?

I think this is normal. IIRC, Windows does not use ELF, while GRUB 2 depends on ELF.

Okuji

#3 lore raw

Hi,

Quoted 7 lines · Yoshinori K. Okuji
Quoted 2 lines · Marco Gerards

This is not normal. Perhaps there is still a problem with the compiler or linker or so. MingW is just a modified gcc, right?

I think this is normal. IIRC, Windows does not use ELF, while GRUB 2 depends on ELF.

Yes, MingW generates COFF and if using COFF, the GCC/binutils can't use some of GAS's directive, like section switch. (I found GRUB using that in its module loading mechanism.)

Maybe I still don't understand it well.

How much else does GRUB 2 depend on ELF?

BYE,
Hanzac

#5 lore raw
In reply to Marco Gerards

Hi,

Quoted 3 lines · Marco Gerards

This is not normal. Perhaps there is still a problem with the compiler or linker or so. MingW is just a modified gcc, right?

OK, I see, next time I'll compile it under Linux GCC, to compare that.

I need to know if the problem is caused by the kernel unable to load its modules. I'm trying to understand how GRUB loads its modules.

BTW: MingW uses PECOFF object format, so it may have some limitations.

Quoted 7 lines
Quoted 3 lines

BTW: When generate the kernel_syms.lst, every symbol should have a underline at the beginning when compiling with some kind of compiler like MingW.

Is there a way to fix this so everything remains working on the supported OS'es and making things work on MingW as well?

Modifying genkernsyms.sh is enough, I think.
Anyway, this is not a big problem.

BYE,
Hanzac

#4 lore raw
In reply to Hanzac Chen
Quoted 7 lines · Hanzac Chen

Yes, MingW generates COFF and if using COFF, the GCC/binutils can't use some of GAS's directive, like section switch. (I found GRUB using that in its module loading mechanism.)

Maybe I still don't understand it well.

How much else does GRUB 2 depend on ELF?

A lot. The modules are all ELF files and the core image has an ELF loader. It would be the best if you could somehow produce ELF executables.

Otherwise another module loader should be implemented for COFF.

Thanks,
Marco