QBox

QBox

QBox or "QEMU in a box" is QEMU with a TLM-2.0 like interface

QBox

qbox-logo

Overview

QBox or "QEMU in a box" is QEMU with a TLM-2.0 like interface. QEMU is a system platform emulator based on JIT technology which is an industry benchmark in terms of execution speed. It can be used to simulate a wide variety of platforms, based on an equally wide variety of CPU architectures. QBox allows the powerful JIT based CPU simulations to be exploited within a TLM-2.0 context, such that it can, for instance be instanciated without TLM models in a SystemC simulation environment.

QBox is sufficiently flexible that some of the basic system components can be included within QBox, so only the device models of interest need to be modelled in SystemC.

The result is that QBox is a flexible platform simulation environment perfect for either adding new components and designing device drivers, or it can be used within the context of a much wider system as mearly one of many components.

QBox's are shared libraries that contain QEMU based CPU models. Each QBox contains a specific CPU core. QBox's are C objects that export a TLM-2.0 like interface. The GreenSocs Library contains TLM2C bridges to connect C TLM-2 style models to SystemC TLM-2.0. This can be used with QBox in order to allow a QBox to execute with your existing systems SystemC simulation library.

For more information about QBox's and training on how to use QBox's and the GreenSocs SystemC library please contact us.

QBox also supports the use of:

  • Eclipse connection (Use Eclipse for the full debug environment)
  • Guest O/S debug (Connect to the running O/S via QEMU's GDB server port)

QBox CPU models

  • ARM ARM926
  • ARM Cortex-M3
  • ARM Cortex-A9

Code status

build status

Requirements

QBox requires:

  • git > 1.7
  • TLM2C > 1.0
  • glib2 and glib2-dev > 2.20 on Windows, 2.12 otherwise
  • pixman dev > 0.21.8
  • gettext runtime > 0.18
  • pkg-config > 0.23
  • flex > 2.5.35
  • bison > 2.4.1

Official OS support:

  • Linux :
    • Ubuntu 12.04 and 14.04
    • CentOS 6 and 7
  • Windows with MinGW
  • OS X : soon

Linux

Ubuntu / Debian :

$ sudo apt-get install libglib2.0-dev libpixman-1-dev flex bison pkg-config

CentOS / Fedora :

$ sudo yum install glib2-devel pixman-devel flex bison pkgconfig

Windows

Please try to install packages in paths without spaces.

With MinGW Installer, install these following packages:

MinGW

  • mingw32-base
  • mingw32-gcc-g++
  • mingw-developer-toolkit
  • msys-base

MSYS

  • msys-flex
  • msys-bison

You also need glib2, glib2-dev, pixman-dev, gettext-runtime and pkg-config. You can compile these packages from source or you can download binaries (which is faster).

Then, install packages (copy / paste files) in your MinGW installation.

Download

Be sure to clone the repository and include dtc submodule. After cloning the repository, you should run:

$ git submodule update --init dtc

Configure

Be sure you have TLM2C compiled before configuring. All instructions are available in the TLM2C README.

$ ./configure --target-list=arm-softmmu --library --qbox --with-tlm2c=[TLM2C_PATH] --prefix=[PREFIX_PATH] --disable-pie --extra-cflags=-fPIC\ -fpic\ -ftls-model=initial-exec

Please fill options:

  • [TLM2C_PATH] : Specify TLM2C build path
  • [PREFIX_PATH] : Specify build path * This will result in generating the Makefile to build QBox.

Example

./configure --target-list=arm-softmmu --library --qbox --with-tlm2c=`pwd`/tlm2c/build --prefix=`pwd`/build --disable-pie --extra-cflags=-ftls-model=initial-exec

Build

make

or (fastest)

make -j[NUMBER_OF_PARALLELS_JOBS]

This action will result in the compilation of QBox.

Installation

$ make install

Configure

Some options are available to configure QBox through GSParam (a part of GreenLib):

Name Description Default value
CPU.gdb_port GDB server port. Must be > 0 to enable GDB server 0 (= disable)
CPU.extra_arguments Pass extra arguments to QEMU None
CPU.kernel_cmd Kernel command (equivalent to --append on QEMU) None
CPU.rootfs Rootfs path (equivalent to --initrd on QEMU) None
CPU.quantum Quantum None
CPU.kernel Kernel path (equivalent to --kernel on QEMU) None
CPU.dtb DTB path (equivalent to --dtb on QEMU) None

TODO

  • Coming Soon... Multi-host thread support (multi-core platforms simulated on multi-host threads for efficacy and speed)
  • Mac OS X support

Contributing

QBox is an open source, community-driven project. If you'd like to contribute, please feel free to fork project and open merge request or to send us patch.