Adding a new CPU
We decided to use PANDA’s version of QEMU because, in the next chapter, we will see project FirmWire that emulates the firmware; we will just try to boot on the same emulator. You can check out the latest version.
Without further delay, let’s dive straight into a quick trick for adding support for a new CPU in PANDA-QEMU, which doesn’t seem to be supported initially. Specifically, the panda-re/panda/target/arm/cpu.c
file contains details about ARM 32-bit architecture CPUs, including different flavors. In the case of real-time software, the ARM Cortex-R series is often preferred, with Samsung basebands running on top of the cortex-r7
, for example. Upon examining the following code excerpt, we can see that only cortex-r5
is supported (indicated in bold). This structure associates an init
function with each CPU model. To add support for cortex-r7
, we can reuse the init
function of cortex-r5
and rename it accordingly. This will help instrument the...