Mail Archives: djgpp/1999/03/25/10:05:52
Renji Panicker wrote:
>
> As an academic self interest project ( for learning the finer intricacies of
> DjGpp ) I tried running a raw C++ program, without any of the libraries
> linked in. The a.out format executable is launched by GRUB, which as I am
> sure most of you must know, is a generic bootloader.
Are you talking about the grub from the Hurd project? In that case, I
would check to make sure that it can load an image in thea.out format.
Assuming that it can, then I would check to make sure that your C++
program (either the code you have written yourprog.cc, or any part of
the C++ runtime that is linked in by g++ even without any library
specification, things like crt0.o, etc.) doesn't rely on anything that's
not loaded by grub, e.g., the OS itself.
> I don't seem to be able to:
> 1. Use static variables
> 2. Use pure virtual functions.
Static variables are tricky even if you run the program from the command
line. Pure virtual functions too.
> I would appreciate any help I can get in not only the above two points, but
> any pointers to FAQs, HOWTOs etc on going about it.
You are mixing two topics in one experiment: grub and C++. Try separate
them into two tasks: i) write an image that grub can load, ii) figuring
out the intricacies of C++.
The grub documentation will answer all your questions for i).
Topic ii) is probably too broad to be covered in a FAQ or HOWTO. How
about some books? Effective C++ (2nd ed.), More Effective C++, The C++
Programming Lnaguage, The C++ Object Model. The last book discusses in
length the two questions you have asked.
--
Weiqi Gao
weiqigao AT a DOT crl DOT com
- Raw text -