From nobody Wed Jan 14 13:59:39 2026 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4drnmW6hNpz6NRtb for ; Wed, 14 Jan 2026 13:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4drnmW4n6mz49Yx for ; Wed, 14 Jan 2026 13:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768399179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=upjuDXKwgnZdGnCiwW8pEUbkEaA6EbEx8OABtEDV3BY=; b=Yd2P04Uab/Fn/b5q05mEqmB0fS7/NHq7Wgecn1VDOGy0xqZjs5llftBH12PUe7pdbJ18ML uaP5G5LsSTfTrzy3pse84f7omTcR5z6TvGL+QDU5XA5foQhMY0SCG8wLRxu9ROsQ+7Fui9 VuGIZ1oIUv/oM56/XWNDj5qR6psXGbv6TeFdPcyud4XpaS4yirfRI6VaarNuAWJuSHbR2T Tw09oKFkB6356+EPMgxc4m0UgQuckMYOjeVUpDdsiZ0mdeDmEo3qJSAd+Vwc4dAYuxBsMn nbLS4K7KyFBZkkIM8PaoshNwObhtT7nh00JUxve8NsDAH5PKwr+EAFazMOPYrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768399179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=upjuDXKwgnZdGnCiwW8pEUbkEaA6EbEx8OABtEDV3BY=; b=TvZ2JlAFv2ERp9CmrF0PEdYytCuNa+7q6trsjVVSbOBWlYdTh7VqNp/g94ggvCq2XS/COR QJm+Dd6Cr4mNZzKncBL2OfHTWNxk+wP9oKu4ageBj3cn/I9BaXMrbGUjB4deiDiEVrsSp0 5NgFpIxqL3D2cAENCmsut62vIuks03wviNCPvTLcCpl1qXaMgZ3mmuRaOSsp6RjxYEru+X BwKK1MvL8jOzAAkrcZU1fyds0qj3Hxf7nBEmMY0nFKUnyXsDk3ms0qRHhqTSkDp5QzLOpZ tBwyEr4rm6ouCJcKh5jPaCxaXBeGXYYTYqToaFU48ckpKlTWPzCtWEW5JMxAuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768399179; a=rsa-sha256; cv=none; b=GxdZUMdfJRyF+2mUFNzf7xynYQh13ffGvqo6fHz3v5ueyB0PuCr1MLHdLCOI73MXcKBcXr erb46gT3L+hM9tuf8cVGfmt5Vixu18VcVbIfdFfbqRG+eZCxF2B2eGXO5fvOqqTHkAI+6z 61papqNskcXNk3+w/WtRfoqtNanEXMBaqinkWbwl9jcbX+P+RUEKnuH5+6MVireRSxqlR9 dLpJ2ABFqBXOPHMGZHr2mftRuq6S/NOv5O9jHAaJA4QjuLBeg8QdthtIa3w8FcJJruG5QG NDKAAYWtZ2PBeLHSWRbX6UVX7nZrxd3/PxkiFeLImYiYzBDzoR1gjNVg4YzjIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4drnmW4Kbrz11Ps for ; Wed, 14 Jan 2026 13:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46da3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 14 Jan 2026 13:59:39 +0000 To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org Cc: Ayrto=?utf-8?Q?n Mu=C3=B1o?=z From: Lorenzo Salvadore Subject: git: a27569e15a - main - Status/2025Q4/kernel_rust.adoc: Add report List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: salvadore X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a27569e15a1f400e2913829fb0cae2b98642cc1e Auto-Submitted: auto-generated Date: Wed, 14 Jan 2026 13:59:39 +0000 Message-Id: <6967a14b.46da3.26b5a189@gitrepo.freebsd.org> The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/doc/commit/?id=a27569e15a1f400e2913829fb0cae2b98642cc1e commit a27569e15a1f400e2913829fb0cae2b98642cc1e Author: Ayrton Muñoz AuthorDate: 2026-01-10 12:48:49 +0000 Commit: Lorenzo Salvadore CommitDate: 2026-01-14 13:59:18 +0000 Status/2025Q4/kernel_rust.adoc: Add report Differential Revision: https://reviews.freebsd.org/D54392 --- .../status/report-2025-10-2025-12/kernel_rust.adoc | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/website/content/en/status/report-2025-10-2025-12/kernel_rust.adoc b/website/content/en/status/report-2025-10-2025-12/kernel_rust.adoc new file mode 100644 index 0000000000..a186ad8831 --- /dev/null +++ b/website/content/en/status/report-2025-10-2025-12/kernel_rust.adoc @@ -0,0 +1,33 @@ +=== Kernel Rust Support + +Links: + +link:https://github.com/ayrtonm/freebsd-kpi-rs[rust KPI repository] URL: link:https://github.com/ayrtonm/freebsd-kpi-rs[] + +link:https://github.com/ayrtonm/freebsd-src/tree/virtio_snd[virtio sound rust driver] URL: link:https://github.com/ayrtonm/freebsd-src/tree/virtio_snd[] + +Contact: Ayrton Muñoz + +I have been adding support for using rust in the kernel and writing device drivers with it. +Rust is a good tool for taking existing rules about how pointers may be used and enforcing them with the type system. +These rules are often implicit in C meaning additional mental bookkeeping for developers. +Rust will not prevent every bug, but it lets developers avoid some of this and focus more on implementing the functionality they care about. + +The rust KPIs are currently under development and not very stable, but there is no dependency on the wider rust ecosystem or unstable language features/APIs. +This means that they should eventually be able to provide as much stability as equivalent C KPIs and upgrading to newer rust toolchains should not introduce breakage. +It also provides as much transparency as C about when allocations happen since it uses a non-allocating subset of the link:https://doc.rust-lang.org/core/[rust standard library]. +Different kernel subsystems will require rust wrappers, but these can build off of the base functionality provided in the rust KPI repository. + +I have been experimenting on and off with this since late 2024 and development mainly happens in my rust KPI repository. +This repository also has makefiles and patches for man:config[8]/build system integration. +The easiest driver for developers to build and try themselves is my link:https://github.com/ayrtonm/freebsd-src/tree/virtio_snd[virtio sound driver]. +Some interfaces it uses are in flux, but the driver is functional enough for music playback in link:https://www.qemu.org/docs/master/system/devices/virtio/virtio-snd.html[QEMU]. +That branch also includes rust wrappers that may be reused for other virtio devices or sound/PCM drivers. + +Only x86-64 and aarch64 are currently supported. +Other architectures supported by LLVM can be added if there is interest, but I wanted to initially focus on just a few use-cases. +Aside from QEMU I have also been testing rust drivers on hardware with some drivers for link:https://github.com/ayrtonm/freebsd-src/tree/apple[ARM64 Apple machines]. +This was the initial use-case and involves taking some WIP drivers I started helping with in 2024 and porting the greenfield parts to rust. +This is mostly low-level drivers, but also includes the DockChannel HID driver for the keyboard on the M2 MacBook. + +At some point in early 2026 the rust KPIs should be stable enough for interested developers to try writing new code with them. +They will not be perfect, but I want to make sure they work roughly like existing drivers expect and also fit the expectations of rust developers before asking for testers. +Hopefully the Apple drivers will be back up to parity with the initial WIP in C in the first half of 2026 as well.