Microsoft Details Enhancements for Next-Gen Windows 11 Drivers

Microsoft Details Enhancements for Next-Gen Windows 11 Drivers

Microsoft’s Integration of Rust in Windows Driver Development

Since mid-2023, Microsoft has been focusing on incorporating Rust into the Windows operating system. This initiative began with Rust’s successful integration into the Windows kernel, and has now evolved to encourage driver developers to adopt this innovative programming language.

Launch of the Open-Source windows-drivers-rs Project

In July, Microsoft introduced the open-source windows-drivers-rs project, an effort by the Surface team aimed at simplifying Windows driver development using Rust. This framework is designed to boost the efficiency of developing drivers in Rust, providing a more modern alternative to conventional languages like C.

Introduction of the cargo-wdk Crate

Most recently, Microsoft announced enhancements to this initiative, particularly with the rollout of the cargo-wdk crate. This new Cargo extension streamlines the driver creation process by generating empty driver projects that come with preconfigured build steps, dependencies, and linkage. It can also utilize Windows Driver Kit (WDK) tools like InfVerif, mirroring the experience of building drivers with C in Visual Studio.

Advantages of Using Rust

Rust stands out from traditional programming languages such as C by offering superior memory safety features. This attribute significantly mitigates the risk of memory-related security vulnerabilities. Additionally, Rust boasts exceptional compatibility with C and C++ driver code, making the transition for developers more straightforward.

Future Goals and Developments

Microsoft’s long-term vision is to equip Rust developers within the Cargo ecosystem with build tools and configuration options that match those available in Visual Studio. In the medium term, the company aims to implement automatic Windows Driver Kit installation, support for NT_TARGET_VERSION, and full ARM64 compatibility, among other enhancements.

Current Status of Rust in Driver Development

At present, the windows-drivers-rs framework facilitates specific driver types in Rust; however, it still requires a considerable amount of unsafe code. Microsoft is actively collaborating with Rust specialists to create safer abstractions for both Kernel Mode Drivers (KMD) and User Mode Drivers (UMD).Several teams are also working on developing secure structs and APIs tailored for both core kernel functionalities and third-party driver development, with some of these innovations already integrated into the Windows kernel.

Understanding Abstraction in Driver Development

For those who may not be acquainted with the term, abstraction in this context refers to the secure transition process between user mode and kernel mode. The kernel mode operates at the highest privilege level, while user mode functions at a lower privilege tier, highlighting the importance of safe and efficient transitions.

Next Steps and Best Practices

Looking ahead, Microsoft plans to provide further insights and best practices regarding driver development, including the use of CodeQL for static analysis. Notably, the company updated its guidance for third-party driver static analysis in July, aligning with the release of Windows 11 version 25H2.

To explore more about these developments, you can access the full blog post here on Microsoft’s official Tech Community website.

Source & Images

Leave a Reply

Your email address will not be published. Required fields are marked *