Finally free and safe: Windows drivers in Rust

Microsoft’s Surface development team has released a series of Rust packages (so-called crates) as open source on GitHub, which programmers can use to write drivers for Windows in the Rust programming language. This allows you to create drivers in the Windows Driver Model (WDM) or Windows Driver Frameworks (WDF), both in user and kernel mode. There are also W32 services. Developers use it to work both kernel- and component-related, or they create system services. Overall, according to the operator, this is a test project that is explicitly intended for experimentation and discussion – and not for commercial use.

Advertisement



Rust for Windows drivers on Github

The Microsoft team has published six Rust crates for Windows driver development on GitHub.

(Image: GitHub / Screenshot)

Those up now Crates.io The six packages provided only support the Kernel Mode Driver Framework (KMDF) v 1.33, but all other bindings can be created according to the operators. Interested parties should check out the project’s GitHub repository (windows-drivers-rs) and adjust the configuration in the build.rs file in the wdk-sys folder. In the future, the team would like to expand the project to other versions of the Windows Development Kit (WDK). In terms of functions, the crates create a connection to the WDK and provide a Foreign Function Interface (FFI) to Windows APIs in the WDK. The prerequisites for working with it are LLVM, Cargo Make and an installed WDK.

In addition, the development team from Microsoft’s hardware division already has the example drivers for Windows rewritten in Rust. It became known in May of this year that Microsoft has been using Rust more heavily in the system core since 2020. As is often the case, the company cites increased security with at least the same performance as the motives for turning to Rust.


(who)

To home page

source site