Originally posted by: MrMilney
Originally posted by: singh
The bare OS is written in C and assembly (for device drivers). C++ is generally not used in OS development, and probably won't be anytime soon.
I know a lot of the kernel stuff was written in C (and probably asm) for the sake of speed because at the time there was nothing else that approached it performance wise. However, I think that if you were to start to write an OS today using C++ with a little asm where speed is essential would not be a bad way to go at all. Singh, do you know something that I don't regarding C++ as a potential language (I admit it's very possible you do)?
It's not just about the speed. C++ requires memory management (which may be taken care of by over-riding the global new & delete operators), and the C++ standard libraries are also OS dependent.
With C++, you also have to worry about exceptions (very big issue IMO). Anything running at the
user level may be coded in C++, but everything running above will need asm or C.
The main point is that with C, not much goes on "behind the scenes" - you always have to tell the compiler what to do. With C++, you have constructors, destructors, exceptions etc.