Computer operating systems

S

stan

Alf said:
* George:
Are you crazy about different operating systems like C++,
java in computers?
If you want to check about that please visit
[some blog page].com/

This is off-topic in comp.lang.c++.

I'm not sure whether it's spam, although you've posted the same article under
two different names.

But if it isn't spam, please stop posting this message (and by the way, neither
C++ nor Java are operating systems).

Makes you wonder why the quantity of trolls lately. Used to be they
showed up in force at the beginning of the school year, now the reason
seems pretty hard to grok. Is someone having a big sale on computers?

For a little on topic content, is there any operting system written in
C++? I think parts of windows is C++ but is the whole thing? It's hard
to seperate library and system at times, but here I'm wondering about
the basic kernel in c++.
 
J

James Kanze

Alf said:
* George:
Are you crazy about different operating systems like C++,
java in computers? If you want to check about that please
visit [some blog page].com/
This is off-topic in comp.lang.c++.
I'm not sure whether it's spam, although you've posted the
same article under two different names.
But if it isn't spam, please stop posting this message (and
by the way, neither C++ nor Java are operating systems).
Makes you wonder why the quantity of trolls lately. Used to be
they showed up in force at the beginning of the school year,
now the reason seems pretty hard to grok. Is someone having a
big sale on computers?
For a little on topic content, is there any operting system
written in C++? I think parts of windows is C++ but is the
whole thing? It's hard to seperate library and system at
times, but here I'm wondering about the basic kernel in c++.

At the very lowest level of the kernel, it has to be assembler.
There's no way to write a context switch in C, let alone C++.

With regards to C++, Symbian seems to be mostly C++.
 
P

Paul Brettschneider

stan said:
[...on spam...]

For a little on topic content, is there any operting system written in
C++? I think parts of windows is C++ but is the whole thing? It's hard
to seperate library and system at times, but here I'm wondering about
the basic kernel in c++.

BeOS/Haiku:
http://www.haiku-os.org/documents/dev/haiku_coding_guidelines

Though I don't know what subset of C++ they use. Seeing what kind of code
g++ produces for RAII and exceptions, I have to wonder about the
suitability of C++ for low level OS functions.

For example
http://svn.berlios.de/viewcvs/haiku...ernel/Notifications.cpp?rev=21780&view=markup
looks more like C with classes than C++ to me.
 
S

stan

James said:
At the very lowest level of the kernel, it has to be assembler.
There's no way to write a context switch in C, let alone C++.

I was allowing for some assembly, I should hve been clearer.
With regards to C++, Symbian seems to be mostly C++.

Interesting, I've heard of it but I'm not very familiar with Symbian.

All the operating system and driver stuff I've ever been involved with
has been non object stuff and I was trying to imagine what an object
oriented approach might look like. Actually, I worked a little with
cygwin which isn't really an operating system and isn't really OO but it
does head in that direction; it does have classes, inheritance, and
polymorphic functions. Much past those points the cygwin code gets
strange because of trying to harmonize the windows api and the linux
system calls. The twists, turns, and kludges pile up quickly and your
head starts to hurt on a casual reading. Not that the code is
necessarily bad, it's just that the problems to be solved are ugly and
the code follows.
 
S

stan

Paul said:
stan said:
[...on spam...]

For a little on topic content, is there any operting system written in
C++? I think parts of windows is C++ but is the whole thing? It's hard
to seperate library and system at times, but here I'm wondering about
the basic kernel in c++.

BeOS/Haiku:
http://www.haiku-os.org/documents/dev/haiku_coding_guidelines

Interesting, that style guide actualy encourages including the old style
headers said:
Though I don't know what subset of C++ they use. Seeing what kind of code
g++ produces for RAII and exceptions, I have to wonder about the
suitability of C++ for low level OS functions.

I hadn't actually given it a lot of thought; I was just pondering what
more object like system code would look like. Your question about
suitability is probably only the tip of the iceberg of issues that would
surface. I realize that systems programming wasn't a particular design
goal, but I wonder how suitable the STL is for systems and how much
tweaking would be required. Given the tradeoffs to build a general
purpose library, which parts would be useful as is and which parts would
need mods. But, I think your original question makes the library a moot point.
 
J

James Kanze

I was allowing for some assembly, I should hve been clearer.

I understood that, but when you speak of "the basic kernel", how
high do you go? A well designed OS will be extremely layered,
and the "basic kernel" won't necessarily be much more than the
scheduler lookup and context switch. (In the one OS I wrote,
about 10 machine instructions in all.)
Interesting, I've heard of it but I'm not very familiar with
Symbian.

I've never programmed to either, but from what I gather, it's
more wide-spread than Windows (since it is running on most of
your cellular phones).

There was also a distributed OS developed in France some 15 (or)
more years ago that was largely written in C++. Chorus, or
something like that. It was bought out by Sun, and presumably
parts of it have made their way into Solaris.
All the operating system and driver stuff I've ever been
involved with has been non object stuff and I was trying to
imagine what an object oriented approach might look like.

