Xila: building a modular embedded operating system

Rust · WebAssembly · LVGL · embedded systems · Since 2019

A long-running open-source project combining portable operating-system services with isolated applications on resource-constrained devices.

The challenge

Microcontrollers impose tight memory, storage and CPU budgets. I wanted to build a modular development environment nonetheless: separate drivers, hardware abstraction, storage, tasks, graphics and applications that do not always need to be compiled into the host system.

The central challenge is to define reusable contracts between operating-system services, hardware and programs rather than targeting just one board.

Architecture

Main layers of Xila
  1. DriversAdaptation to hardware, native Linux and browser targets.
  2. Rust modulesTasks, users, VFS, networking, graphics and OS services.
  3. Execution boundaryABI contracts, guest/host bindings and the WebAssembly virtual machine.
  4. ApplicationsBundled programs, shell and Wasm applications.

The repository distinguishes modules holding runtime behavior, crates defining contracts and utilities, drivers adapting to a platform, and executables. A file request goes through the VFS for namespace and access checks before reaching a LittleFS backend or a device endpoint.

Guest applications currently use the Wasmi runtime; guest calls cross an explicit binding layer before reaching the same Xila services available to native programs. The graphics stack uses LVGL.

Engineering decisions

  • Rust host, WebAssembly guests. Rust implements the operating-system services, while Wasm provides a separate application format and an explicit execution boundary.
  • Portable contracts, target-specific drivers. The filesystem and device interfaces can be reused while each driver handles its target environment.
  • Native and browser development environments. Linux and browser examples enable iteration before hardware validation. Browser persistence combines an image-based disk and OPFS.
  • Explicit costs. The Wasm interpreter, abstraction layers and graphics stack all have memory and performance implications that need to be measured on the intended device.

Try Xila in WebAssembly

Try Xila in the browser

A real OS and WebAssembly application demo, hosted independently from this portfolio.

Browser security may block OPFS storage or running the demo inside an iframe. For reliable behavior and access to your saved disks, open the demo in its own tab.

Open the demo in a new tab

The demonstration only loads when you click. Any disks you create are stored by your browser under the demo's origin, not this portfolio.

Status and limitations

Xila is actively developed. Running a native or browser example does not establish compatibility with a particular board. I avoid claiming near-native execution performance without reproducible benchmarks.

Explore the project

← All projects