Skip to content

Rebuilding system emulator environment

Michael Messner edited this page Nov 11, 2022 · 12 revisions

TODO - see all the repos here https://github.com/EMBA-support-repos/

This documentation is work in progress! Do not trust the info :)

Cross-compiler

In order to build any of the binaries used by EMBA, you will need different cross-compilation toolchains. To simplify the process of building these toolchains, we recommend using musl-cross-make project.

Busybox

https://busybox.net/downloads/busybox-1.29.3.tar.bz2

Libnvram

Console

Linux Kernel

MIPS architecture

Since MIPS systems can be either big-endian or little-endian, this kernel should be compiled for both endianness. The below instructions produce a little-endian (mipsel) kernel, but should be repeated for a big-endian (mipseb) kernel.

Little-Endian (MIPSEL)

Create the kernel build output directory:

mkdir -p build/mipsel

Copy the configuration file into the build directory:

cp config.mipsel build/mipsel/.config

Assuming that the appropriate cross-compiler is installed in /opt/cross/mipsel-linux-musl, execute:

make ARCH=mips CROSS_COMPILE=/opt/cross/mipsel-linux-musl/bin/mipsel-linux-musl- O=./build/mipsel -j8

The output kernel image will be generated at the following location:

build/mipsel/vmlinux

Big-Endian (MIPSEB)

Create the kernel build output directory:

mkdir -p build/mipseb

Copy the configuration file into the build directory:

cp config.mipseb build/mipseb/.config

Assuming that the appropriate cross-compiler is installed in /opt/cross/mipseb-linux-musl, execute:

make ARCH=mips CROSS_COMPILE=/opt/cross/mipseb-linux-musl/bin/mipseb-linux-musl- O=./build/mipseb -j8

The output kernel image will be generated at the following location:

build/mipseb/vmlinux

MIPS64

ARMel (Little Endian)

sf and hf

x86

Addons

Addons - strace

Addons - gdb

Credits

This documentation is based on the original documentation of the FirmAE and the firmadyne project!

Clone this wiki locally