This Month in Rust OSDev: July 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.
- simple-fatfs: A filesystem library aimed at embedded ecosystems
- Redox OS: Towards userspaceification of POSIX - part I: signal handling and IO
- Jeremy Soller on OS Development, Legacy Code, Redox OS and the Future of Memory-Safe Languages (Podcast Interview)
- Developing a cryptographically secure bootloader for RISC-V in Rust
Infrastructure and Tooling
In this section, we collect recent updates to rustc
, cargo
, and other tooling that are relevant to Rust OS development.
- Stabilize unsafe extern blocks (RFC 3484)
- Stabilize
offset_of_nested
- Add
#[must_use]
to someinto_raw*
functions - treat
&raw (const|mut) UNSAFE_STATIC
implied deref as safe - Add NuttX based targets for RISC-V and ARM
#[naked]
: report incompatible attributes- Fill out target-spec metadata for all targets
rust-osdev
Projects
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev
organization.
virtio-spec-rs
(new project!)
Maintained by @mkroening
The virtio-spec
crate provides definitions from the Virtual I/O Device (VIRTIO) specification.
This project aims to be unopinionated regarding actual VIRTIO drivers that are implemented on top of this crate.
The origins of this crate are in Hermit. Due to the need for correct foundational definitions from the Virtio spec that are easily reviewable and independent of the actual driver logic, this project was created from the ground up and without any intended bias towards Hermit.
Currently, definitions are available for split and packed virtqueues, for Virtio over MMIO and Virtio over PCI, and for the network, socket and file system devices. Feature requests for additional devices are more than welcome!
fuse-abi
(new project!)
Maintained by @mkroening
The fuse-abi
crate provides bindings to FUSE devices.
In motivation similar to that of virtio-spec
, this project aims to provide correct foundational definitions for the FUSE kernel ABI.
It can even be used together with virtio-spec
when creating a driver for the Virtio file system device.
This crate essentially brings #include <linux/fuse.h>
to Rust.
The code is autogenerated using bindgen
, ensuring the correctness of definitions.
uefi-rs
Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi-rs
crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:
- release: uefi-macros-0.14.0, uefi-raw-0.6.0, uefi-0.29.0
- book: Publish the latest release instead of main
- Add redirects for all the html files under HEAD
- Drop SystemTable arg from uefi::helpers::init
- uefi-macros: Allow zero-param function in the entry macro
- uefi: Fix return value lifetime for register_protocol_notify
- logger: Remove some unnecessary cfgs
- fix(deps): update rust crate syn to v2.0.70
- uefi: _print more failsafe
- mem: introduce traits MemoryMap and MemoryMapMut
- Add uefi::system module
- Add PcrEvent::new_in_box/PcrEventInputs::new_in_box
- Add uefi::runtime module
- runtime: Add freestanding functions to get/set/delete UEFI variables
- boot: Always impl Drop for MemoryMapBackingMemory
- test-runner: Drop the memory map OOM loop
- uefi-raw: Add more MemoryType constants
- Add variable key functions to
uefi::runtime
- uefi: mem: mem.rs -> mem/mod.rs
- runtime: Add query_variable_info
- Fix CI for Rust 1.80
- Add capsule update functions to
uefi::runtime
- Add uefi::boot module
- runtime: Add uefi::runtime::reset
- cleanup/follow-up: memory_map
- Move the global image handle to uefi::boot
- Add
boot::locate_handle_buffer
- boot: Add freestanding version of open_protocol
- boot: Add freestanding version of open_protocol_exclusive
- Finalize memory_map module refactoring
- Add
boot::{load_image, unload_image, start_image}
- clippy: add use_self and const fn
- clippy: streamline lints
- ci: reorganize nightly CI jobs
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 @00xc for their contributions!
uart_16550
Maintained by @phil-opp
The uart_16550
crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following change this month:
Thanks to @mkroening for their contributions!
endian-num
Maintained by @mkroening
The endian-num
crate provides the Be
(big-endian) and Le
(little-endian) byte-order-aware numeric types.
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:
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 PR this month:
- Ensure that Page actually implements Hash
- don't use label starting with
1
- Add size and len for PageRange, PhysFrameRange, PageRangeInclusive and PhysFrameRangeInclusive
- fix testing
Thanks to @Wasabi375 for their contribution!
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.
phip1611/bit_ops
(Section written by @phip1611)
I've recently created and published bit_ops
.
It offers common bit-oriented operations on primitive integer types with a focus on
no_std
and const
compatibility. Unlike other crates that provide tooling to
create sophisticated high-level types with bitfields, the focus of bit_ops
is
on raw primitive integer types.
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.