Pebble fork of qemu
C C++ Python Shell Haxe Assembly Other
Clone or download
Katharine Berry
Katharine Berry Update to 2.5.0-pebble4
Latest commit 58a0a94 Oct 18, 2016
Permalink
Failed to load latest commit information.
assets put overlay assets under version control Sep 29, 2015
audio Update to upstream 2.5 Mar 10, 2016
backends Update to upstream 2.5 Mar 10, 2016
block Update to upstream 2.5 Mar 10, 2016
bsd-user Update to upstream 2.5 Mar 10, 2016
contrib Update to upstream 2.5 Mar 10, 2016
crypto Update to v2.5.0-pebble3 Sep 30, 2016
default-configs Update to upstream 2.5 Mar 10, 2016
disas Update to upstream 2.5 Mar 10, 2016
docs Update to upstream 2.5 Mar 10, 2016
dtc @ bc895d6 dtc: add submodule Apr 18, 2013
fpu Update to upstream 2.5 Mar 10, 2016
fsdev Update to upstream 2.5 Mar 10, 2016
gdb-xml Update to upstream 2.5 Mar 10, 2016
hw Update to 2.5.0-pebble4 Oct 17, 2016
include Update to v2.5.0-pebble3 Sep 30, 2016
libdecnumber Update to upstream 2.5 Mar 10, 2016
linux-headers Update to upstream 2.5 Mar 10, 2016
linux-user Update to upstream 2.5 Mar 10, 2016
migration Update to upstream 2.5 Mar 10, 2016
net Update to upstream 2.5 Mar 10, 2016
pc-bios Update to upstream 2.5 Mar 10, 2016
pixman @ 97336fa qapi: move include files to include/qobject/ Dec 19, 2012
po Update to upstream 2.5 Mar 10, 2016
qapi Update to upstream 2.5 Mar 10, 2016
qga Update to upstream 2.5 Mar 10, 2016
qobject Update to upstream 2.5 Mar 10, 2016
qom Update to upstream 2.5 Mar 10, 2016
replay Update to upstream 2.5 Mar 10, 2016
roms Update to upstream 2.5 Mar 10, 2016
scripts Update to upstream 2.5 Mar 10, 2016
slirp Update to upstream 2.5 Mar 10, 2016
stubs Update to upstream 2.5 Mar 10, 2016
target-alpha Update to upstream 2.5 Mar 10, 2016
target-arm Update to upstream 2.5 Mar 10, 2016
target-cris Update to upstream 2.5 Mar 10, 2016
target-i386 Update to upstream 2.5 Mar 10, 2016
target-lm32 Update to upstream 2.5 Mar 10, 2016
target-m68k Update to upstream 2.5 Mar 10, 2016
target-microblaze Update to upstream 2.5 Mar 10, 2016
target-mips Update to upstream 2.5 Mar 10, 2016
target-moxie Update to upstream 2.5 Mar 10, 2016
target-openrisc Update to upstream 2.5 Mar 10, 2016
target-ppc Update to upstream 2.5 Mar 10, 2016
target-s390x Update to upstream 2.5 Mar 10, 2016
target-sh4 Update to upstream 2.5 Mar 10, 2016
target-sparc Update to upstream 2.5 Mar 10, 2016
target-tilegx Update to upstream 2.5 Mar 10, 2016
target-tricore Update to upstream 2.5 Mar 10, 2016
target-unicore32 Update to upstream 2.5 Mar 10, 2016
target-xtensa Update to upstream 2.5 Mar 10, 2016
tcg Update to upstream 2.5 Mar 10, 2016
tests Update to upstream 2.5 Mar 10, 2016
trace Update to upstream 2.5 Mar 10, 2016
ui Update to v2.5.0-pebble3 Sep 30, 2016
util Update to upstream 2.5 Mar 10, 2016
.exrc qemu: add .exrc Sep 7, 2012
.gitignore Update to upstream 2.5 Mar 10, 2016
.gitmodules PPC: Add u-boot firmware for e500 Jun 16, 2014
.mailmap Update mailmap Sep 5, 2013
.travis.yml trace: Multi-backend tracing Jun 9, 2014
CMakeLists.txt Update to upstream 2.5 Mar 10, 2016
CODING_STYLE Update to upstream 2.5 Mar 10, 2016
COPYING COPYING: update from FSF Oct 12, 2008
COPYING.LIB Update FSF address in GPL/LGPL boilerplate Jan 4, 2009
Changelog Use qemu-project.org domain name Oct 11, 2013
HACKING HACKING: Document vaddr type usage Jul 23, 2013
LICENSE Update to upstream 2.5 Mar 10, 2016
MAINTAINERS Update to upstream 2.5 Mar 10, 2016
Makefile Update to upstream 2.5 Mar 10, 2016
Makefile.objs Update to upstream 2.5 Mar 10, 2016
Makefile.target Update to upstream 2.5 Mar 10, 2016
README Update to upstream 2.5 Mar 10, 2016
README.md Updated readme Dec 8, 2014
VERSION Update to 2.5.0-pebble4 Oct 17, 2016
accel.c Update to upstream 2.5 Mar 10, 2016
aio-posix.c Update to upstream 2.5 Mar 10, 2016
aio-win32.c Update to upstream 2.5 Mar 10, 2016
arch_init.c Update to upstream 2.5 Mar 10, 2016
async.c Update to upstream 2.5 Mar 10, 2016
balloon.c Update to upstream 2.5 Mar 10, 2016
block.c Update to upstream 2.5 Mar 10, 2016
blockdev-nbd.c Update to upstream 2.5 Mar 10, 2016
blockdev.c Update to upstream 2.5 Mar 10, 2016
blockjob.c Update to upstream 2.5 Mar 10, 2016
bootdevice.c Update to upstream 2.5 Mar 10, 2016
bt-host.c sysemu: avoid proliferation of include/ subdirectories Apr 15, 2013
bt-vhci.c sysemu: avoid proliferation of include/ subdirectories Apr 15, 2013
configure Update to upstream 2.5 Mar 10, 2016
cpu-exec-common.c Update to upstream 2.5 Mar 10, 2016
cpu-exec.c Update to upstream 2.5 Mar 10, 2016
cpus.c Update to upstream 2.5 Mar 10, 2016
cputlb.c Update to upstream 2.5 Mar 10, 2016
device-hotplug.c Update to upstream 2.5 Mar 10, 2016
device_tree.c Update to upstream 2.5 Mar 10, 2016
disas.c Update to upstream 2.5 Mar 10, 2016
dma-helpers.c Update to upstream 2.5 Mar 10, 2016
dump.c Update to upstream 2.5 Mar 10, 2016
exec.c Update to upstream 2.5 Mar 10, 2016
gdbstub.c Update to upstream 2.5 Mar 10, 2016
hmp-commands-info.hx Update to upstream 2.5 Mar 10, 2016
hmp-commands.hx Update to upstream 2.5 Mar 10, 2016
hmp.c Update to upstream 2.5 Mar 10, 2016
hmp.h Update to upstream 2.5 Mar 10, 2016
iohandler.c Update to upstream 2.5 Mar 10, 2016
ioport.c Update to upstream 2.5 Mar 10, 2016
iothread.c Update to upstream 2.5 Mar 10, 2016
kvm-all.c Update to upstream 2.5 Mar 10, 2016
kvm-stub.c Update to upstream 2.5 Mar 10, 2016
main-loop.c Update to upstream 2.5 Mar 10, 2016
memory.c Update to upstream 2.5 Mar 10, 2016
memory_mapping.c Update to upstream 2.5 Mar 10, 2016
module-common.c module: implement module loading Feb 20, 2014
monitor.c Update to upstream 2.5 Mar 10, 2016
nbd.c Update to upstream 2.5 Mar 10, 2016
numa.c Update to upstream 2.5 Mar 10, 2016
os-posix.c Update to upstream 2.5 Mar 10, 2016
os-win32.c Update to upstream 2.5 Mar 10, 2016
page_cache.c Update to upstream 2.5 Mar 10, 2016
pebble.py Fix up pebble.py script Jun 4, 2015
pebble_dbgserial.sh Change dbgserial to come out on a tcp socket. Nov 14, 2013
qapi-schema.json Update to upstream 2.5 Mar 10, 2016
qdev-monitor.c Update to upstream 2.5 Mar 10, 2016
qdict-test-data.txt Introduce QDict test data file Sep 4, 2009
qemu-bridge-helper.c qemu-bridge-helper: Fix fd leak in main() Jun 27, 2014
qemu-char.c Update to upstream 2.5 Mar 10, 2016
qemu-doc.texi Update to upstream 2.5 Mar 10, 2016
qemu-ga.texi Update to upstream 2.5 Mar 10, 2016
qemu-img-cmds.hx Update to upstream 2.5 Mar 10, 2016
qemu-img.c Update to upstream 2.5 Mar 10, 2016
qemu-img.texi Update to upstream 2.5 Mar 10, 2016
qemu-io-cmds.c Update to upstream 2.5 Mar 10, 2016
qemu-io.c Update to upstream 2.5 Mar 10, 2016
qemu-log.c Update to upstream 2.5 Mar 10, 2016
qemu-nbd.c Update to upstream 2.5 Mar 10, 2016
qemu-nbd.texi nbd: Miscellaneous typo fixes. May 23, 2014
qemu-options-wrapper.h vl.c: In qemu -h output, only print options for the arch we are runni… Dec 19, 2011
qemu-options.h vl.c: Move option generation logic into a wrapper file Dec 19, 2011
qemu-options.hx Update to upstream 2.5 Mar 10, 2016
qemu-seccomp.c Update to upstream 2.5 Mar 10, 2016
qemu-tech.texi Update to upstream 2.5 Mar 10, 2016
qemu-timer.c Update to upstream 2.5 Mar 10, 2016
qemu.nsi Update to upstream 2.5 Mar 10, 2016
qemu.sasl sasl: Avoid 'Could not find keytab file' in syslog Mar 15, 2014
qjson.c Update to upstream 2.5 Mar 10, 2016
qmp-commands.hx Update to upstream 2.5 Mar 10, 2016
qmp.c Update to upstream 2.5 Mar 10, 2016
qtest.c Update to upstream 2.5 Mar 10, 2016
rules.mak Update to upstream 2.5 Mar 10, 2016
softmmu_template.h Update to upstream 2.5 Mar 10, 2016
spice-qemu-char.c Update to upstream 2.5 Mar 10, 2016
tcg-runtime.c tcg: Push tcg-runtime routines into exec/helper-* May 28, 2014
tci.c Update to upstream 2.5 Mar 10, 2016
thread-pool.c Update to upstream 2.5 Mar 10, 2016
thunk.c Update to upstream 2.5 Mar 10, 2016
tpm.c Update to upstream 2.5 Mar 10, 2016
trace-events Update to upstream 2.5 Mar 10, 2016
translate-all.c Update to upstream 2.5 Mar 10, 2016
translate-all.h Update to upstream 2.5 Mar 10, 2016
translate-common.c Update to upstream 2.5 Mar 10, 2016
user-exec.c Update to upstream 2.5 Mar 10, 2016
version.rc Use qemu-project.org domain name Oct 11, 2013
vl.c Update to upstream 2.5 Mar 10, 2016
xen-common-stub.c Update to upstream 2.5 Mar 10, 2016
xen-common.c Update to upstream 2.5 Mar 10, 2016
xen-hvm-stub.c Update to upstream 2.5 Mar 10, 2016
xen-hvm.c Update to upstream 2.5 Mar 10, 2016
xen-mapcache.c Update to upstream 2.5 Mar 10, 2016