Interesting. Although it didn't go by that name, most OS's have
been OO long before OO became popular. Think about it: the
basic principle of OO is polymorphism, right? You call a
function, and it's actual implemnetation and behavior depend on
the type of object you call it on. In other words, when you
call write(), if it is OO, the actual behavior will depend on
whether the file descripter refers to a file, a console, a
socket, or... The kernels of most OS's go back to before C++,
but all of the ones I've worked on had a manually implemented
vtable for the I/O. I'd say that C++ would be a natural for
that part, at least.

When I wrote my OS, I had one system request, respond, which
depended on the type of object whose handle it got: if you
passed it a process, it would start it; a message queue, it
would send a message; etc. Originally, I implemented it as part
of the timer queue: when you made a timer request, you'd pass it
a handle and a "message", and what happened when the timer event
occurred depended on the type the handle referred to. I then
decided that it might be more generally interesting: you'd send
a request to another process, with a handle where you wanted the
response, and the other process didn't have to know how you
wanted the response sent; the OS took care of it all. This was
in 1979, and I'd never heard of OO or C++ at the time, so in
fact, I implemented the polymorphism by means of a switch, but
the idea was there.
 
M

Michael DOUBEZ

stan a écrit :
Alf said:
* George:
Are you crazy about different operating systems like C++,
java in computers?
If you want to check about that please visit
[some blog page].com/
This is off-topic in comp.lang.c++.

I'm not sure whether it's spam, although you've posted the same article under
two different names.

But if it isn't spam, please stop posting this message (and by the way, neither
C++ nor Java are operating systems).

Makes you wonder why the quantity of trolls lately. Used to be they
showed up in force at the beginning of the school year, now the reason
seems pretty hard to grok. Is someone having a big sale on computers?

For a little on topic content, is there any operting system written in
C++? I think parts of windows is C++ but is the whole thing? It's hard
to seperate library and system at times, but here I'm wondering about
the basic kernel in c++.

IIRC the core of eCos is written in C++. I don't know if it is largely used.

Michael
 
L

Laurent D.A.M. MENTEN

All the operating system and driver stuff I've ever been involved with
has been non object stuff and I was trying to imagine what an object
oriented approach might look like.

Actually, a driver can really be seen as object oriented since it hsa to
declare a table of function pointers which "overload" the system default
ones.
 
S

stan

James said:
I understood that, but when you speak of "the basic kernel", how
high do you go? A well designed OS will be extremely layered,
and the "basic kernel" won't necessarily be much more than the
scheduler lookup and context switch. (In the one OS I wrote,
about 10 machine instructions in all.)

That's about right. I've haven't actually worked on a full system for
awhile and I've done more with monolithic kernel's than the more modern
microkernel stuff but I believe deeply in the do one thing and do it
well pov. I suppose reasonable people could debate where the line around
the kernel stops. The i/o subsystem has seen the line moved all over the
place. In general I think as much as possible should be moved out of the
"basic kernel". Still not a very clear answer to your question.
I've never programmed to either, but from what I gather, it's
more wide-spread than Windows (since it is running on most of
your cellular phones).

There was also a distributed OS developed in France some 15 (or)
more years ago that was largely written in C++. Chorus, or
something like that. It was bought out by Sun, and presumably
parts of it have made their way into Solaris.


Interesting. Although it didn't go by that name, most OS's have
been OO long before OO became popular. Think about it: the
basic principle of OO is polymorphism, right? You call a
function, and it's actual implemnetation and behavior depend on
the type of object you call it on. In other words, when you
call write(), if it is OO, the actual behavior will depend on
whether the file descripter refers to a file, a console, a
socket, or... The kernels of most OS's go back to before C++,
but all of the ones I've worked on had a manually implemented
vtable for the I/O. I'd say that C++ would be a natural for
that part, at least.

Agreed although I've seen I/O fractured into some messy divisions. But I
accept your point. I still struggle sometimes to not write c with clases
so I'm sensitive to how I use the phrase OO as I've been oh so gently
corrected on occasion.
When I wrote my OS, I had one system request, respond, which
depended on the type of object whose handle it got: if you
passed it a process, it would start it; a message queue, it
would send a message; etc. Originally, I implemented it as part
of the timer queue: when you made a timer request, you'd pass it
a handle and a "message", and what happened when the timer event
occurred depended on the type the handle referred to. I then
decided that it might be more generally interesting: you'd send
a request to another process, with a handle where you wanted the
response, and the other process didn't have to know how you
wanted the response sent; the OS took care of it all. This was
in 1979, and I'd never heard of OO or C++ at the time, so in
fact, I implemented the polymorphism by means of a switch, but
the idea was there.

I agree the concepts involved aren't really that new. I've also seen
the ideas misunderstood, misapplied, and just plain badly done. Like
any tool abuse is possible and the manufacturers of idiots always
win. I was thnking more of how much templates would help or hurt, or
classes/constructors/destructors, or even the STL. Here I'm clearly
talking about moving up into that next layer above the machine intimate
issues.
 
S

stan

Michael said:
stan a écrit :

IIRC the core of eCos is written in C++. I don't know if it is largely used.

Thanks, I didn't know that; I'll take a little look.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top