Mail Archives: djgpp/1999/03/26/02:58:54
Message-ID: | <002201be775e$20e2acb0$6c7c5ecc@brahma.ruksun.com>
|
From: | "Renji Panicker" <brahma AT ruksun DOT com>
|
To: | <djgpp AT delorie DOT com>
|
Subject: | Re: Raw C++ project.
|
Date: | Fri, 26 Mar 1999 13:26:11 +0530
|
MIME-Version: | 1.0
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Mailer: | Microsoft Outlook Express 4.72.2106.4
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.2106.4
|
Reply-To: | djgpp AT delorie DOT com
|
Ooohhh.. hold on. My mistake. I am already quite familiar with C++ with
over 3-4 years experience in C++ coding. When I said:
>> 2. Use pure virtual functions.
What I meant was:
>> 2. Use pure virtual functions using DjGPP.
I should have said that better the first time.
Incidentally, I am indeed talking about the Grub from the Hurd project. I
did check all the documentation available for Grub without success. It can
understand the a.out and ELF format.
The code I have written so far, almost all C++, with a little asm and c,
just init's the screen memory and displays a string. It does get loaded and
executed. But what actually happens is, when I declare any static
initialized variable, and try to write to it, the machine reboots. Would
this happen if, say, the loader did not load the appropriate section? What
section would all init'ed data go to? I am not using any of the standard
libraries in this code.
Thanks mucho!
-/renji
-----Original Message-----
From: Weiqi Gao <weiqigao AT a DOT crl DOT com>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
Date: Thursday, March 25, 1999 10:40 PM
Subject: Re: Raw C++ project.
>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 -