1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 15:28:10 +00:00
trezor-firmware/core/docs/build/emulator.md
2019-08-08 11:12:17 +02:00

1.4 KiB

Build instructions for Emulator (Unix port)

First clone, initialize submodules and install Pipenv as defined here.

Dependencies

Install the required packages, depending on your operating system.

  • Debian/Ubuntu:
sudo apt-get install scons libsdl2-dev libsdl2-image-dev
  • Fedora:
sudo yum install scons SDL2-devel SDL2_image-devel
  • OpenSUSE:
sudo zypper install scons libSDL2-devel libSDL2_image-devel
  • Arch:
sudo pacman -S scons sdl2 sdl2_image
  • NixOS:

There is a shell.nix file in the root of the project. Just run the following before entering the core directory:

nix-shell
  • Mac OS X:
brew install scons sdl2 sdl2_image pkg-config
  • Windows: not supported yet, sorry.

Build

Run the build with:

pipenv run make build_unix

Run

Now you can start the emulator:

./emu.sh

The emulator has a number of interesting features all documented in the Emulator section.

Building for debugging and hacking in Emulator (Unix port)

Build the debuggable unix binary so you can attach the gdb or lldb. This removes optimizations and reduces address space randomization. Beware that this will significantly bloat the final binary and the firmware runtime memory limit HEAPSIZE may have to be increased.

DEBUG_BUILD=1 make build_unix