README.md

Pebble Smartwatch QEMU Implementation

Overview

This is a derivative of QEMU v2.1.1 that has been modified to include an implementation of the STM32F2xx microcontroller. This is based off of a QEMU fork that is targeting the STM32F103: https://github.com/beckus/qemu_stm32. This repo contains both beckus' STM32F1xx implementation and Pebble's STM32F2xx additions.

DANGER DANGER: It is very much a work-in-progress! Only some of the peripherals are working at the moment. Please contribute!

Dependencies

QEMU requires that development packages for glib20 and pixman are installed.

FreeBSD

Install the devel/glib20 and x11/pixman ports.

Linux

Mac OS X

Windows

Building

Commands for a typical build:

    ./configure --disable-werror --enable-debug --target-list="arm-softmmu" \
    --extra-cflags=-DSTM32_UART_NO_BAUD_DELAY
    make

Summary set of configure options that are useful when developing (tested only on OS X 10.9.5):

    ./configure --enable-tcg-interpreter --extra-ldflags=-g \
    --with-coroutine=gthread --enable-debug-tcg --enable-cocoa \
    --enable-debug --disable-werror --target-list="arm-softmmu" \
    --extra-cflags=-DDEBUG_CLKTREE --extra-cflags=-DDEBUG_STM32_RCC \
    --extra-cflags=-DDEBUG_STM32_UART --extra-cflags=-DSTM32_UART_NO_BAUD_DELAY \
    --extra-cflags=-DDEBUG_GIC 

