Linux内核更新加入Rust语言支持 并开始提供网络和异步功能

科技2年前 (2022)更新 cnBeta
933 0
网站公众号快速收录

在一个激动人心的周六早晨,Miguel Ojeda发布了最新的补丁系列,历史性地将Rust语言支持纳入Linux内核。"Rust for the
Linux
kernel"补丁现在已经到了第六个版本,它为这种第二种可选语言添加了必要的支撑,并继续添加更多的示例代码/基本功能,以展示这种注重内存安全的语言在内核中的应用。

与此同时,Rust for Linux的努力仍在继续,许多开发者和组织有兴趣看到在内核中开始使用Rust代码的能力,特别是在容易出现内存安全问题的领域。在今天发布的v6补丁中,工具链支持已经针对Rust 1.60进行了更新,支持在内核中运行文档测试,以及其他Rust基础设施的改进。

说到Rust代码在内核中的使用,在这个补丁系列中可以看到网络支持的开始。net"模块支持Namespace、SkBuff、Ipv4Addr、SocketAddrV4、TcpListener等类型。还有"async"开始支持异步的内核编程。目前的状态已经在为允许异步TCP套接字代码工作。新的Rust代码还增加了对网络包过滤器和其他新功能的支持。

从这个Rust for Linux v6系列来看,Rust支持仍然被认为是"实验性的",但表现已经足够好,如果需要的话,内核开发者可以开始为其他内核子系统开发Rust抽象,并将更多的驱动移植到Rust上。

更多关于Linux内核更新的Rust代码的细节,请看这个补丁系列:

https://lore.kernel.org/lkml/

目前Rust内核的努力达到了37.9万行代码,包括底层、到目前为止开始的子系统抽象、样本代码,以及将一些Android和GPIO驱动代码转换为Rust作为额外的例子。

At the same time, Rust for Linux’s efforts continue, and many developers and organizations are interested in seeing the ability to start using Rust code in the kernel, especially in areas prone to memory security problems. In today’s V6 patch, toolchain support has been updated for Rust 1.60 to run documentation tests in the kernel, as well as other Rust infrastructure improvements.

When it comes to the use of Rust code in the kernel, you can see the beginning of network support in this patch series. The net” module supports Namespace, SkBuff, Ipv4Addr, SocketAddrV4, TcpListener and other types. And & quot;async” began to support asynchronous kernel programming. The current state is already working to allow asynchronous TCP socket code. The new Rust code also adds support for network packet filters and other new features.

From the perspective of this Rust for Linux V6 series, Rust support is still considered quot; experimental & quot;, is good enough that kernel developers can start developing Rust abstractions for other kernel subsystems and porting more drivers to Rust if necessary.

For more details on the updated Rust code for the Linux kernel, take a look at this patch series:

https://lore.kernel.org/lkml/[email protected]/

The current Rust kernel effort has reached 379000 lines of code, including the underlying, subsystem abstractions that have started so far, sample code, and the conversion of some Android and GPIO driver code to Rust as additional examples.

© 版权声明

相关文章

网站公众号快速收录