On Tue, 30 Oct 2001, Robert K. wrote:
> Hi!
> I'd like to write a standalone program for some reason.
> So I compiled a test program that pokes around in the VGA-text memory. I
> used the gnu c++ compiler that is included with Redhat 7.1 and compiled
> like this:
> gcc -nostdlib -e main -o test test.cxx
>
> If I try GRUB to load it, GRUB tells me, that it can't recognize the
> format.
> I thought GRUB is capable of ELF?
>
> So, how do I have to compile a program in order to comply?
Its not as simple as that. You need to define a multiboot header in the
executable within the first 8 k of the image. take a look at the example
programs in the multiboot info pages. You might also need to include all
the libraries needed to run the program. by using the -static switch but
you have to watch out for bloat if you use the standard libraries. You
need noni-standard c++ runtime support for that which is not
available yet. Perhaps you can help me finish the one im building :-)
You are using c++ right?
you might try:
gcc -nostdlib -static -Ttext 100000 -e main -o test test.cxx
but i doubt it will run.
>
> _______________________________________________
> Bug-grub mailing list
> [EMAIL PROTECTED]
> http://mail.gnu.org/mailman/listinfo/bug-grub
>
_______________________________________________
Bug-grub mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-grub