RISC-V GDB Environment
Docker
In this tutorial, we will be using a prebuilt Docker image to ensure a consistent and reproducible environment.
Before starting, make sure you have installed the Docker container engine and any other necessary packages.
Environment Setup
Option 1. Pull Docker image from container repository
The Docker image has been built for both x86_64 and ARM64, so the same instructions here will work for all systems (Apple/AMD/Intel).
Option 2. Build image from Dockerfile
If you prefer to build your own image or have trouble accessing the GitHub container repository from outside campus, you can use the dockerfile below to build the same image from source.
Copy the above into a dockerfile, and build it using the command below
docker build -t rvemu .
After the image is built, you can follow the steps from option 1 starting from #2. Run container.
Starting and stopping your container
After the initial setup, you can start and stop with its assigned name
Start:
docker container start rvemu
Stop:
docker container stop rvemu
Optional Setup
SSH key authentication
SSH key authentication is a quality of life feature that you can use to securely login to a remote server password-free. In this case, our "remote server" is our not so remote QEMU machine inside the container.
SSH config
Setting up a SSH config lets you login to a host without typing in the host IP address, port, and username. Using the config below, you can login by using ssh debian-rv64
You can copy paste the above into your bash terminal to add the SSH config.
Advanced
If you prefer to setup an environment with your own emulator e.g. UTM/QEMU, or perhaps have access to a RISC-V machine, you are welcome to do so. The OS disk image we use in our container image can be downloaded in the link below.
Last updated