MMotor OS
Developing

Rust on Motor OS

Motor OS is a Tier-3 Rust target, x86_64-unknown-motor. A program that uses the standard library and does not depend, directly or through its crates, on Unix or Windows APIs cross-compiles and runs. This page says what "the standard library works" means in practice and how Motor OS differs from Unix for a program that is being ported.

The target

Cross-compiling on Linux, from a project inside the Motor OS checkout, where the repository's rust-toolchain.toml selects the Motor toolchain (copy that file into a project that lives elsewhere):

cargo build --release --target x86_64-unknown-motor

The binary goes into the VM with scp (see Hello Motor OS). On the developer image the same program can be built natively with rustc or with Lorry.

What std supports

ModuleStatus
std::thread, syncThreads, thread-local storage, mutexes, condition variables, channels, futex-based parking.
std::fsFiles, directories, metadata with timestamps, rename, truncate, permissions in the three-role model, advisory file locks. No symbolic or hard links.
std::netTCP and UDP, IPv4 and IPv6, name resolution, nonblocking mode, timeouts, TCP_NODELAY, TTL, linger, buffer sizes. No multicast or broadcast.
std::processCommand with arguments, environment, and stdio piping; kill, wait, and try_wait; exit codes. No fork, no signals, no process groups.
std::ioStdio, pipes, IsTerminal; see Terminals for what a terminal is.
std::env, time, allocArguments, environment, current directory, current_exe; system and monotonic time; the frusa allocator.
std::os::unixNot available. Motor-specific extensions come from moto-rt and moto-sys.

Ported crates and what works on top of them

The forks are ordinary Git dependencies, added to a program's Cargo.toml under [patch.crates-io] (or as a direct dependency, for russh and ctrlc), as the in-tree programs do:

CrateRepositoryBranch or tag
tokiohttps://github.com/moturus/tokio.gittokio-motor-1.47.1_2025-10-07
miohttps://github.com/moturus/mio.gitmio-motor-v1.0.4_2025-10-07
ringhttps://github.com/moturus/ring.gitmotor-os-0.17.14
crosstermhttps://github.com/moturus/crossterm.gitmotor-os-support
russhhttps://github.com/moturus/russh.gitdefault branch
ctrlchttps://github.com/moturus/rust-ctrlc.gitmotor-os-rustc
cc (for crates that compile C)https://github.com/moturus/cc-rs.gitmain

As a rule, sans-io crates and crates such as rand or rustls compile and work, sometimes with minor tweaks; async crates that assume Tokio features which are not ported need refactoring; and crates that wrap native Linux or Windows APIs will not work.

Porting notes

C and C++

Rust is the preferred language on Motor OS, but C and C++ are fully supported: a C library, mlibc, sits on a C ABI shim over the same runtime, libc++ sits on top of it, and Clang/LLVM targets Motor OS directly, on the developer image and as a cross-compiler on Linux. See C/C++ on Motor OS.