|
|
Subscribe / Log in / New account

Using Rust for kernel development

Using Rust for kernel development

Posted Sep 28, 2021 21:57 UTC (Tue) by rahulsundaram (subscriber, #21946)
In reply to: Using Rust for kernel development by lwnli
Parent article: Using Rust for kernel development

> If drivers are encouraged to be implemented in user space, what benefit does writing drivers in Rust bring about?

The article doesn't talk about user space drivers. Where are you getting that from?


to post comments

Using Rust for kernel development

Posted Sep 29, 2021 21:42 UTC (Wed) by lwnli (guest, #141318) [Link] (2 responses)

read somewhere else. wonder if writing it in user space gives the same benefit as writing it in Rust.

Using Rust for kernel development

Posted Sep 30, 2021 0:03 UTC (Thu) by mpr22 (subscriber, #60784) [Link] (1 responses)

Writing in Rust turns many kinds of memory safety violation into compile-time errors, meaning that you have to fix them before you can start testing the code.

Running in user-space turns some subset of memory safety violations, which partially overlap with those that Rust turns into compile-time errors, into SIGSEGVs instead of kernel data structure corruption.

Using Rust for kernel development

Posted Sep 30, 2021 0:06 UTC (Thu) by mpr22 (subscriber, #60784) [Link]

(And, of course, it turns the rest into process-local data structure corruption. Which could still be disastrous when the program has control of a DMA-capable peripheral device and your IOMMU capabilities are insufficient...)


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