A Linux-next kernelágba Rust nyelven írható illesztőprogramok fejlesztéséhez szükséges kód került beillesztésre.

A linux-next branch, which will form the basis for the Linux kernel release 5.13, includes an initial set of components for developing device drivers in Rust. Documentation on using Rust in the Linux kernel and an example kernel module with a character device driver in Rust have been published separately. The code was added by Stephen Rothwell, the maintainer of the linux-next branch. Typically, the linux-next branch includes code ready to be accepted in the next kernel change cycle, but it is still unclear whether support for Rust will be accepted by Linus Torvalds in the Linux 5.13 release, as the code has not been reviewed by a wide range of developers.

Support for developing Linux kernel drivers in Rust was actively discussed last year, including with Linus Torvalds, who did not rule out such a possibility. The idea was also supported by Greg Kroah-Hartman, who is responsible for maintaining the stable kernel branch. Using Rust for driver development will allow for the creation of safe and higher-quality drivers with minimal effort, free from issues such as accessing memory after it has been freed, dereferencing null pointers, and buffer overflows.

To enable Rust support in the linux-next branch, the CONFIG_RUST option ("Rust support" in the "General setup" menu) has been added to KConfig, which checks for the presence of the rustc compiler in the system when enabled and allows enabling other Rust-related components if it is present (for example, a "Rust hacking" section appears in the "Kernel hacking" menu). The use of Rust is considered an option, not active by default, and does not result in Rust being included as a mandatory build dependency for the kernel.

Building kernel components in Rust is possible both using GCC and when compiled with Clang. To use Rust in the kernel, recent nightly builds of the rustc compiler must be installed, no older than the nightly-2021-02-20 branch (there are plans to add support for stable Rust branches, but currently, it is tied to some experimental features). It is also necessary to have the standard Rust libraries available in the rust-src package and the bindgen binding generator. Support is currently limited to x86_64 and ARM64 platforms.

Forrás: opennet.ru

Megbízható hosting vásárlása weboldalak számára, DDoS védelemmel, VPS VDS szerverek. 🔥 Megbízható webtárhely vásárlása DDoS védelemmel, VPS VDS szerverek | ProHoster