homeblog

Install QEMU and its plugins

Install qemu

Clone repo

git clone git@gitlab.com:qemu-project/qemu.git
cd qemu-plugin

Install dependecies (this examples are for Ubuntu)

#strict dependencies
sudo apt install -y git build-essential python3 python3-venv ninja-build libglib2.0-dev

#to build documentation
sudo apt install -y python3-pip python3-sphinx python3-sphinx-rtd-theme

#to build with extra features capstone it's the most necessary for our purposes

#to build with extra libraries
sudo apt install libcapstone-dev
sudo apt install git-email
sudo apt install libaio-dev libbluetooth-dev libbrlapi-dev libbz2-dev
sudo apt install libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev
sudo apt install libibverbs-dev libjpeg8-dev libncurses5-dev libnuma-dev
sudo apt install librbd-dev librdmacm-dev
sudo apt install libsasl2-dev libsdl2-dev libseccomp-dev libsnappy-dev libssh-dev
sudo apt install libvde-dev libvdeplug-dev libvte-2.91-dev libxen-dev liblzo2-dev
sudo apt install valgrind xfslibs-dev
sudo apt install libnfs-dev libiscsi-dev

./configure --target-list=<targets> --enable-debug --enable-plugins --prefix=<qemu_install_dir> --disable-werror 
make -j$(nproc)
make install

To execute

<qemu_install_dir>/bin/qemu-riscv64 -plugin <qemu_source_dir>/contrib/plugins/lib<the_name_of_your_plugin>.so,<plugin_options> -D <plugin_output_filename> -d plugin <binary>

you can find more information about QEMU in it's documentation and more info of the TCG plugins in here.

I obtained the QEMU dependencies from the test/docker/dockerfile directory in the QEMU source.

Therese more documentation in here!