The tenth version of Rust for Linux arrives, ready for inclusion in Linux 6.1

Rust drivers on Linux

Rust is now ready to join C as a practical language to implement on Linux

A few weeks ago we shared here on the blog the news about the confirmation that was made during the Open Source Summit Europe, by Linus Torvalds announced that, barring unforeseen problems, sand will include patches to support the development of the Rust driver in the Linux 6.1 kernel, which is expected to be released in December.

The reason for mentioning it is that Miguel Ojeda, author of the Rust-for-Linux project, announced recently the launch of the tenth proposal of the components for development Rust device drivers for Linux kernel developers to consider.

As such this is the eleventh edition of the patches, taking into account the first released version (no version number). Linus Torvalds approved the inclusion of Rust support in the Linux 6.1 kernel, barring unforeseen problems.

Rust drivers on Linux
Related article:
Torvalds announced that Rust will be accepted in Linux 6.1

It is worth mentioning that the development is funded by Google and the ISRG (Internet Security Research Group), which is the founder of the Let's Encrypt project and promotes HTTPS and the development of technologies to increase Internet security.

Some of the benefits of getting Rust support in the kernel are make it easy to write controllers of secure devices by reducing the chances of memory errors and encourage new developers to get involved in the kernel.

"Rust is one of those things that I think will bring in new faces... we're getting old and grey," Linus said.

The release notes for Linux 6.0 Provide Update on Rust Project Progress for Linux: there is a related working group, a preliminary driver for NVMe storage media developed with that language is available, as well as a driver for a server intended for the 9P network protocol.

Taking advantage of the mention about kernel version 6.1 Linus also announced that version 6.1 of the kernel will improve some of the older parts and kernel fundamentals, such as the printk() function.

Regarding this new proposal for Rust patches, as well as the latest version of the patches, the tenth version is stripped down to a bare minimum, enough to build a simple kernel module written in Rust.

Differences with the previous version are reduced to minor corrections, replacing sizeof with ARRAY_SIZE in kallsyms.c and porting patches to kernel v6.0-rc7.

Rust support should still be considered experimental. Nevertheless,
Support is good enough that kernel developers can start working on it.

The minimal patch, which has been reduced from 40 lines of code to 000 lines of code, is expected to, make it easy to adopt Rust support in the core. After providing minimal support, it is planned to gradually increase existing functionality, porting other changes from the Rust-for-Linux branch.

The proposed changes make it possible to use Rust as a second language for developing drivers and kernel modules. Rust support is presented as an option that is not enabled by default and does not result in Rust being included among the required build dependencies for the kernel.

Using Rust to develop drivers will allow you to create better and safer drivers with minimal effort, without problems like accessing a memory area after freeing it, dereference null pointers, and buffer overflows.

Safe memory handling is provided in Rust at compile time by checking references, tracking object ownership, and object lifetime (scope), as well as by evaluating the correctness of memory access during code execution.

rust too provides integer overflow protection, requires mandatory initialization of variable values ​​before use, better handles errors in the standard library, enforces the concept of immutable variables and references by default, offers strong static typing to minimize logical errors.

Finally if you are interested in knowing more about it about the note, you can consult the mailing lists on the subject, In the following link.


Leave a Comment

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

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.