🌐
GitHub
github.com › d0u9 › Linux-Device-Driver-Rust
GitHub - d0u9/Linux-Device-Driver-Rust: A try to follow the rust port in Linux kernel in driver development. · GitHub
A try to follow the rust port in Linux kernel in driver development. - d0u9/Linux-Device-Driver-Rust
Starred by 105 users
Forked by 12 users
Languages   Rust 62.7% | Makefile 37.3%
🌐
Reddit
reddit.com › r/rust › linux kernel driver development in rust: examples and best practices
r/rust on Reddit: Linux kernel driver development in Rust: examples and best practices
October 1, 2023 -

Tehuti Networks, company manufacturing the Tehuti TN40xx chipset (for Promise SANLink3 T1, and other Thunderbolt 10GbE network adapters) went out of business, resulting in no further driver development. There is work on a Linux driver (see github tn40xx) and it has not been upstreamed to Linux kernel yet. I have come across multiple such user-run initiatives to support legacy hardware (or in this case: not legacy, but vendor going out of business).

Since there was a lot of media attention about Rust for Linux recently, I wanted to ask a few questions in regards to driver development, and understand how to go about developing and scoping for a project

  • Can anyone elaborate on the status on Rust for Linux, and what is missing at this point to implement the first Rust based driver (Asahi Lina was working on something, but there are possibly some blockers )

  • Would the Tehuti TN4010 driver be suitable for Rust kernel development? (Please elaborate if you think it is not)?

  • How would one go about planning and estimation of such a project? In the case of the Tehuti TN40xx driver (but also more generally) there would be c and cpp codebase to start off from. Working with FFI a good idea in these cases?

  • Are there any best-practices? (here is the link to another thread on r/rust, discussing a tutorial how to create a linux kernel module using rust; any other good pointers?)

