Computer operating systems

Discussion in 'C++' started by George, Apr 6, 2008.

  1. George

    George Guest

    George, Apr 6, 2008
    #1
    1. Advertising

  2. George

    stan Guest

    Alf P. Steinbach wrote:
    > * 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++.
     
    stan, Apr 7, 2008
    #2
    1. Advertising

  3. George

    James Kanze Guest

    On Apr 7, 3:06 am, stan <> wrote:
    > Alf P. Steinbach wrote:
    > > * 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++.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Apr 7, 2008
    #3
  4. stan wrote:

    > [...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.
     
    Paul Brettschneider, Apr 7, 2008
    #4
  5. George

    stan Guest

    James Kanze wrote:
    > On Apr 7, 3:06 am, stan <> wrote:


    <snip>

    >> 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++.


    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.
     
    stan, Apr 8, 2008
    #5
  6. George

    stan Guest

    Paul Brettschneider wrote:
    > stan wrote:
    >
    >> [...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 <math.h> vs <cmath> and mentions they don't need the
    workarounds.
    >
    > 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.

    >
    > 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.
     
    stan, Apr 8, 2008
    #6
  7. George

    James Kanze Guest

    On Apr 8, 1:53 am, stan <> wrote:
    > James Kanze wrote:
    > > On Apr 7, 3:06 am, stan <> wrote:


    > <snip>


    > >> 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++.


    > 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.)

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


    > 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.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Apr 8, 2008
    #7
  8. stan a écrit :
    > Alf P. Steinbach wrote:
    >> * 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
     
    Michael DOUBEZ, Apr 8, 2008
    #8
  9. > 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.
     
    Laurent D.A.M. MENTEN, Apr 8, 2008
    #9
  10. George

    stan Guest

    James Kanze wrote:
    > On Apr 8, 1:53 am, stan <> wrote:
    >> James Kanze wrote:
    >> > On Apr 7, 3:06 am, stan <> wrote:

    >
    >> <snip>

    >
    >> >> 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++.

    >
    >> 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.)


    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.
    >
    >> > With regards to C++, Symbian seems to be mostly C++.

    >
    >> 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.


    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.
     
    stan, Apr 10, 2008
    #10
  11. George

    stan Guest

    Michael DOUBEZ wrote:
    > stan a écrit :

    <snip>

    >> 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.


    Thanks, I didn't know that; I'll take a little look.
     
    stan, Apr 10, 2008
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce Lee
    Replies:
    11
    Views:
    1,768
    Thomas G. Marshall
    Dec 5, 2004
  2. eino
    Replies:
    1
    Views:
    435
    =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=
    May 8, 2007
  3. Santhosh1992

    Computer operating systems

    Santhosh1992, Apr 5, 2008, in forum: Java
    Replies:
    3
    Views:
    357
    Mark Space
    Apr 5, 2008
  4. George

    Computer operating systems

    George, Apr 6, 2008, in forum: Java
    Replies:
    1
    Views:
    379
    George
    Apr 6, 2008
  5. Tim Daneliuk

    Win32All On 64-Bit Operating Systems

    Tim Daneliuk, Mar 17, 2010, in forum: Python
    Replies:
    6
    Views:
    274
    Tim Daneliuk
    Mar 18, 2010
Loading...

Share This Page