x86-native
x86-native is a cross-platform native Rust library for building x86 machine hosts without a browser, DOM, WebAssembly runtime or web frontend. The package name on crates.io is x86-native; the Rust library target remains x86, so applications use use x86::....
Project status: the native resource and machine-host API is implemented and tested.
ExecutionBackendis the stable boundary for the future CPU, memory, interrupt and device implementation. The current release does not pretend that a metadata/state loader is already a complete PC emulator.
Languages
| Language | Documentation |
|---|---|
| English | English guide |
| Русский | Русская документация |
| Українська | Українська документація |
The documentation index contains the API map, examples, architecture diagrams, console screenshots and release notes.
Install from Cargo
Add the package to your application:
[]
= "0.1"
Then import the library target as x86:
use ;
The package is designed for stable Rust and native targets supported by Cargo. Run cargo add x86-native or edit Cargo.toml manually as shown above.
Features
| Feature | Default | Purpose |
|---|---|---|
remote |
yes | Native HTTP(S) resource loading through Rust networking code. It does not open a browser. |
zstd |
yes | Decode Zstandard-compressed saved states. |
--no-default-features |
no | Offline/local-only build with no remote loader and no zstd decoder. |
For a strictly offline build:
Main API
The Image type represents BIOS, VGA BIOS, raw disks, ISO images, kernels, initrds, bootloaders and memory-backed resources. It supports local file loading, SHA-256 calculation and checksum verification.
Resource and Bootloader provide a single interface for local paths, in-memory bytes and optional HTTP(S) URLs. SavedState validates v86-compatible state headers, metadata, buffer counts, memory size and compressed state data.
MachineConfig describes RAM, VGA memory, CPU frequency hints, command line and console mode. Machine attaches the machine resources and exposes prepare, run and stop. ExecutionBackend is a platform-neutral trait for connecting the actual native CPU/device engine.
use ;
Native console
Build and launch the terminal application:
The console is a normal native process. It does not start a web server or require a browser:
x86> load bios seabios.bin
x86> load vga-bios vgabios.bin
x86> load disk disk.img
x86> load state arch_state-v3.bin.zst
x86> load bootloader https://example.org/bootloader.bin
x86> info
x86> checksum state
x86> prepare
x86> run
x86> quit
prepare and run return a typed BackendUnavailable error until an ExecutionBackend is attached. This is intentional: the library never reports a guest as running when no CPU/device backend exists.
Architecture

The source diagram is available as docs/assets/architecture.mmd. The host layer is platform-neutral; platform-specific console, filesystem and networking adapters remain outside the core API.
Releases
The GitHub Releases page contains versioned native artifacts and source packages. The release workflow is configured to build Linux, macOS Intel, macOS Apple Silicon and Windows artifacts when a version tag is pushed.
| Target | Typical artifact | Build target |
|---|---|---|
| Linux x86_64 | x86-console-linux-x86_64, libx86-linux-x86_64.so |
x86_64-unknown-linux-gnu |
| macOS Intel | x86-console-macos-x86_64, libx86-macos-x86_64.dylib |
x86_64-apple-darwin |
| macOS Apple Silicon | x86-console-macos-aarch64, libx86-macos-aarch64.dylib |
aarch64-apple-darwin |
| Windows x86_64 | x86-console-windows-x86_64.exe, x86-windows-x86_64.dll |
x86_64-pc-windows-msvc |
Build from source
For native release builds:
License
Licensed under either of BSD-2-Clause or MIT, at your option.
References
The API follows standard Cargo package conventions 1 and uses the repository's native Rust implementation as the source of truth 2.