Skip to main content

Quick Start

Prerequisites

Before getting started with Miralis, ensure the following dependencies installed, or follow the installation instructions:

  1. Install Rust (instructions)
  2. Install Just (can be installed with cargo install just)
  3. Install qemu-system-riscv64:
    • On Ubuntu: sudo apt install qemu-system-riscv64
    • On macOS: brew install qemu
  4. Run just install-toolchain in the Miralis folder to install the required Rust components.

Running Miralis

Once all dependencies are installed, Miralis can be run with:

just run

This command runs Miralis in QEMU with a simple firmware that prints "Hello" and exits. You should see output similar to:

[Info  | miralis] Hello, world!
[Info | miralis] Platform name: QEMU virt
[Info | miralis] Hart ID: 0
[Info | miralis] Preparing jump into firmware
[Info | miralis::modules] No module installed
[Info | miralis::virt::emulator] > Hello from default firmware!
[Info | miralis::virt::emulator] Success!
[Info | miralis::virt::emulator] Number of exits: 5
[Info | miralis::debug] Maximal stack usage: 4008 bytes (12.22%)

Running Linux on Miralis

Let's now run Linux on top of Miralis:

just run linux-shell

This command will download and boot a Linux image. Although it appears to be a standard Linux environment, there is one notable difference: there is no firmware (OpenSBI) running in M-mode. Instead, Miralis is running OpenSBI in a virtualized M-mode within user-space.