Not only the Linux project is in the process of rewriting the kernel in Rust. Microsoft is also recreating the source code of the Windows kernel in Rust – the reason for this is said to be the higher memory security of the programming language compared to the C languages, protection against buffer overflows (buffer overflow) and easier access in memory management.
In this column, the two Rust experts Rainer Stropek and Stefan Baumgartner would like to take turns reporting regularly on innovations and background information in the Rust area. It helps teams already using Rust stay current. Beginners get deeper insights into how Rust works through the Ferris Talks.
Some basic system components are said to have already been ported to Rust, and Windows 11 has received a system call (SysCall) in Rust in addition to a graphic interface. Developers who participate in Microsoft’s Windows Insider program can now get a first taste of Rust.
As of implementing Rust into the Windows kernel
At a conference in Tel Aviv (BlueHat IL), Microsoft’s open source manager David Weston recently announced where the project is internally. The team is in the process of converting internal C++ data types to their Rust equivalents. Renovations have been underway since 2020, when Microsoft began implementing the Windows App SDK with DWrite Core. The DWrite engine is now said to consist of around 152,000 lines of code in Rust and only 96,000 lines in C++.
In addition to security considerations, the faster performance is also a strong argument for switching to Rust. For example, the OpenType Library Services are five to fifteen percent faster than the previous tools. The Windows Graphics Device Interface (Wind32 GDI) is being ported to Rust and is said to already include around 36,000 lines of Rust code. The current version of Windows 11 boots with the Rust version of this interface, but the Rust port is still hidden behind a feature flag.
Recommended Editorial Content
With your consent, an external YouTube video (Google Ireland Limited) will be loaded here.
Always load YouTube video
System Call in Rust and Limits of Rust Love at Microsoft
In his presentation, Weston explained that there is already a system call (SysCall) in the Windows kernel that is implemented in Rust. However, there seem to be clear limits to Rust love on the Microsoft side. Weston was reluctant to make forecasts about the time frame and scope of the project: “We love Rust, but we need a strategy to secure the native code at the same time.” The final switch from Windows to Rust is not to be expected in the near future.
Open source developers had given assessments in various media. Armin Ronacher (the brains behind Flask in Python) told The Register that he thinks highly of Microsoft’s commitment to Rust. He assumes that Microsoft will recycle the existing compiler and hopes that this will provide better support for the PDB program database. Apparently, from an open source perspective, Windows lags behind DWARF-based platforms (Debugging with Attributed Record Formats) in tooling for developers.
In this column we would like to take turns reporting regularly on innovations and background information in the Rust area. It is intended to help teams already using Rust stay up to date. The column should give beginners a deeper insight into how Rust works.
Columnists from the Rust Meetup Linz
The column title refers to Ferris, the crab-shaped unofficial mascot of the Rust community. From now on, Stropek and Baumgartner will write the Ferris Talks monthly and alternately – more about the authors can be found at the end of the article. The two columnists are committed Rustaceans and organize the Rust Meetup Linz, the technical meetings are recorded in video form and can be accessed on the Rust Linz playlist on YouTube. Anyone who would like to meet the two professionally can experience them as speakers and workshop trainers at Heise’s Rust Conference 2021.
Rust is intended to solve tangible security problems
Rust is considered to be easier to maintain and debug than C and C++, which is why ongoing projects from Linux and Microsoft have strong developer support. However, it could still be months before Windows is completely redesigned in Rust: David Weston spoke of “in the next few weeks or months” and kept a low profile with more precise information.
This is not about cosmetics, the kernel is the essential core component of an operating system. For example, if attackers compromise it, they gain control of the device. Such attacks are not limited to Windows and can happen on a Mac, in some cases even on Linux – however, as the most common operating system, Windows is particularly in the focus of attackers. Apparently Microsoft is planning to fundamentally increase the security of the operating system with the change from Windows 10 to 11. Or, in Weston’s words, setting up “Default Security” – perspectively by switching from C++ to Rust.
- Rust Download quickly and securely from heise.de