On 6/13/2022 1:57 AM, Bijan Soleymani wrote:
So again your choices in practice are assembly, C, a subset of C++
(essentially C + classes, but no standard library and practically no
templates due to stack limitation), maybe rust or some language you
design yourself.
Here's a blog post about kernel drivers on Windows in Rust, turns out
that just like C++ you can't use the standard library in rust:
https://not-matthias.github.io/posts/kernel-driver-with-rust/
"Rust provides lots of abstractions in thestandard library
<https://doc.rust-lang.org/std/>which cannot be used in the kernel
because it uses the Windows API behind the scenes. Thanks to the awesome
language design, we can remove the standard library by specifying
the|#![no_std]|attribute in|main.rs|."
The same thing would apply to linux, as there are almost certainly
usermode/(g)libc calls in the rust standard library that you can't make
from the kernel.
Bijan