Page 2 of 3

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 2:20 am
by distantvoices
KISS?! You don't mean that crazy heavy metal band, do you?

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 2:44 am
by Candy
beyond infinity wrote: KISS?! You don't mean that crazy heavy metal band, do you?
KISS: Keep It Simple, Stupid!

no, that wasn't even personal but actually in the acronym.

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 4:02 am
by bubach
beyond infinity: Have you been living in a box the last couple of years? :P

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 4:18 am
by distantvoices
@bubach: yeah: in a house. For 30 years now. *chuckle* Sure you too are living in such an odd thing are you? *sfg*

You know KISS?

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 4:19 am
by ineo
Solar wrote: I admit I haven't (since I went KISS, and not very far for that matter), but I didn't find any references to indicate they were not working out-of-the-box. Thanks for the warning (in case I'd pick up my kernel project sometime).
Well, the C++ ABI is a good starting point. The gcc implementation can be found in gcc source under "libsupc++". That's what is needed for gcc to support c++.
If I remember correctly, virtual functions need support because of the pure virtual exception that is thrown...

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 4:21 am
by bubach
I meant a really small box, with no connection to the world whatsoever.. :P
KISS is wellknown around here, you can't have missed it.. ;)

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 4:33 am
by distantvoices
Ah! You mean HERE! *rofl* And I have refered to real world aaaall the time. Now look, who is the unhappy hippopotamus here *lolbhtf*

Small box ... Hm, I'm about 2 meters tall. And sure you don't mean a wooden night gown, do you?];->

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 4:46 am
by bubach
lol.. well, no.
we better end this pointless thing now. ;)

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 4:50 am
by Pype.Clicker
am i hearing distant voices from beyond infinity talking about a mystical box where people have "house" instead of homepages ?

and what's that "real world" you're all talking about ?

soz. currently reading a novel by Tad Williams (otherland) about minds trapped in omnipresent-VR-internet-has-become... couldn't resist

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 4:57 am
by Solar
ineo wrote: The gcc implementation can be found in gcc source under "libsupc++". That's what is needed for gcc to support c++. If I remember correctly, virtual functions need support because of the pure virtual exception that is thrown...
Ah, but virtual functions and pure virtual functions are two different beasts - and you could easily avoid pure virtuals if the exception is all you have to worry about.

It would be interesting to have someone verify the capability of using virtual / pure virtual functions in kernel space without additional support code.

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 5:04 am
by distantvoices
Pype.Clicker wrote: am i hearing distant voices from beyond infinity talking about a mystical box where people have "house" instead of homepages ?

and what's that "real world" you're all talking about ?

soz. currently reading a novel by Tad Williams (otherland) about minds trapped in omnipresent-VR-internet-has-become... couldn't resist
Ah, Otherland ... that's one cool series. More than just a bit dark I daresay, but really good. And that cruel murderer with his twist ... oh lad. Already got a clue why that vr-specialist woman is blind and why they can't escape from VR? *gg* in which part of the four volumes are you?

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 5:41 am
by ineo
Solar wrote: It would be interesting to have someone verify the capability of using virtual / pure virtual functions in kernel space without additional support code.
I'll check that tonight. I did some tests a year ago, I think I still have it at home.

Here are the results I remember:
- You can use virtual method (& inheritance) "out-of-the-box"
- You must reimplement libsupc++ for exceptions (stack unwinding :( ), new, delete, pure virtual.

But I always considered C++ as a whole, that's why it was obvious I needed the libsupc++ part. But that's a design choice, maybe not the best one.

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 6:08 am
by Solar
My main consideration why I want my kernel in C++ is the better scoping (namespaces, class members), syntax (kout << ... instead of printf(...)) and stricter error checking. That's why I was perfectly comfortable with not having new(), exceptions etc. - as long as the FirstStep kernel lasted. ;)

Re:How do you program an OS in c++ without the libraries at

Posted: Mon May 09, 2005 11:24 am
by srg
Solar wrote: My main consideration why I want my kernel in C++ is the better scoping (namespaces, class members), syntax (kout << ... instead of printf(...)) and stricter error checking. That's why I was perfectly comfortable with not having new(), exceptions etc. - as long as the FirstStep kernel lasted. ;)
In theory, an operating system would be an excellent candidate for OO programming, as the devices in a machine are objects. Take the floppy drive for example, there could be member functions for reading and writing, plus properties for any other device registers etc.

srg

Re:How do you program an OS in c++ without the libraries at

Posted: Tue May 10, 2005 1:28 am
by Solar
Yes, of course - that is a welcome bonus. But You can code at least object-based in plain C, too. And you don't need pure virtual functions to implement an OO kernel, either - that's what I wanted to say.

Overly ambitious object hierarchies are usually a telltale sign of someone infatuated with the OO paradigm, disliking templates and more at home with Java than with C++. ;) No offense intended. ;)