www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/25/10:05:52

From: Weiqi Gao <weiqigao AT a DOT crl DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Raw C++ project.
Date: Thu, 25 Mar 1999 14:25:25 +0000
Organization: CRL Network Services
Lines: 38
Message-ID: <36FA4755.8BB69B8B@a.crl.com>
References: <004c01be7697$b1ca3170$6c7c5ecc AT brahma DOT ruksun DOT com>
NNTP-Posting-Host: a116016.stl1.as.crl.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.34 i586)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019