|
| 1 | ++++ |
| 2 | +title = "This Month in Rust OSDev: January 2025" |
| 3 | +date = 2025-02-04 |
| 4 | + |
| 5 | +[extra] |
| 6 | +month = "January 2025" |
| 7 | +editors = ["phil-opp"] |
| 8 | ++++ |
| 9 | + |
| 10 | +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. |
| 11 | + |
| 12 | +<!-- more --> |
| 13 | + |
| 14 | +This series is openly developed [on GitHub](https://github.com/rust-osdev/homepage/). 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](https://github.com/rust-osdev/homepage/issues/new) or using our <a href="#comment-form">_comment form_</a> at the bottom of this page. |
| 15 | + |
| 16 | +<!-- |
| 17 | + This is a draft for the upcoming "This Month in Rust OSDev (January 2025)" post. |
| 18 | + Feel free to create pull requests against the `next` branch to add your |
| 19 | + content here. |
| 20 | + Please take a look at the past posts on https://rust-osdev.com/ to see the |
| 21 | + general structure of these posts. |
| 22 | +--> |
| 23 | + |
| 24 | +## Announcements, News, and Blog Posts |
| 25 | + |
| 26 | +Here we collect news, blog posts, etc. related to OS development in Rust. |
| 27 | + |
| 28 | +<!-- |
| 29 | +Please follow this template: |
| 30 | +
|
| 31 | +- [Title](https://example.com) |
| 32 | + - (optional) Some additional context |
| 33 | +--> |
| 34 | + |
| 35 | +- Podcast: [Rust in Production: Volvo Ships Memory-Safe ECUs in Production Cars](https://www.reddit.com/r/rust/comments/1i88zmb/rust_in_production_volvo_ships_memorysafe_ecus_in/) |
| 36 | +- [The VEKOS operating system is now able to execute programs](https://www.reddit.com/r/rust/comments/1ieetqt/the_vekos_operating_system_is_now_able_to_execute/) |
| 37 | +- Video: [Windows Kernel Programming with Rust - Matthias Heiden | EuroRust 2024](https://www.youtube.com/watch?v=NfBXDEgm6VY) |
| 38 | +- [Understanding the Microsoft Pluton security processor](https://techcommunity.microsoft.com/blog/windows-itpro-blog/understanding-the-microsoft-pluton-security-processor/4370413) (uses Rust and [TockOS](https://tockos.org/)) |
| 39 | +- Linux: [Resistance to Rust abstractions for DMA mapping](https://lwn.net/SubscriberLink/1006805/f75d238e25728afe/) |
| 40 | + |
| 41 | +## Infrastructure and Tooling |
| 42 | + |
| 43 | +In this section, we collect recent updates to `rustc`, `cargo`, and other tooling that are relevant to Rust OS development. |
| 44 | + |
| 45 | +- [Insert null checks for pointer dereferences when debug assertions are enabled](https://github.com/rust-lang/rust/pull/134424) |
| 46 | +- [Make missing_abi lint warn-by-default](https://github.com/rust-lang/rust/pull/132397) |
| 47 | +- [show linker output even if the linker succeeds](https://github.com/rust-lang/rust/pull/119286) |
| 48 | + |
| 49 | +<!-- |
| 50 | + Please use the following template: |
| 51 | +
|
| 52 | +- [Title](https://example.com) |
| 53 | + - (optional) Some additional context |
| 54 | +--> |
| 55 | + |
| 56 | + |
| 57 | +## `rust-osdev` Projects |
| 58 | + |
| 59 | +In this section, we give an overview of notable changes to the projects hosted under the [`rust-osdev`](https://github.com/rust-osdev/about) organization. |
| 60 | + |
| 61 | +<!-- |
| 62 | + Please use the following template: |
| 63 | +
|
| 64 | + ### [`repo_name`](https://github.com/rust-osdev/repo_name) |
| 65 | + <span class="maintainers">Maintained by [@maintainer_1](https://github.com/maintainer_1)</span> |
| 66 | +
|
| 67 | + The `repo_name` crate ...<<short introduction>>... |
| 68 | +
|
| 69 | + We merged the following changes this month: |
| 70 | + <<changelog, either in list or text form>> |
| 71 | +--> |
| 72 | + |
| 73 | +### [`uefi-rs`](https://github.com/rust-osdev/uefi-rs) |
| 74 | +<span class="maintainers">Maintained by [@GabrielMajeri](https://github.com/GabrielMajeri), [@nicholasbishop](https://github.com/nicholasbishop), and [@phip1611](https://github.com/phip1611)</span> |
| 75 | + |
| 76 | +`uefi` makes it easy to develop Rust software that leverages safe, convenient, |
| 77 | +and performant abstractions for UEFI functionality. |
| 78 | + |
| 79 | +We merged the following PRs this month: |
| 80 | + |
| 81 | +- [uefi-raw: Add FirmwareVolume{,Block}2Protocol](https://github.com/rust-osdev/uefi-rs/pull/1503) |
| 82 | +- [uefi-raw: hii: Add Database Protocol](https://github.com/rust-osdev/uefi-rs/pull/1510) |
| 83 | +- [uefi-raw: Add ScsiIoProtocol](https://github.com/rust-osdev/uefi-rs/pull/1517) |
| 84 | +- [Add missing type/subtype checks to `TryFrom<&DevicePathNode>`](https://github.com/rust-osdev/uefi-rs/pull/1516) |
| 85 | +- [uefi-raw: Add common impls for http types](https://github.com/rust-osdev/uefi-rs/pull/1518) |
| 86 | +- [relicensing: Rewrite allocator, configuration table, and image unload PRs](https://github.com/rust-osdev/uefi-rs/pull/1523) |
| 87 | +- [relicensing: Rewrite set_timer PR](https://github.com/rust-osdev/uefi-rs/pull/1524) |
| 88 | +- [Fix memory leaks in DevicePathFromText](https://github.com/rust-osdev/uefi-rs/pull/1525) |
| 89 | +- [Add warning to custom memory types](https://github.com/rust-osdev/uefi-rs/pull/1526) |
| 90 | +- [test-runner: Clean up device path tests](https://github.com/rust-osdev/uefi-rs/pull/1527) |
| 91 | + |
| 92 | +<!-- - [chore(deps): update crate-ci/typos action to v1.29.4](https://github.com/rust-osdev/uefi-rs/pull/1512) --> |
| 93 | +<!-- - [chore(deps): lock file maintenance](https://github.com/rust-osdev/uefi-rs/pull/1515) --> |
| 94 | +<!-- - [fix(deps): update rust crate itertools to 0.14.0](https://github.com/rust-osdev/uefi-rs/pull/1513) --> |
| 95 | +<!-- - [chore(deps): lock file maintenance](https://github.com/rust-osdev/uefi-rs/pull/1522) --> |
| 96 | +<!-- - [chore(deps): lock file maintenance](https://github.com/rust-osdev/uefi-rs/pull/1530) --> |
| 97 | + |
| 98 | +Thanks to [@crawfxrd](https://github.com/crawfxrd) and [@hannahfluch](https://github.com/hannahfluch) for their contributions! |
| 99 | + |
| 100 | + |
| 101 | +### [`bootloader`](https://github.com/rust-osdev/bootloader) |
| 102 | +<span class="maintainers">Maintained by [@phil-opp](https://github.com/phil-opp) and [@Freax13](https://github.com/orgs/rust-osdev/people/Freax13)</span> |
| 103 | + |
| 104 | +The `bootloader` crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements: |
| 105 | + |
| 106 | +- [use threads instead of futures in build.rs](https://github.com/rust-osdev/bootloader/pull/484) |
| 107 | +- [Move test kernels to a separate workspace](https://github.com/rust-osdev/bootloader/pull/486) |
| 108 | +- [fix condition for running bootloader common tests](https://github.com/rust-osdev/bootloader/pull/487) |
| 109 | + |
| 110 | +### [`x86_64`](https://github.com/rust-osdev/x86_64) |
| 111 | +<span class="maintainers">Maintained by [@phil-opp](https://github.com/phil-opp), [@josephlr](https://github.com/orgs/rust-osdev/people/josephlr), and [@Freax13](https://github.com/orgs/rust-osdev/people/Freax13)</span> |
| 112 | + |
| 113 | +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. |
| 114 | + |
| 115 | +We merged the following PRs this month: |
| 116 | + |
| 117 | +- [fix warnings & remove broken CI job](https://github.com/rust-osdev/x86_64/pull/530) |
| 118 | +- [Add page attribute table support](https://github.com/rust-osdev/x86_64/pull/529) |
| 119 | +- [use default python again](https://github.com/rust-osdev/x86_64/pull/533) |
| 120 | +- [feat(msr): add IA32_APIC_BASE support](https://github.com/rust-osdev/x86_64/pull/532) |
| 121 | + |
| 122 | +Thanks to [@hannahfluch](https://github.com/hannahfluch) and [@adavis628](https://github.com/adavis628) for their contributions! |
| 123 | + |
| 124 | + |
| 125 | +### [`acpi`](https://github.com/rust-osdev/acpi) |
| 126 | +<span class="maintainers">Maintained by [@IsaacWoods](https://github.com/IsaacWoods)</span> |
| 127 | + |
| 128 | +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: |
| 129 | + |
| 130 | +- [acpi: Remove Clone Copy traits for MADT](https://github.com/rust-osdev/acpi/pull/238) |
| 131 | +- [acpi: Clone impl for PlatformInfo and ManagedSlice](https://github.com/rust-osdev/acpi/pull/239) |
| 132 | +- [aml: fix clippy warnings and run clippy in CI](https://github.com/rust-osdev/acpi/pull/237) |
| 133 | +- [Fix unsoundness in our representation of the MADT](https://github.com/rust-osdev/acpi/pull/223) |
| 134 | + |
| 135 | +Thanks to [@IsaacWoods](https://github.com/IsaacWoods), [@mrjbom](https://github.com/mrjbom), and [@00xc](https://github.com/00xc) for their contributions! |
| 136 | + |
| 137 | + |
| 138 | +### [`multiboot2`](https://github.com/rust-osdev/multiboot2) |
| 139 | +<span class="maintainers">Maintained by [@phip1611](https://github.com/phip1611)</span> |
| 140 | + |
| 141 | +_Convenient and safe parsing of Multiboot2 Boot Information (MBI) structures and |
| 142 | +the contained information tags. Usable in no_std environments, such as a kernel. |
| 143 | +An optional builder feature also allows the construction of the corresponding |
| 144 | +structures._ |
| 145 | + |
| 146 | +We merged the following PRs this month: |
| 147 | + |
| 148 | +- [fix: typos](https://github.com/rust-osdev/multiboot2/pull/253) |
| 149 | +- [misc improvements](https://github.com/rust-osdev/multiboot2/pull/254) |
| 150 | + |
| 151 | +<!-- - [build(deps): bump crate-ci/typos from 1.28.1 to 1.29.0](https://github.com/rust-osdev/multiboot2/pull/252) |
| 152 | +- [build(deps): bump bitflags from 2.6.0 to 2.7.0](https://github.com/rust-osdev/multiboot2/pull/255) |
| 153 | +- [build(deps): bump bitflags from 2.7.0 to 2.8.0](https://github.com/rust-osdev/multiboot2/pull/256) |
| 154 | +- [build(deps): bump crate-ci/typos from 1.29.0 to 1.29.4](https://github.com/rust-osdev/multiboot2/pull/257) --> |
| 155 | + |
| 156 | +## Other Projects |
| 157 | + |
| 158 | +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](https://github.com/rust-osdev/homepage/pulls) with the updates of your OS project for the next post. |
| 159 | + |
| 160 | +<!-- |
| 161 | + Please use the following template: |
| 162 | +
|
| 163 | + ### [`owner_name/repo_name`](https://github.com/rust-osdev/owner_name/repo_name) |
| 164 | + <span class="maintainers">(Section written by [@your_github_name](https://github.com/your_github_name))</span> |
| 165 | +
|
| 166 | + ...<<your project updates>>... |
| 167 | +--> |
| 168 | + |
| 169 | +### [`roeeshoshani/genesis`](https://github.com/roeeshoshani/genesis) |
| 170 | +<span class="maintainers">(Section written by [@roeeshoshani](https://github.com/roeeshoshani))</span> |
| 171 | + |
| 172 | +`genesis` is a bare metal firmware implementation for mips. it implements everything from the bottom up, from |
| 173 | +initializing the cpu caches, to configuring pci devices and the interrupt controller. |
| 174 | + |
| 175 | +this month, the core async executor was implemented. |
| 176 | + |
| 177 | +this means that we can implement blocking operations (for example reading a byte from the UART) as rust futures, and we then |
| 178 | +`.await` them. |
| 179 | + |
| 180 | +this makes our lives much easier when writing code that needs to block until some I/O events happen. instead of using callbacks, |
| 181 | +and having to pass our state all over the place, we can just `.await` the blocking future, and write our code using async functions, |
| 182 | +which is much more ergonomic. |
| 183 | + |
| 184 | +##### example |
| 185 | + |
| 186 | +currently, there is only one blocking operation implemented, the operation of reading a byte from the UART. |
| 187 | + |
| 188 | +this allows code like the following to be written: |
| 189 | +```rust |
| 190 | +loop { |
| 191 | + let byte = uart_read_byte().await; |
| 192 | + println!("received uart byte: {}", byte); |
| 193 | +} |
| 194 | +``` |
| 195 | + |
| 196 | +which is a huge improvement over the previous implementation of putting the code inside the UART interrupt handler. |
| 197 | + |
| 198 | +##### how does it work? |
| 199 | + |
| 200 | +the way this works is that the core kernel's main loop looks roughly like the following: |
| 201 | +```rust |
| 202 | +loop { |
| 203 | + poll_tasks(); |
| 204 | + wait_for_interrupt(); |
| 205 | +} |
| 206 | +``` |
| 207 | + |
| 208 | +then, the interrupt handler is responsible for waking up the relevant tasks. |
| 209 | + |
| 210 | +futures that need interrupt handlers to wake them up should somehow register themselves, and the interrupt hanlers will then |
| 211 | +wake the registered tasks. |
| 212 | + |
| 213 | +then, in the next iteration, the tasks that were woken up will be polled again, which completes the loop. |
| 214 | + |
| 215 | + |
| 216 | +## Join Us? |
| 217 | + |
| 218 | +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](https://rust-osdev.zulipchat.com). |
0 commit comments