Ubuntu Talks Up Rust Kernel Programming Potential With Ubuntu 23.04

Written by Michael Larabel in Ubuntu on 5 April 2023 at 08:00 AM EDT. 25 Comments
UBUNTU
Ubuntu 23.04 is being talked up for how it can aide developers that want to begin programming with Rust code for Linux kernel modules. It's possible to get started with Rust kernel development on Ubuntu 23.04 thanks to its generic kernel having the necessary kernel configuration, but ultimately it's still in an early state and there isn't much to do with the stock kernel.

Ubuntu 23.04 is shipping this month with the Linux 6.2 kernel as a nice upgrade over 5.19 used by Ubuntu 22.10 and 22.0.4.2 LTS with its HWE stack. The initial Rust programming support for the Linux kernel was added to upstream in Linux 6.1.

Thus with Ubuntu 23.04, Rust support in the kernel is now available -- including with the necessary Rust configuration bits that Canonical has gone ahead and enabled in their stock "generic" Linux kernel image for Ubuntu 23.04.

Ubuntu Rust kernel support


Published today by Canonical engineer Andrea Righi is a how-to guide for getting "Rusty" in Lunar with their Rust kernel support. Admittedly, the Rust kernel state in Linux 6.2 is quite basic and the guide just walks through creating a Rust module to print the classic "hello world" output.

Ubuntu Rust kernel toy module


The how-to guide concludes with, "Ubuntu can now be used by all the developers that want to easily and quickly begin to familiarize themselves with kernel programming in Rust, without dealing with external software/packages and simply using the standard Ubuntu kernel and toolchain."

While, yes, that's true and their Linux 6.2 kernel build in Ubuntu 23.04 does allow for Rust kernel modules, those wanting to get serious about Rust kernel work are better off tracking Linux 6.3 or the Rust "-next" code... Linux 6.3 stable will be out right around the same time as Ubuntu 23.04's release at the end of month. But per usual Ubuntu policy, Ubuntu 23.04 won't see any stable release updates past Linux 6.2 as their supported kernel option.

Linux 6.3 has more Rust infrastructure and other ongoing Rust subsystem abstractions and the like remain ongoing, some of which may land for Linux 6.4 while most of the developers working on Rust modules aiming for mainline are rightfully following the "-next" code. So, yes, you can write toy "hello world" modules with Ubuntu 23.04's Linux 6.2 kernel but for those wanting to do more with this memory-safe programming language for the kernel will want/need to be rolling their own newer kernel.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week