|
|
Log in / Subscribe / Register

Moving the kernel to modern C

Moving the kernel to modern C

Posted Feb 28, 2022 13:04 UTC (Mon) by Cyberax (✭ supporter ✭, #52523)
In reply to: Moving the kernel to modern C by farnz
Parent article: Moving the kernel to modern C

> It is a technical argument; both Apple and Microsoft are able to enforce a subset of C++ that their kernel developers are happy with, and have CI setups that prohibit the use of features that do not behave well in kernel mode.

I wrote quite a bit of code in Windows kernel space, and most of Windows kernel is written in pure C. With few notable exceptions like the bad old GDI code.

Apple's kernel code is also mostly C, and you can download it and check yourself: https://github.com/apple/darwin-xnu


to post comments

Moving the kernel to modern C

Posted Feb 28, 2022 15:09 UTC (Mon) by camhusmj38 (subscriber, #99234) [Link]

The situation has changed. The Windows Implementation Library includes C++ RAII helpers which are used in the operating system and drivers. They take care of closing handles etc. MSVC also has a kernel mode C++ switch which disables RTTI and Exceptions as well as floating point.
Apple's driver kit has always been C++.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds