I'm aware that I/O Kit is written in C++, I added that to my comment (maybe you saw the old version). Drivers are not really kernel per se, there are plenty of systems which have no drivers in the kernel (usually except RTC, which is in kernel in XNU anyway).
Also, it's not really C++, it's a pretty serious subset (lacking templates, multiple inheritance, exceptions, reflection, funky new casts [reinterpret_cast, static_cast, dynamic_cast, const_cast], and even namespaces(!)).
> Also, it's not really C++, it's a pretty serious subset (lacking templates, multiple inheritance, exceptions, reflection, funky new casts [reinterpret_cast, static_cast, dynamic_cast, const_cast], and even namespaces(!)).
Oh come on. Its not like you see C99 dynamic arrays used very much in Kernel mode.
That's the joy of programming languages. Good programmers use the good parts and ignore the bad parts. C++ has a lot of bad parts (with regards to kernel programming. Such as how most of the STL automatically reallocates memory on its own whims).
So, you ignore the parts that don't work for your task, and the work with the parts that are useful. Very few people have good uses of multiple inheritance anyway.
----------
> Also, it's not really C++, it's a pretty serious subset (lacking templates, multiple inheritance, exceptions, reflection, funky new casts [reinterpret_cast, static_cast, dynamic_cast, const_cast], and even namespaces(!)).
BTW: The -kernel flag in Visual Studio only disables:
* Dynamic Casts (Reflection/RTTI is disabled), Exceptions, and the DEFAULT New / Delete.
Templates, Static_cast / Const_cast and all that good stuff are still available.
> I'm aware that I/O Kit is written in C++, I added that to my comment (maybe you saw the old version).
The danger of quick edits. : )
> Drivers are not really kernel per se, there are plenty of systems which have no drivers in the kernel (usually except RTC, which is in kernel in XNU anyway).
I mean, except more than half of the OSs you listed. And of those you listed that are microkernels, only QNX has gotten any serious traction.
> Also, it's not really C++, it's a pretty serious subset (lacking templates, multiple inheritance, exceptions, reflection, funky new casts [reinterpret_cast, static_cast, dynamic_cast, const_cast], and even namespaces(!)).
Yeah, compilers have come a really long way in the nearly 20 years since that was designed, but they want to keep ABI compatibility.
Also, it's not really C++, it's a pretty serious subset (lacking templates, multiple inheritance, exceptions, reflection, funky new casts [reinterpret_cast, static_cast, dynamic_cast, const_cast], and even namespaces(!)).