This document provides a default example for building and using Andes QEMU.
For more details, please refer to the QEMU's documentation.
Clone the Andes QEMU repository:
git clone https://github.com/andestech/qemu.git
Install the required dependencies:
sudo apt-get install git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build
Navigate to the cloned qemu directory and create a build directory:
cd qemu
mkdir build
cd build
Configure the build options:
../configure --target-list=riscv64-softmmu,riscv32-softmmu --disable-werror --disable-pa --disable-alsa --disable-gtk --disable-curses --disable-sdl --disable-vnc --disable-opengl --disable-libusb
Build QEMU:
make -j`nproc`
After successful building, you should have the binaries
qemu-system-riscv64
and qemu-system-riscv32
.For more detailed information about building, refer to the QEMU on Linux hosts.
Option | Description |
---|---|
-nographic | Direct the output to the terminal. |
-M andes_ae350 | Use Andes AE350 platform. |
-cpu andes_ax45 | Use Andes core AX45 for RV64. |
-m 2G | Set system memory to 2G(maximum in AE350 platform). |
-bios elf_file | Run the elf file. |
To run a simple printf/scanf demo, first compile the demo.
Please refer to the Andes BSP User Manual for instructions.
Then execute the following command:
qemu-system-riscv64 -nographic \
-M andes_ae350 -cpu andes-ax45 \
-m 2G -bios demo-printf-V5/CmdMakefile/Demo.elf
If you encounter any issues or problems, please contact [email protected] for assistance.