|
|
Subscribe / Log in / New account

A first look at Rust in the 6.1 kernel

A first look at Rust in the 6.1 kernel

Posted Oct 16, 2022 7:43 UTC (Sun) by rsidd (subscriber, #2582)
Parent article: A first look at Rust in the 6.1 kernel

About that Apple graphics driver... here's the writer's (Asahi Lina's) tweet thread on her experience with using Rust. Sample quotes

it's way more useful than I could've ever imagined! I went from 1st render to a stable desktop that can run run games, browsers, etc. in about two days of work on my driver (!!!)
There is absolutely no way I wouldn't have run into race conditions, UAFs, memory leaks, and all kinds of badness if I'd been writing this in C.

In Rust? Just some logic bugs and some core memory management issues. Once those were fixed, the rest of the driver just worked!!

I actually spent more time tracking down a single forgotten `*` in the DCP driver (written in C by Alyssa and Janne, already tested) that was causing heap overflows than I spent tracking down CPU-side safety issues (in unsafe code) in Rust on my brand new driver, in total.
Also of note: she and Alyssa Rosenzweig used this Rust driver (and Alyssa's kernel driver) on an M1 Mac Mini that they used to present their talk at XDC2022.

So, while the mainline kernel part may be rudimentary, useful drivers seem already to be here, and more important, there are some who find the environment useful in developing drivers.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds