QEMU Simulator & Symbian Foundation
Johnathan White
Accenture
Copyright © 2009 Accenture. All Rights Reserved. 1
QEMU Simulator & Symbian
Foundation
Johnathan White SEE October 2009
Copyright © 2009 Accenture. All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture.
Agenda
• Simulator Introduction & Architecture
• Running Simulator
• Building/Debugging Simulator
• Simulator Features/Demo
• GUI environment
• Questions
Copyright © 2009 Accenture. All Rights Reserved. 3
Simulator not Symbian Emulator
• Existing Symbian Emulator is x86 based
– Requires entire environment built for x86
– Requires different tool chain
– Often doesn’t accurately map hardware leading to
integration issues
• Simulator is ARM based
– Single environment and tool chain required
– Accurate mapping of hardware environment
Copyright © 2009 Accenture. All Rights Reserved. 4
What is QEMU ?
• QEMU is a machine emulator which enables guest
(Symbian) to run on host environment
• Emulates full hardware platform including CPU and
peripherals
• QEMU is open source (http://www.qemu.org/)
• Wide QEMU usage in the industry
Copyright © 2009 Accenture. All Rights Reserved. 5
Baseport
• Symbian baseport (Syborg) required for Symbian
to function on QEMU virtual hardware platform
• Baseport comprises of ASSP/Variant code as
well drivers and kernel extensions
• Code above baseport is common between
Simulator and other target hardware
Copyright © 2009 Accenture. All Rights Reserved. 6
Overall Architecture
USER SPACE
EUSER KERNEL SPACE
Symbian
SYBORG BASEPORT
KERNEL NANO ASSP / KERNEL DEVICE
KERNEL VARIANT EXTENSIONS DRIVERS
ARM
SYBORG BOARD MODEL
PERIPHERALS
QEMU BINARY
TRANSLATION
HOST
HOST ENV – Windows, Linux, MAC HOST OS API’s
Host
Hardware
Copyright © 2009 Accenture. All Rights Reserved. 7
Simulator – EPL Kernel kit
All “ingredients” required to create and run a basic Symbian image in QEMU are
released under EPL and thus available to all
Pre-compiled Syborg baseport provided (\epoc32\release\armv5\urel &udeb)
Symbian Syborg source code provided (\sf\adaptation\qemu\baseport\syborg)
Binaries Required to create Symbian TextShell Rom Image
Pre-compiled QEMU (\symbian-qemu-0.9.1\bin)
QEMU
QEMU source code provided (\sf\adaptation\qemu\symbian-qemu-0.9.1-12)
QEMU environment compiled for win32 environment
Host
SF Mercurial repo - http://developer.symbian.org/oss/FCL/sf/adaptation/qemu
Copyright © 2009 Accenture. All Rights Reserved. 8
QEMU Simulator … its alive !
• First build a textshell Symbian ROM
Creates debug
textshell ROM
\sf\os\kernelhwsrv\kernel\eka\rombuild> rom -v syborg -i armv5 -b udeb image file
• Then run ROM image in QEMU
\symbian-qemu-0.9.1\bin> arm-none-symbianelf-qemu-system.exe
-kernel \sf\os\kernelhwsrv\kernel\eka\rombuild\syborgarmv5d.img
-M \sf\adaptation\qemu\baseport\syborg\syborg.dtb
-serial COM2 Launches ROM
image in QEMU
simulator
Copyright © 2009 Accenture. All Rights Reserved. 9
PRACTICAL 1
Instructions for Practical 1 & 2 & 3
Copyright © 2009 Accenture. All Rights Reserved. 10
QEMU – Output … and how it works
Debug Port
Kernel code -> Debug Handler -> Syborg
UART -> Host UART -> Host UART
Display
Board Model Configuration controlled by
EShell -> Console Windows Server -> DTS file
Screen Driver -> LCD Driver -> Frame
Buffer -> Host
Copyright © 2009 Accenture. All Rights Reserved. 11
Rebuilding Syborg
• Altering screen size
Modify KConfigLcdHeight to be 100 in \sf\adaptation\qemu\baseport\syborg\fb\Syborg_fb.h
• Adding debug print
Add Kern::Printf(“Hello World”) to void TPointerRv::Init3() in \sf\adaptation\baseport\syborg\pointer\syborg_pointer.cpp
• Building baseport
\sf\adaptation\qemu\baseport\syborg> sbs -b bld.inf -c armv5_udeb –j 1
• Shows the ease of modification of the environment
Copyright © 2009 Accenture. All Rights Reserved. 12
PRACTICAL 2
Copyright © 2009 Accenture. All Rights Reserved. 13
Debugging Simulator
• GDB Stop Mode Debugging
QEMU contains GDB stub which allows simulation environment to be controlled
by GDB debugger
GDB only understands ELF -> need to convert from Symbian E32 image
• Command Line -> Use Eclipse GUI
Further info http://developer.symbian.org/wiki/index.php/QEMU_&_Syborg_Debugging & \sf
\adaption\qemu\docs directory
Copyright © 2009 Accenture. All Rights Reserved. 14
Simulator Features
• Display driver
• Keyboard /keymapping
• Pointer driver
• Serial Pdd
• Ethernet Pdd
• Sound Pdd (dummy)
• Host file system (fsy + driver)
• Debug Monitor
Copyright © 2009 Accenture. All Rights Reserved. 15
Simulator Features Demo (1)
• Simple Console Application
• Source code - \sf\adaptation\qemu\applications\SymbianLogo_TextShell
• Build using command - sbs -b bld.inf -c armv5 –j 1
• Add application into ROM -
Modiify \sf\os\kernelhwsrv\kernel\eka\rombuild\Tshell.oby to include line
‘ #include <rom\include\symbianlogo.iby> ’
• Build ROM / Start ROM in QEMU
Copyright © 2009 Accenture. All Rights Reserved. 16
PRACTICAL 3
Copyright © 2009 Accenture. All Rights Reserved. 17
Simulator Features Demo (2)
• Type “symbianlogo” from prompt
Host File System
Pointer Driver
Keyboard Driver
Display Driver
• Where next with the demo
Have a play …
- Learning
- Port image codec onto Symbian
- Port audio assets, implement hooks to QEMU audio
hardware
- Don’t use console Wserv, create own implementation
for direct input events, create own UI
Copyright © 2009 Accenture. All Rights Reserved. 18
GUI environment …
SF GUI image
configuration running
in QEMU … not just
Text shell
SFL code plus
configuration required
to allow GUI to boot
All user space code is
common allowing for
rapid prototyping of
product images
Copyright © 2009 Accenture. All Rights Reserved. 19
QT UI environment …
QT apps running on top
of SF GUI image
Open source QT from
http://pepper.troll.no/
s60prereleases/
QT libs and example
apps built from
source then included
in Syborg ROM
Excellent usage of
prototyping future
technology
Copyright © 2009 Accenture. All Rights Reserved. 20
Next Steps …
• This is just the beginning…
– New/enhanced drivers & board model peripherals
– Configurations & new directions
– Contributions
• Questions ?
• Further information - \sf\adaptation\qemu\docs\
- developer.symbian.org –wiki,forum,articles
Copyright © 2009 Accenture. All Rights Reserved. 21