Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ntoskrnl.exe is C too


Not since Vista.

https://docs.microsoft.com/en-us/cpp/build/reference/kernel-...

> Creates a binary that can be executed in the Windows kernel. The code in the current project gets compiled and linked by using a simplified set of C++ language features that are specific to code that runs in kernel mode.

And then there is WIL, https://github.com/microsoft/wil

https://community.osr.com/discussion/291326/the-new-wil-libr...

> First off, let me point out that this library is used to implement large parts of the OS. There are hundreds of developers here who use it. So unlike, uh, some other things that get tossed onto github, this project is not likely to wither and die tomorrow.

> There are, however, only a handful of kernel developers working on the library, so the kernel support has been coming along much slower. I'd like to expand the existing kernel features in depth ....


can explain how the existence of a compiler flag that allows third parties to compile C++ such that it can run in kernel means that the kernel has been rewritten in C++?

the fact LLVM allows javascript to be transpiled to C doesn't mean Linux kernel has been rewritten in Javascript


Apparently someone is lacking reading skills in how WIL is used on the kernel.


okay, so there exists a library that allows people to write C++ code that can be loaded into the kernel

this doesn't mean the ntoskrnl.exe is written in C++

the fact nvidia's linux loadable kernel blob is written in C++ doesn't suddenly mean linux is written in C++

"grasping at straws" would seem to sum up your position


Why do you think Microsoft decided to drop C support beyond C89 and only caved in due to the pressure of FOSS projects?

A kernel without drivers, only produces heat.

> "grasping at straws" would seem to sum up your position

Fits exactly the position of someone that desperately wants to assert ntoskernel.exe is written just like when NT 3.51 got released into the world.

"Kernel proper - This is mostly written in C. Things like the memory manager, object manager, etc. are mostly written in C. The boot loaders are written in ASM, but set up a C environment rather quickly.

Drivers - that said, a lot of newer kernel mode drivers are actually written in C++ (however, its style is more akin to "C with classes". Lower level code has been much slower to adopting anything past C++98)

User land - Mostly C++ with varying levels of quality and version compliance. If it's a pre-Windows 8.0 component, it was written against mostly C++98. More recent features are C++14 and better."

-- https://www.reddit.com/r/cpp/comments/4oruo1/windows_10_code...

Bye, have fun with C.


> "Kernel proper - This is mostly written in C.

thank you

only took 17 hours to get there, but we finally got there




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: