Moving the kernel to modern C
Moving the kernel to modern C
Posted Feb 26, 2022 22:05 UTC (Sat) by camhusmj38 (subscriber, #99234)In reply to: Moving the kernel to modern C by marcH
Parent article: Moving the kernel to modern C
Many projects use the no RTTI / no exceptions dialect of C++ - every major compiler provides switches to enable that. I believe GCC itself is built in that way, many major games and financial applications are built that way. It’s simple to setup a build system to do that.
Apple’s driver kit uses C++ for kernel code and Microsoft also has a subset of C++ they approve for writing Kernel Mode code. It’s not beyond the wit of the Linux Kernel developers to do that or to set simple standards for code they will accept in mainline. All we are talking about is using RAII and data encapsulation to enable safer more reliable coding. As a comment above says, the aspects of Rust that are being promoted to the Kernel can all be enabled in C++ as a start.
Apple’s driver kit uses C++ for kernel code and Microsoft also has a subset of C++ they approve for writing Kernel Mode code. It’s not beyond the wit of the Linux Kernel developers to do that or to set simple standards for code they will accept in mainline. All we are talking about is using RAII and data encapsulation to enable safer more reliable coding. As a comment above says, the aspects of Rust that are being promoted to the Kernel can all be enabled in C++ as a start.
