Getting Started
Clone this wiki locally
Below are the steps to get started with using QEMU. Follow all of the below steps
Checking out the Project
Run the following commands to checkout the project:
git clone https://github.com/alistair23/qemu.git qemu
cd qemu
git checkout netduinoplus2.dev
git submodule update --init dtc
git submodule update --init pixman
Compiling
Inside the QEMU directory configure QEMU for ARM devices:
./configure --target-list="arm-softmmu" --disable-kvm
Then QEMU can be compiled with:
make -j4
NOTE: This can take a few minutes to complete
Running QEMU
Once QEMU has been configured and compiled it can be run with one of the following commands:
The command line to test the Netduino Plus 2 machine model and CSSE3010 examples is:
./qemu/arm-softmmu/qemu-system-arm -M netduinoplus2 -nographic -kernel main.elf -chardev stdio,mux=on,id=terminal -serial /dev/null -serial /dev/null -serial /dev/null -serial chardev:terminal -serial /dev/null -serial chardev:terminal -monitor chardev:terminal
The command line to test the Netduino 2 machine model and CSSE3010 examples is:
./qemu/arm-softmmu/qemu-system-arm -M netduino2 -nographic -kernel main.elf -chardev stdio,mux=on,id=terminal -serial /dev/null -serial chardev:terminal -serial /dev/null -serial chardev:terminal -monitor chardev:terminal
These commands will run the appropriate machine (CSSE3010 students should use the Netduino Plus 2 machine). The paths for the qemu folder and the elf file will need to be corrected depending on the location on the users machine.
Debugging the guest
QEMU allows the user to debug the guest code. This is possible by following the steps below:
-
Add
-S -sto the command used to run QEMU. This will allow GDB debugging and pause the guest -
In a separate terminal run
arm-none-eabi-gdb main.elfwhere main.elf is the same elf file used in QEMU -
Inside GDB run the following:
target remote localhost:1234loadbreak main#Or any other point/scontinue -
QEMU will then run until it reaches the first breakpoint. Use GDB as usual
Copyright and Written by Alistair Francis