This Month in Rust OSDev: August 2023
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.
- Fomos: Experimental OS, built with Rust
- Interview with Rust and operating system Developer Andy Python
Redox Summer of Code
- Redox Summer of Code Wrapup
- VirtIO drivers for Redox in a VM - Andy-Python-Programmer: Part 1 and Part 2
- On-Demand Paging for Redox - 4lDO2: Part 1 and Part 2
- Using Linux drivers in a VM on Redox - Enygmator: Overview
Infrastructure and Tooling
In this section, we collect recent updates to rustc
, cargo
, and other tooling that are relevant to Rust OS development.
- WASI threads, implementation of `wasm32-wasi-preview1-threads`` target
- Re-enable atomic loads and stores for all RISC-V targets
- Update to LLVM 17
- feat:
riscv-interrupt-{m,s}
calling conventions - Add the
relocation_model
to the cfg - Default
relax_elf_relocations
to true - add
aarch64-unknown-teeos
target - cargo: Add support for
target.'cfg(..)'.linker
- cargo: Support dependencies from registries for artifact dependencies, take 2
rust-osdev
Projects
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev
organization.
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:
- Drop
memmove
andset_mem
from boot services - Add block I/O protocol to
uefi-raw
and use it inuefi
- uefi-raw: Rename BlockIo to BlockIoProtocol
- Add raw memory protection protocol and use in
uefi
- Use workspace.dependencies to declare shared dependencies
- Add component name protocol to uefi-raw and use from uefi
- Implement core::error::Error for all error types
- Fix 1.72 lints
- Derive
Debug
in more places (requires Rust 1.70) - Memory map change
Thanks to @cmoylan and @julic20s for their contributions!
bootloader
Maintained by @phil-opp
The bootloader
crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following PRs:
- kernel image fields & zero out rbp
RacyCell<T>
: Data race allowed on T- Update license field following SPDX 2.1 license expression standard
Thanks to @frisoft, @devsnek, and @kuzeyardabulut for their contributions!
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:
- Add
inline
attribute to segment functions - Add the
iretq
function to theInterruptStackFrameValue
struct. - Fix misc doc typos
Thanks to @tsoutsman, @NathanKolpa, and @xzmeng for their contributions!
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:
- AML:
DefSizeOf
implementation - AML: Fix
DefIfElse
parser returningUnexpectedEndOfStream
whenIf (...) {}
is not followed by anything
Thanks to @alnyan 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 @phip1611 for their contributions!
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.
mkroening/take-static
(Section written by @mkroening)
I published a tiny new crate, allowing you to get a mutable reference to static items safely (only once, though):
use take_static::take_static;
take_static! {
static NUMBER: usize = 5;
}
assert_eq!(NUMBER.take(), Some(&mut 5));
assert_eq!(NUMBER.take(), None);
This allows you to easily use statically allocated memory before dynamic memory allocators may be available.
Compared to cortex_m::singleton
, take_static
is thread-safe.
Compared to takecell::TakeCell
, take_static
also supports !Send
types.
hermit-os/kernel
(Section written by @mkroening)
The Hermit unikernel project allows you to bundle your Rust application with our library operating system to create a bootable unikernel image. Hermit is a single-address-space operating system. Since there is only one application running in the virtual machine, no isolation between applications or between user space and kernel space is necessary. This reduces system call overhead immensely, since every system call is just a library call. For more information, see our The Hermit Operating System showcase post.
The RustyHermit project has been renamed. We have renamed our GitHub organization from @hermitcore to @hermit-os and reserved the http://hermit-os.org domain.
We have also renamed some of our core projects to reduce confusion:
- hermit-os/kernel is the Hermit kernel.
- hermit-os/hermit-rs provides Rust application support.
- hermit-os/uhyve is a specialized hypervisor for Hermit.
- hermit-os/loader is a bootloader for other platforms, such as QEMU.
We have a new logo! As hermit crabs occupy empty shells produced by other organisms, the original HermitCore occupied one or several cores on a computer. Because we migrated to Rust in 2018, our new logo of a hermit crab occupying the Rust logo's bike gear fits quite nicely with the Rust logo as well as Rust's Ferris.
And as always, please come and try Hermit! :)
phil-opp/blog_os
(Section written by @phil-opp)
We merged the following changes to the Writing an OS in Rust blog this month:
- Update post 2 with beginner friendly cargo tips
- Grammar fix
- minimal-rust-kernel: fix missing .toml in zh-CN translation
Thanks to @Connortsui20 and @xzmeng for these contributions!
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.