Developer(s) |
|
---|---|
Initial release | October 1, 2022 |
Repository | github |
Written in | Rust |
Operating system | Linux |
Available in | English |
License | GPL-2.0-only with Linux-syscall-note. |
Website | https://rust-for-linux.com/ |
Rust for Linux is an ongoing project started in 2020 to add Rust as a programming language that can be used within the Linux kernel software, which has been written using C and assembly only. This project aims to leverage Rust's memory safety to reduce bugs when writing kernel drivers. [1] Progress has been slower than hoped by both Rust advocates and Linus Torvalds, lead of the Linux kernel project. [2] In December 2023 the first drivers written in Rust were accepted, and released in version 6.8. [3] [4]
The Linux kernel has been primarily written in C and assembly languages since its first release in 1991. Around 1997, the addition of C++ was considered and experimented upon for two weeks before being scrapped. [5] Rust was created in 2006 and combines the performance of low-level programming languages (such as C) with a focus on memory safety and a user-friendly tool set and syntax. [6]
An example Linux external loadable kernel module created using the Rust language was published by Taesoo Kim in 2013. [7] [8]
The Rust for Linux project was announced in 2020 in the Linux kernel mailing list with goal of adding Rust as a programming language that could be used within the Linux project. [9] At the Open Source Summit 2022, Linus Torvalds stated that the incorporation of the project's work could begin as soon as the Linux 5.20 release, later named as Linux 6.0. [10] The first release candidate for Linux 6.0 was created on 14 August 2022, without Rust support. In the release notes for Linux 6.0-rc1, Torvalds expressed his intention for adding Rust support, "I actually was hoping that we'd get some of the first rust infrastructure, and the multi-gen LRU VM, but neither of them happened this time around." [11] [12] On 19 September 2022, an article from ZDNet revealed an email from Linus Torvalds stating that "Unless something odd happens, it [Rust] will make it into 6.1". [13]
In October 2022, a pull request for accepting the implementation for Rust for Linux was approved by Torvalds. [14] As of Linux 6.1, support was intentionally left minimal in order to allow developers to test the feature. [15]
Rust for Linux developers created a new library "pinned-init" to safely and fallibly initialize memory that must not be relocated. [3] It was first included in Linux 6.4, [16] and been improved in later versions. [3]
Linux 6.10 included RISCV processor architecture support for Rust. [17]
In July 2024 a change was accepted into Linux to support multiple Rust versions for the first time, allowing compiling using both 1.78 (Released 2 May, 2024) and 1.79 (Released 13 June, 2024). [18]
As of August 2024 [update] , Rust for Linux depends on unstable features of the Rust compiler. [1]
Linux kernel contains the following Rust components:
Drivers scheduled for inclusion in Linux kernel:
Other notable projects using Rust in Linux include:
MINIX is a Unix-like operating system based on a microkernel architecture. Since version 2.0, it has been POSIX compliant.
ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same principles as the Berkeley Fast File System from BSD, it was the first commercial-grade filesystem for Linux.
The Direct Rendering Manager (DRM) is a subsystem of the Linux kernel responsible for interfacing with GPUs of modern video cards. DRM exposes an API that user-space programs can use to send commands and data to the GPU and perform operations such as configuring the mode setting of the display. DRM was first developed as the kernel-space component of the X Server Direct Rendering Infrastructure, but since then it has been used by other graphic stack alternatives such as Wayland and standalone applications and libraries such as SDL2 and Kodi.
Mesa, also called Mesa3D and The Mesa 3D Graphics Library, is an open source implementation of OpenGL, Vulkan, and other graphics API specifications. Mesa translates these specifications to vendor-specific graphics hardware drivers.
A free and open-source graphics device driver is a software stack which controls computer-graphics hardware and supports graphics-rendering application programming interfaces (APIs) and is released under a free and open-source software license. Graphics device drivers are written for specific hardware to work within a specific operating system kernel and to support a range of APIs used by applications to access the graphics hardware. They may also control output to the display if the display driver is part of the graphics hardware. Most free and open-source graphics device drivers are developed by the Mesa project. The driver is made up of a compiler, a rendering API, and software which manages access to the graphics hardware.
A kernel is a component of a computer operating system. A comparison of system kernels can provide insight into the design and architectural choices made by the developers of particular operating systems.
exFAT is a file system introduced by Microsoft in 2006 and optimized for flash memory such as USB flash drives and SD cards. exFAT was proprietary until 28 August 2019, when Microsoft published its specification. Microsoft owns patents on several elements of its design.
nouveau is a free and open-source graphics device driver for Nvidia video cards and the Tegra family of SoCs written by independent software engineers, with minor help from Nvidia employees.
The criticism of Linux focuses on issues concerning use of operating systems which use the Linux kernel.
The Linux kernel is a free and open source, UNIX-like kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the kernel for the GNU operating system (OS) which was created to be a free replacement for Unix. Since the late 1990s, it has been included in many operating system distributions, many of which are called Linux. One such Linux kernel operating system is Android which is used in many mobile and embedded devices.
Mode setting is a software operation that activates a display mode for a computer's display controller by using VESA BIOS Extensions or UEFI Graphics extensions.
Criticism of desktop Linux is a history of comment on the perceived shortcomings of the Linux operating system when installed on desktop computers. These criticisms have been aimed at the plethora of issues and lack of consistency between Linux distributions, their usefulness and ease of use as desktop systems for general end users, driver support and issues with multi-media playback and audio development.
Lennart Poettering is a German software engineer working for Microsoft and the original author of PulseAudio, Avahi and systemd.
AMDgpu is an open source device driver for the Linux operating system developed by AMD to support its Radeon lineup of graphics cards (GPUs). It was announced in 2014 as the successor to the previous radeon
device driver as part of AMD's new "unified" driver strategy, and was released on April 20, 2015.
Zstandard is a lossless data compression algorithm developed by Yann Collet at Facebook. Zstd is the corresponding reference implementation in C, released as open-source software on 31 August 2016.
Bcachefs is a copy-on-write (COW) file system for Linux-based operating systems. Its primary developer, Kent Overstreet, first announced it in 2015, and it was added to the Linux kernel beginning with 6.7. It is intended to compete with the modern features of ZFS or Btrfs, and the speed and performance of ext4 or XFS.
EROFS is a lightweight read-only file system initially developed by Huawei, originally for the Linux kernel and now maintained by an open-source community from all over the world.
This article documents the version history of the Linux kernel.
Asahi Linux is a project that ports the Linux kernel and related software to Apple Silicon-powered Macs, started and led by Hector Martin. It does so by reverse-engineering the SoCs which lack documentation from Apple.
Shuah Khan is an American software engineer recognized for her contributions to the Linux kernel. In 2019, she became the first female Linux Foundation Fellow, joining notable figures such as Linus Torvalds and Greg Kroah-Hartman as the third fellow at the time.