🌐
Reddit
reddit.com › r/rust › writing a basic linux device driver when you know nothing about linux drivers or usb
r/rust on Reddit: Writing a basic Linux device driver when you know nothing about Linux drivers or USB
June 21, 2025 - We could write a kernel driver that follows the kernel standard and exposes each individual LED as 3 devices (one per color) under /sys/class/leds.
🌐
GitHub
github.com › CriMilanese › scull_device_driver
GitHub - CriMilanese/scull_device_driver: a rust implementation of the linux null block device driver · GitHub
a rust implementation of the linux null block device driver - CriMilanese/scull_device_driver
Author   CriMilanese
🌐
GitHub
github.com › lizhuohua › linux-kernel-module-rust
GitHub - lizhuohua/linux-kernel-module-rust
January 14, 2024 - A simple sysctl device driver. $ sudo insmod simple_sysctl.ko $ cat /proc/sys/rust/example/test # the default value should be 1 $ sudo sh -c "echo 2 > /proc/sys/rust/example/test" # change the value $ cat /proc/sys/rust/example/test # now the value is 2 $ sudo rmmod simple_sysctl
Starred by 629 users
Forked by 26 users
Languages   Rust 80.9% | Makefile 14.7% | C 4.4% | Rust 80.9% | Makefile 14.7% | C 4.4%
🌐
Rust-drive
rust-drive.org
Linux device drivers in Rust
This is the top level of the device drivers development with Rust programming language. For now topics are very much a work in progress, and we are continue to adding a new one or extening already available.
🌐
InfoQ
infoq.com › news › 2021 › 04 › rust-linux-kernel-development
Using Rust to Write Safe and Correct Linux Kernel Drivers - InfoQ
April 27, 2021 - Rust also makes it safer to manage shared per-device state, again using a non-mutable reference to a device-specific trait that is passed around to all objects associated to that device. Almeida Filho also discusses a number of benefits developers can get from Rust when implementing a custom ioctl handler, specifically through the use of a dispatcher to automatically create memory access helpers that will prevent typical errors when dealing with low-level memory, such as buffer overflow, read/write mixing, and so on. Those are just a few examples. To prove Rust advantage when writing Linux drivers, the Android team is working on porting the Binder IPC driver, which is used for inter-process communication (IPC) on Android and was accepted in 2015 in the Linux kernel, to Rust, which is already in good shape.
🌐
Apriorit
apriorit.com › home › blog › software development blog › linux driver development with rust: benefits, challenges, and a practical example
Linux Driver Development with Rust - Apriorit
June 24, 2025 - ... Until support for Rust was added in 2022, C was the only language allowed for Linux driver development. Building a Linux driver in C involves integrating custom code into the kernel.
🌐
Hackaday
hackaday.com › 2025 › 06 › 26 › rust-drives-a-linux-usb-device
Rust Drives A Linux USB Device | Hackaday
June 26, 2025 - The Rust program is fairly straightforward once you have the preliminaries out of the way. The libusb library helps a lot. By the end, the code kicks off some threads, handles interrupts, and does other device-driver-like things.
Find elsewhere
🌐
Rust for Linux
rust-for-linux.com › nvme-driver
NVMe Driver - Rust for Linux
The Rust NVMe driver is an effort to implement a PCI NVMe driver in safe Rust for use in the Linux Kernel. The purpose of the driver is to provide a vehicle for development of safe Rust abstractions and to prove feasibility of Rust as an ...
🌐
Rust-for-linux
rust-for-linux.github.io › docs › kernel › driver
kernel::driver - Rust
A kernel module that only registers the given driver on init. ... The registration of a driver. ... Custom code within device removal. ... A subsystem (e.g., PCI, Platform, Amba, etc.) that allows drivers to be written for it. ... Conversion from a device id to a raw device id. This documentation is an old archive. Please see https://rust...
🌐
Rustmagazine
rustmagazine.org › issue-1 › rust-for-linux-brief-introduction
Rust for Linux Brief Introduction - Rust Magazine
January 30, 2023 - Though r4l contains some drivers, they are demos for teaching Rust driver development. Here we list the main components of the r4l project: Bindings of kernel functions and data structures, which are automatic generated. Memory management module. High level abstraction of data structures and interfaces. Macro definition. Sample code. ... It’s time to get our hands dirty. Let’s write a Rust kernel module and analyze it. You can download the Linux kernel code from torvalds/linux, usually it’s a git clone.
🌐
crates.io
crates.io › crates › device-driver
device-driver - crates.io: Rust Package Registry
Log in with GitHub · A toolkit ... pkg:cargo/device-driver@1.0.7 · Run the following Cargo command in your project directory: cargo add device-driver ·...
🌐
Hana Water Blog
hanawaterbury.com › home › online learning & degrees › rust drives a linux usb device
Rust USB on Linux: Drive Devices with Safe, Fast Code
February 27, 2026 - A robust Rust client typically: uses a retry loop that re-enumerates devices if a transfer fails with “no device,” · keeps state machines explicit (Connected → Initialized → Streaming), separates transport errors (USB) from protocol errors (your framing/checksum), logs enough context to debug without needing psychic powers. In kernel space, a USB driver registers with the Linux USB subsystem, declares which VID/PID (or classes) it supports, and implements callbacksmost notably probe() and disconnect()that run when the device is plugged in or removed.
🌐
Quora
quora.com › What-is-a-learning-roadmap-to-writing-Linux-device-drivers-step-by-step-in-C-C-or-Rust-Is-Rust-taking-over-writing-device-drivers-over-C-C
What is a learning roadmap to writing Linux device drivers step by step in C/C++ or Rust? Is Rust taking over writing device drivers over C/ C++? - Quora
Answer (1 of 4): If you write kernel device drivers for Linux, you write them in C, assembly language, or a combination of the two. You do not write them in Rust: They will not be accepted back into the source tree. You do not write them in C++: They will not be accepted back into the source tr...
🌐
O'Reilly
oreilly.com › library › view › rust-programming-cookbook › 9781789530667 › e44d0cad-9fad-4416-b2ee-feb1ae8b1204.xhtml
Creating I2C device drivers - Rust Programming Cookbook [Book]
October 18, 2019 - This is where the I2C ... can write to and read from. Using Rust, we can use this interface to create a driver for a sensor device that is connected to that bus....
Author   Claus Matzinger
Published   2019
Pages   444
🌐
GitHub
github.com › Rhernandez513 › linux-driver-in-rust
GitHub - Rhernandez513/linux-driver-in-rust: Re-Implementing a simple Linux Kernel Driver in Rust · GitHub
Download the fork of linux from Rust-for-Linux: git clone --depth=1 https://github.com/Rust-for-Linux/linux.git · Install clang, llvm and lld: sudo apt install clang llvm lld · Install Rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh · Update the path with source ~/.cargo/env or source $HOME/.cargo/env · Set the required rust version used for the current kernel with rustup override set $(scripts/min-tool-version.sh rustc)
Author   Rhernandez513
🌐
Phoronix
phoronix.com › news › Linux-6.8-Rust-PHY-Driver
The First Rust-Written Network PHY Driver Set To Land In Linux 6.8 - Phoronix
December 17, 2023 - With the upcoming Linux 6.8 kernel cycle, the first Rust network driver is set to be introduced. Merged this week to net-next.git ahead of Linux 6.8 is landing the "net-phy-rust" branch. This features Rust abstractions necessary for network PHY drivers. There are Rust bindings for the phylib code and other bits needed to enable PHY drivers written in Rust.
🌐
LWN.net
lwn.net › Articles › 907685
A pair of Rust kernel modules [LWN.net]
He concluded by saying that the Rust NVMe driver is still "a playground" and not production-ready at this point. To move things forward, he would like to create more abstractions that would allow the removal of the remaining unsafe blocks in the driver. It doesn't yet support device removal ...