Browse by type
[!NOTE] This repository is currently in a transitional state: the components under
ostd/src/sync,ostd/libs/id-alloc,ostd/src/io/io_portandostd/src/boot/memory_region.rstrack Asterinas v0.19.0, while every other OSTD component is still based on v0.16.0.
The vostd project provides a formally-verified version of OSTD, the (unofficial) standard library for OS development in safe Rust. OSTD encapsulates low-level hardware interactions—which require unsafe Rust—into a small set of high-level, safe abstractions, enabling complex, general-purpose OSes like Asterinas to be written entirely in safe Rust. By design, OSTD guarantees soundness: no undefined behavior is possible regardless of how its API is used. The goal of vostd is to bolster this soundness through formal verification with Verus.
This work is ongoing. Our current focus is OSTD's memory management and synchronization subsystems—core components directly tied to kernel memory safety—and we aim to extend verification to further parts of OSTD over time.
This project is tied to the following papers:
AI-assist label. [paper] [code]Formal verification has surfaced real bugs in OSTD and the upstream Asterinas kernel, including undefined behavior, deadlocks, arithmetic overflows, and reachable panics. We track them in issue #645.
vostd/
├── dv/ # Build system
├── ostd/
│ ├── libs/ # Auxiliary libraries for OSTD
│ │ ├── align_ext/
│ │ ├── id-alloc/
│ │ └── ostd-pod/
│ ├── specs/ # Verus specifications
│ └── src/ # OSTD implementation and proofs
└── verified_libs/ # Auxiliary verified libraries
├── bitflags/
└── vstd_extra/
make verus # or: cargo dv bootstrap
Verus is cloned and built under tools/verus. If the download fails, clone it manually into tools/verus and re-run cargo dv bootstrap.
[!NOTE] We use our own fork of Verus, kept in sync with upstream. To build against upstream Verus instead, use
cargo dv bootstrap --upstream-verus(however, we do not guarantee our code will always verify with the upstream version).
make # verify OSTD and its dependencies (or: cargo dv verify)
make verify-riscv # verify the RISC-V arch code of OSTD (or: cargo dv verify --target riscv64imac-unknown-none-elf)
make verify-loongarch # verify the LoongArch arch code of OSTD (or: cargo dv verify --target loongarch64-unknown-none-softfloat)
cargo dv focus --package ostd # ostd only, skip dependency proofs
cargo dv focus --package ostd -- --verify-only-module sync::rwlock # verify one ostd module
cargo dv verify --package vstd_extra # the verified dependency crate
Partial verification selectors such as --verify-only-module require the
focus command.
--package (-p) selects packages; --target selects the Rust target triple
(default: x86_64-unknown-none).
Verify bzImage mappings on the Linux host target, assuming valid setup ELF address and offset ranges:
cargo dv verify -p linux-bzimage-builder --target x86_64-unknown-linux-gnu
make clean # or: cargo dv clean # remove build artifacts for a fresh build
make build # or: cargo dv build # build the verification targets
make doc # or: cargo dv doc --package ostd # generate API docs at doc/index.html
[!NOTE] Run
cargo dv buildbefore invokingcargo dv docdirectly.
The generated documentation can be found at doc/.
An online version is also available.
verus-analyzerverus-modeWe welcome your contributions! Follow the VOSTD Verus Coding Guidelines for coding, specification, proof, naming, and organization conventions.
Before submitting:
make verus-upgrade (cargo dv bootstrap --upgrade) to update the supported Verus toolchain.make fmt to format your changes, including the build tool in dv/; formatting is enforced.make to verify them.For changes to Verus itself, prefer contributing to upstream Verus to minimize differences between upstream and our fork.
browse all types & interfaces →
$ claude mcp add vostd \
-- python -m otcore.mcp_server <graph>