4 ms·
Kernels and device drivers are written in C, not C++.
by 4ad 13y ago
Kernels and device drivers are written in C, not C++.
- FooBarWidget 13y agoDepends on the kernel. For example a large part of the Windows kernel is written in C++.
- tokenrove 13y agoAt least from what I can gather from Pascal's Showstopper (the book on the development of Windows NT), that was against Dave Cutler's wishes, and indeed the main kernel was originally just C; that books documents some of the hassles they have as a consequence of using C++. (And indeed, it strikes me as bizarre that one would use C++ for an OS kernel.)
- 4ad 13y agoActually the scope of C++ in the Windows kernel is extremely limited (or it was ~4 years ago, when I worked on that particular kernel).
- simgidacav 13y ago> Depends on the kernel. For example a large part of the Windows kernel is written in C++. Exactly. Still yeah, I agree with you (and Linus Torvalds) on the fact C should be used.
- cgh 13y agoYou can write device drivers for Windows in C++ and for OS X in a subset of C++ (no exceptions or RTTI, from what I recall).
- 4ad 13y agoC++ for windows drivers is not officially supported, and if you do it, it's pretty tricky to get right: http://download.microsoft.com/download/5/b/5/5b5bec17-ea71-4653-9539-204a672f11cf/KMcode.doc http://download.microsoft.com/download/5/b/5/5b5bec17-ea71-4... Calling the language you write OS X drivers in C++ is also a stretch: https://developer.apple.com/library/mac/documentation/porting/conceptual/PortingDrivers/other-language/other-language.html https://developer.apple.com/library/mac/documentation/portin...