Press "Enter" to skip to content

Rust in the Linux kernel: good enough for driver development

The developers of the “Rust for Linux” project led by Miguel Ojeda have expanded the Rust support in the Linux kernel with a series of 17 extensive patches. She is now good enough to use Rust to develop drivers and other modules, Ojeda said on the kernel mailing list.

“Rust for Linux” extends the kernel by an infrastructure that allows Rust to be used as an alternative to C for kernel development. It was announced in April 2021 and received an overall positive response from major Linux developers, including Linus Torvalds. However, Torvalds feared memory allocation issues that could cause kernel panics.

The version presented now is intended to prevent this for the time being with its own version of the allocation library (in Rust jargon, Alloc-Crate) tailored to the kernel. In the future, however, all changes are to flow back into standard Rust, so that special versions are no longer necessary for kernel development.

In its Announcement on the kernel mailing list Ojeda announced a number of additional updates: support for the ARM and RISC-V architectures, functions and infrastructure for software and documentation tests and a revision of the abstraction layer and drivers.

There is also no longer any need for a special compiler for kernel code, the current beta version of the compiler and the currently stable one rustc are sufficient, but some experimental features must be activated. All Rust support is still considered experimental, but will be in linux-next, the “Bleeding Edge” branch of the kernel code.

The support of a more modern language than C in the Linux kernel is of great interest in the IT industry. So will “Rust for Linux” sponsored by Google, although the group has a low-level language with Go with a similar focus. Microsoft is expected to develop Hyper-V drivers for Linux in Rust. ARM and IBM contributed architecture-specific code.

More from iX magazine

More from iX magazine

More from iX magazine


Article Source

Disclaimer: This article is generated from the feed and not edited by our team.