####Configure options which control the STM32 implementation:

--extra-cflags=-DDEBUG_CLKTREE
    Print out clock tree debug statements.

--extra-cflags=-DDEBUG_STM32_RCC
    Print RCC debug statements.

--extra-cflags=-DDEBUG_STM32_UART
    Print UART debug statements.

--extra-cflags=-DSTM32_UART_NO_BAUD_DELAY
    Disable the BAUD rate timing simulation
    (i.e. the UART will transmit or receive as fast as possible, rather than
    using a realistic delay).

--extra-cflags=-DSTM32_UART_ENABLE_OVERRUN
    Enable setting of the overrun flag if a character is
    received before the last one is processed.  If this is not set, the UART
    will not receive the next character until the previous one is read by
    software.  Although less realisitic, it is safer NOT to use this, in case the VM is
    running slow.

####Other QEMU configure options which are useful for troubleshooting: --extra-cflags=-DDEBUG_GIC Extra logging around which interrupts are asserted

####qemu-system-arm options which are useful for troubleshooting: -d ? To see available log levels

-d cpu,in_asm
    Enable logging to view the CPU state during execution and the ARM
    instructions which are being executed.  I believe --enable-debug must be
    used for this to work.

Useful make commands when rebuilding:

    make defconfig
    make clean

