c++ usage in operating systems

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

c++ usage in operating systems

Post by Candy »

What is needed for supporting c++ programs, that is, c++ programs with all sorts of extensions (exception handling, overloading, RTTI etc), in an operating system? ( OS == kernel + loader etc)

Does supporting C++ shared libraries cost extra?
Tim

Re:c++ usage in operating systems

Post by Tim »

Exception handling tends to be the hard one; it's not only compiler-specific, but OS-specific too. The compiler generally emits OS-specific code to deal with exceptions, so you might have a choice of either (a) making your OS's exception design match the design of the exceptions for the OS that your compiler targets or (b) modifying the compiler.

RTTI is compiler-specific but need not use any OS features. You'll need to reverse-engineer the system that your compiler uses for RTTI and put that it. With gcc, the RTTI stuff may be in libgcc.a (haven't tried).

new and delete (and new[] and delete[]) are easy. Constructors and destructors are slightly harder, but still easy. Everything else doesn't need any special handling.
Post Reply