eCos Support for QEMU Virtual Machines — Overview


This document covers the configuration and usage of eCos and RedBoot on ARM Aarch32 Virtual Machines running under QEMU. While QEMU is capable of emulating a variety of real board and devices, this package specifically supports running eCos using the generic "virt" target. As such it is similar to a VM running under a hypervisor on a real host and is treated as such here. It supports Virtual Machines using a limited number of real device emulations as well as some VirtIO based devices.

eCos applications are typically developed using the host-based gdb debugger, communicating with a "gdb stub" built-in to either RedBoot or QEMU. For RedBoot-based development, the VM is set up to boot into RedBoot either from a ROM image or from an image inserted into RAM when QEMU was started. RedBoot incorporates a gdb stub that enables eCos applications to be downloaded and debugged either via a serial line or over Ethernet. Such applications may also be debugged using QEMU's GDB stub interface.

Support for SMP operation is available, although debugging support is restricted to use of an external debugger connected to QEMU's GDB debug port. There is no SMP debug support in RedBoot. QEMU supports up to eight CPUs in the ARM virtual machine, by default eCos is configured to use four CPUs.

Finished eCos ROM startup applications can be deployed directly by replacing the RedBoot binary with the application binary when QEMU is started.

This documentation is expected to be read in conjunction with the ARM architecture HAL and Virtual Machine Support documentation; further device support and subsystems are described and documented there.

Supported Hardware

eCos currently runs in single processor mode on an ARM Aarch32 Virtual Machine. The following devices are currently supported by this port.

Generic Interrupt Controller
The ARM GIC is used to handle interrupts. The GIC needs to be memory-mapped. Interrupt vector mapping is defined in this package.
Generic Timer
The ARM architecture Generic Timer is used to supply the system timer. eCos uses the physical counter and timer. The timer is accessed through the CP15 register set.
Emulated UART
ARM PL011 UART macrocell. QEMU supports an emulation of this device and drivers are available in RedBoot and eCos to support it.
VirtIO Console
Support for the VirtIO console device class is present in both RedBoot and eCos.
Ethernet access is via a VirtIO NET device. QEMU is then responsible for routing packets to other VMs or the wider network.
Support is present for using a VirtIO RPMSG interface. This supports the RPMSG subsystem library to present a standard RPMSG API to user applications.

In general, devices are initialized only as far as is necessary for eCos to run. Other devices are not touched unless the appropriate driver is loaded.


The board support is intended to work with GNU tools configured for an arm-eabi target. The original port was undertaken using arm-eabi-gcc version 7.3.0, arm-eabi-gdb version 8.1, and binutils version 2.30.