A lightweight hypervisor for Nintendo Switch.
Switchvisor occupies the platform's BL33 slot and supports two boot modes. The default hypervisor mode keeps Switchvisor at EL2 and starts one guest at EL1. Loader mode starts the raw payload directly at EL2 and releases its boot memory.
The current platform integration boots through Hekate L4T and a compatible BL31. Early boot messages use Hekate's framebuffer.
Hekate -> BL31 -> Switchvisor (EL2) -> guest entry (EL1) or native payload (EL2)
flake.nix provides the Rust toolchain and development tools.
From the repository root, enter the Nix development shell:
nix developRun the following build and development commands inside this shell.
Prepare a raw AArch64 payload and a Hekate L4T bootstack directory containing
bl31.bin, bl33.bin, and nx-plat.dtimg that match the
pinned bootstack configuration.
Then build:
scripts/build-payload.sh path/to/payload.raw 0x100000 path/to/bootstack0x100000 is the payload's full runtime size, including BSS. To run the
bootstack's own U-Boot as the guest, pass path/to/bootstack/bl33.bin with
runtime size 0x68200.
Copy dist/bl33.bin to the microSD path configured for BL33 by the selected
Hekate L4T boot entry. The entry boots hypervisor mode by default; set
switchvisor_mode=loader in the entry to start the payload natively at EL2.
| Topic | Contents |
|---|---|
| Building a payload | Output files, boot mode selection, U-Boot memory requirements, entry and register options, repackaging |
| USB console | --usb-uart: guest console over USB CDC ACM and its DT overlay |
| USB control and bundle loading | --usb-control: switchvisorctl, multi-image bundles, the automatic RCM payload cycle |
| USB network | --usb-net: CDC-NCM bridged to a guest virtio-net device |
| Guest entry contract | CPU state, memory layout, PSCI, GIC, and the VMM reservation |
| Guest hypercalls | HVC ABI, diagnostics log, MMIO tracing |
| Scarlet guest control | Scarlet driver and swvctl CLI |
cargo test --workspace
cargo check-el2
cargo build-hvSwitchvisor is licensed under the GNU General Public License version 2 only. See LICENSE. See THIRD_PARTY.md for Hekate attribution.