The eighth version of the patches for Rust driver support on Linux arrives

Miguel Ojeda, author of the Rust-for-Linux project released the eighth release of developing Linux kernel patches with Rust language support for Linux kernel developers to consider.

This ranks as the ninth release of the patches (taking into account the first released version without a version number). Rust support is considered experimental, but it's already included in the linux-next branch, claims for integration in the fall release of 5.20/6.0, and is advanced enough to start working on creating abstraction layers on top of the kernel subsystems, as well as writing controllers and modules.

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.

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.

Memory safety 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 the execution of the code.

What's new in this eighth release?

In this new proposal that was released, it is mentioned that the alloc library variant, which removed the possible generation of "panic" state on errors, updated to Rust version 1.62. Compared to the previous version, the Rust toolkit has stabilized support for the const_fn_trait_bound functionality used in kernel patches.

Besides it the bindings code is separated into a bundle of “bindings” boxes separately, which makes it easy to rebuild if only the main kernel package is changed.

The implementation of the "concat_idents!" macro, Rewritten as a procedural macro, not tied to the concat_idents functionality and allowing the use of local variable references.

In addition, it is mentioned that the macro "static_assert!" has been rewritten to allow "core::assert!()" is used in any context instead of constants, while the macro "construction_error!" has been adapted to work when setting "RUST_BUILD_ASSERT_{WARN,ALLOW}" mode for modules.

fs module added which provides links for working with file systems. An example of a simple file system written in Rust is proposed, as well as the job queue module added to work with system queues.

Of the other changes that stand out from this new proposal:

  • Added a separate configuration file "kernel/configs/rust.config".
  • The "*.i" files processed in macro substitutions have been renamed to "*.rsi".
  • Removed support for building Rust components with optimization levels other than those used for C code.
  • The development of the kasync module continued with the implementation of asynchronous programming methods (async).
  • Added an example of a kernel level TCP server written in Rust and added the ability to handle interrupts in Rust.
  • Added a procedure macro to make it easier to work with function pointer tables, such as the file_operations structure.
  • Added bidirectional linked list implementation "unsafe_list::List".
  • Added initial support for RCU and the Guard type to check if a read lock is bound to the current thread.
  • Added function Task::spawn() to automatically spawn and start kernel threads.
  • The Task::wake_up() method has also been added.
  • Added a delay module

Finally if you are interested in knowing more about it, you can check the details 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.