A tiny Operating System that emulates GBA on Raspberry Pi.
GBA has an ARM7TDMI processor and the processor of Raspberry Pi is ARM1176JZF-S. The ARM7 instruction sets (ARM and thumb) are compatible with the ARM11 ones. Hence no instruction decoding is required to simulate the instructions sets. Special registers such as CPSR have the same bit fields so pre-editing the binaries to execute can be avoided.
make build
Simply run make
The aforementionned version of qemu does not support USB features of BCM2835 so it is mandatory to disable USB.
In order to compile that kernel version, run make qemu-compatible DEFINES=-DNO_USB
If your SD card already contains a valid Raspberry Pi system, you can ignore this step.
First, erase its partitions and create a one that supports vfat, for instance using fdisk
.
Then format it as vfat using mkfs.vfat
.
Clone the officiel Raspberry Pi firmware somewhere into your computer, not on the SD card, and copy only the contents of the boot
folder onto your partition.
Finally, remove all kernel*.img
from your SD card, and don't forget to create a config.txt
adapted to your display.
There is an example of config.txt
file in the configs
subdirectory of this repo.
Put the generated kernel.img into your SD card. If your SD card has several partitions, choose the boot partition alongside Raspberry Pi's firmware files.
Currently, qemu and gdb communicate through port 2222. If you have another application that uses this port, you can edit run-emu.sh and .gdbinit to change the remote port.
This repo contains several branches. Everything on master branch belongs to the current version of the project. Other branches show alternative experimental potential improvements:
GBA files that are located in the resource folder are compiled from the devkitARM GBA examples. If you are interested in GBA development, there is more information about how to setup devkitARM environment.