Generating Images

  • Use ./waf build qemu_image_spi to generate qemu_spi_flash.bin from tintin.
  • Use ./waf build qemu_image_micro to generate qemu_micro_flash.bin from tintin.

Under the covers of the images

QEMU's -pflash argument is used to specify a file to use as the micro flash. An image can be created by concatenating the boot and main firmware files, like so:

truncate -s 64k tintin_boot.bin
cat tintin_boot.bin tintin_fw.bin > micro_flash.bin
truncate -s 512k micro_flash.bin

Running

There is a convenience script pebble.sh that runs QEMU. It depends on the existence of (symlinked) images qemu_micro_flash.bin and qemu_spi_flash.bin.

More details about running QEMU

The generated executable is arm-softmmu/qemu-system-arm .

Example:

    qemu-system-arm -rtc base=localtime -machine pebble-bb2 -cpu cortex-m3 -s \
    -pflash qemu_micro_flash.bin -mtdblock qemu_spi_flash.bin 

Adding -S to the commandline will have QEMU wait in the monitor at start; the _c_ontinue command is necessary to start the virtual CPU.

QEMU Docs

Read original the documentation in qemu-doc.html or on http://wiki.qemu.org

QEMU Modifications

This emulator consists largely of new hardware device models; it includes only minor changes to existing QEMU functionality.

The changes can be reviewed by running git diff --diff-filter=M v1.5.0-backports.

To list the added files, use git diff --name-only --diff-filter=A v1.5.0-backports.

License

The following points clarify the QEMU license:

  1. QEMU as a whole is released under the GNU General Public License

  2. Parts of QEMU have specific licenses which are compatible with the GNU General Public License. Hence each source file contains its own licensing information.

Many hardware device emulation sources are released under the BSD license.

  1. The Tiny Code Generator (TCG) is released under the BSD license (see license headers in files).

  2. QEMU is a trademark of Fabrice Bellard.