This project is an attempt to reimplement the linux device driver samples from the book "Linux Device Drivers, 3rd Edition" (LDD3), originally written in C, in the Rust language.
Rust for Linux is an ongoing project to integrate Rust into the linux kernel. Abstractions are being developed to enable drivers written in Rust interface easily with the existing API's.
The code in this project is currently not on par with the reference sample, and should be updated as the relevant abstractions become available.
The repo consists of out-of-tree kernel modules which need to be built against a rust-enabled kernel (CONFIG_RUST=y). For more information, visit the kernel docs.
Minimum kernel version: 6.18.0
The following commands assume you have a full kernel source tree with rust configured.
Building the modules:
$ make LLVM=1 KDIR=/path/to/kernelTo enable rust-analyzer for IDE support:
$ make LLVM=1 KDIR=/path/to/kernel rust-analyzer