This Month in Rust OSDev: April 2024
Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.
This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.
Announcements, News, and Blog Posts
Here we collect news, blog posts, etc. related to OS development in Rust.
- Testing Virtualization Stacks by Utilizing Mini Operating System Kernels
Multiple mini OS kernels help Cyberus Technology to investigate issues related to complicated problems in virtualization stacks, such as never delivered interrupts. Although the Cyberus Guest Tests are written in C++, they help to find issues and problems in Cloud-Hypervisor, a VMM written in Rust. For better debugging capabilities of the Guest Tests, Cyberus Technology upstreamed support for the Debug Console to Cloud Hypervisor, which is present sincev38
. The source code of the Guest Tests is on GitHub. - Redox OS - April 2024 Report
- Giving Rust a chance for in-kernel codecs
- Video: From C to Rust: Bringing Rust Abstractions to Embedded Linux
- The Embedded Rustacean Issue #17 and Issue #18
- Rust-Written LAVD Kernel Scheduler Shows Promising Results For Linux Gaming
- Video: LinuxFest Northwest 2024: Meet COSMIC DE
- New
offset-allocator
crate, providing a fast, simple, hard real time allocator- not
no_std
yet, but should be easy to port (only requires aVec
-like type)
- not
- Making an RISC-V OS (Part 3): Managing free memory
- Asterinas: a secure, fast, and general-purpose OS kernel written in Rust and compatible with Linux
Infrastructure and Tooling
In this section, we collect recent updates to rustc
, cargo
, and other tooling that are relevant to Rust OS development.
f16
andf128
step 4: basic library support- Stabilise
inline_const
- Introduce perma-unstable
wasm-c-abi
flag - Stabilize
(const_)slice_ptr_len
and(const_)slice_ptr_is_empty_nonnull
- Add
aarch64-apple-visionos
andaarch64-apple-visionos-sim
tier 3 targets
rust-osdev
Projects
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev
organization.
volatile
Maintained by @phil-opp
The volatile
crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers.
We merged the following PRs this month:
- Add
VolatileRef::restrict
andVolatilePtr::restrict
- Add
VolatileRef::borrow
andVolatileRef::borrow_mut
- docs: remove unused
NonNull
imports - Add support for nested
map_field
operations - Add
#[derive(VolatileFieldAccess)]
for easy, access-limited field-based access to structs - fix(Cargo.toml): add categories
- ci: migrate away from unmaintained actions
- Enable all features and
doc_auto_cfg
on docs.rs - Release v0.5.3
- Fix warnings and deny warnings in CI
- fix(macro): support
#[repr(align(N))]
- fix(access): properly seal access traits
- Release v0.5.4
- Add a semver checks CI job
- feat: introduce
RestrictAccess<To>
and generalizerestrict
to all access types - feat: implement derive macro for all access types
- fix: add
#[must_use]
to volatile types,read
, andas_raw_ptr
Thanks to @mkroening for their contributions!
uefi-rs
Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi-rs
crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
Recently, we deprecated the [uefi-services
] crate and removed all usages from
the uefi
repository. A new drop-in
replacement exists in uefi::helpers
.
The test of time showed us that having a single crate with multiple cargo features is a better and more productive way forward with less maintenance burden - for users/consumers as well as maintainers.
Please find more information in:
We merged the following PRs this month:
- Add timestamp protocol
- Replace some
as
casts - uefi: Add UnalignedSlice::as_ptr
- Add device path text protocols to uefi-raw and re-use in uefi
- uefi-services: Fix warning with
--no-default-features
- uefi: Add more derives for Handle and Event
- misc: nix/niv updates and typo updates
- doc: update fs documentation
- doc: update README
- Deprecate
uefi-services
and adduefi::helpers
as replacement - Fix some warnings, and ensure CI catches them in the future
- release: uefi-raw-0.5.2, uefi-0.28.0, uefi-services-0.25.0
- build(deps): bump rustls from 0.22.2 to 0.22.4
- Nuke uefi services from repository
- [Misc] Add ResetNotification protocol. Add Misc to uefi-test-runner.
- Minor import/export cleanups
- uefi: Drop the panic-on-logger-errors feature
- Replace
cstr16!
with a declarative macro - Replace
cstr8!
with a declarative macro - Remove xtask from MSRV build and update clap
Thanks to @sky5454 for their contributions!
ucs2-rs
Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611
acpi
Maintained by @IsaacWoods
The acpi
repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:
Thanks to @rw-vanc for their contribution!
x86_64
Maintained by @phil-opp, @josephlr, and @Freax13
The x86_64
crate provides various abstractions for x86_64
systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.
We merged the following PRs this month:
- docs: fix and detect warnings
- docs: add aliases for
in{,b,w,l}
andout{,b,w,l}
- ci: migrate away from unmaintained actions
- chore: migrate from legacy
rust-toolchain
torust-toolchain.toml
- test: replace
x86_64-bare-metal.json
withx86_64-unknown-none
- fix and detect warnings
- CI: Set
-Crelocation-model=static
inRUSTFLAGS
for bootloader test job - silence warning about cast
- Only enable instructions on
x86_64
Thanks to @mkroening for their contributions!
bootloader
Maintained by @phil-opp and @Freax13
The bootloader
crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
- CI: Fix macOS errors
- [v0.9] Silence dead code warning
- [v0.9] Rename
.cargo/config
to.cargo/config.toml
multiboot2
Maintained by @phip1611
The multiboot2
crate provides abstraction types for the multiboot information structure (MBI) of multiboot2 bootloaders. We merged the following changes this month:
Other Projects
In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev
organization. Feel free to create a pull request with the updates of your OS project for the next post.
RatCornu/efs
efs
is a recently published no-std
library which provides an OS and architecture independent implementation of some UNIX filesystems in Rust.
Currently only the ext2 filesystem is directly implemented, but I will soonly work on other filesystems!
It's still young so it may contain bugs, but it's hugely tested so that it does not happen.
Some of the features provided :
no_std
support (enabled by default)- General interface for UNIX files and filesystems
read/write
regular files- retrieve, add and remove directory entries directly from a path and a current working directory.
I hope you will find this useful! If you have any remark, idea or issue, do not hesitate to submit an issue!
phip1611/tar-no-std
tar-no-std
supports a relevant
subset of Tar archives to extract multiple files from a single Tar archive in
no_std
environments with zero allocations. Recently, v0.3.0
was released
with support for filenames with up to 256 characters (including the directory
path) and various bug fixes. Using fuzzing, a lot of pitfalls and sudden panics
could be removed in this release.
Join Us?
Are you interested in Rust-based operating system development? Our rust-osdev
organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.