Symbian developer community

 
wiki

How to build and run a Syborg/QEMU textshell ROM on Ubuntu Linux

From Symbian Developer Community

Jump to: navigation, search

These instructions have been verified on Ubuntu 9.04.

These instructions follow on from How to build the Syborg/QEMU baseport for Symbian^2.0.0 on Ubuntu Linux and How to build Symbian QEMU on Ubuntu Linux

I assume that, following those HowTos, you have built the syborg baseport under ~/syborg/epoc32/release/armv5, and that you have build the QEMU executable at:

~/syborg/sf/adaptation/QEMU/symbian-qemu-0.9.1-12/bin/qemu-system-arm

Contents

Install Wine

 
$ sudo apt-get install wine
 

Installing Wine (the Windows emulator) looks like a cheat, but it is needed only for running rombuild.exe as provided in your PDK. Installing Wine is all you need to do with it. Ubuntu 9.04 or later will automatically invoke the Wine program loader when an .exe is to be run.

I have built rombuild natively on Ubuntu, but it called for a lot of hacking in the Symbian^2 system headers as well as the rombuild source. The system headers are subject to major revision for Symbian^3 at the time of writing, so the validity of my rombuild hacks is likely to be shortlived. I will return to building rombuild on Ubuntu when the Symbian system headers are stabilised, Meantime, Wine avoids the need for it.

Download Linux perl scripts you will need to build a ROM

The rombuild wrapper script rom.pl that you will find in ~/syborg/sf/os/kernelhwsrv/kernel/eka/rombuild assumes a Windows environment. You will instead need to run the script rom_unix.pl that I have uploaded as File:Rom unix.txt

rom_unix.pl needs to invoke another script, oby2unix.pl, that I have uploaded as File:Oby2unix.txt. This is a quick hack. The work done by oby2unix.pl should be folded into a proper port of rom.pl.

Download File:Rom unix.txt and File:Oby2unix.txt into ~/syborg and rename them rom_unix.pl and oby2unix.pl respectively.

Fix portability bugs in the perl modules loaded by rom_unix.pl

 
$ export EPOCROOT=~/syborg/<br>
$ cd ${EPOCROOT}epoc32/tools<br>
 

Need to excise the loading of non-portable and redundant Windows support in e32plat.pm

 
$>sed -e 's/use Winutl;/# use Winutl;/g' -i e32plat.pm
 

Fix various case-sensitivity offenders

 
$ mv e32plat.pm E32Plat.pm<br>
$ mv armutl.pm Armutl.pm<br>
$ mv bpabiutl.pm BPABIutl.pm<br>
$ mv e32variant.pm E32Variant.pm<br>
 

These case sensitivity bugs arise because for perl modules, just standardising on lowercase filenames isn't enough. The filename still needs to match the package name withiin the module case-sensitively, and in these instanances, lowercasing the filenames has broken that match.

Fix invalid #includes in the textshell oby file

We need to edit /sf/os/kernelhwsrv/kernel/eka/rombuild/tshell.oby to change all <...> #includes to "..." , and all enclosed backslashes to forward slashes.

 
$ cd $EPOCROOT<br>
$ sed -e 's/<\(.*\)>/\"\1\"/g' -e 's|\(..\)\\\(.\)|\1/\2|g' -i sf/os/kernelhwsrv/kernel/eka/rombuild/tshell.oby<br>
 

Deploy the Linux rom building scripts

Make the scripts executable.

 
$ if [ ! -x rom_unix.pl ]; then chmod +x rom_unix.pl; fi<br>
$ if [ ! -x oby2unix.pl ]; then chmod +x oby2unix.pl; fi<br>
 

Symlink the scripts into the rombuild directory

 
$ cd sf/os/kernelhwsrv/kernel/eka/rombuild
$ if [ ! -e rom_unix.pl ]; then ln -s ${EPOCROOT}rom_unix.pl rom_unix.pl; fi<br>
$ if [ ! -e oby2unix.pl ]; then ln -s ${EPOCROOT}oby2unix.pl oby2unix.pl; fi<br>
 

Build the syborg debug and release ROMs

 
$ rom_unix.pl -v syborg -i armv5 -b udeb --noheader<br>
$ rom_unix.pl -v syborg -i armv5 -b urel --noheader<br>
 

All being well, you will find the debug and release ROM images at:

~/syborg/sf/os/kernelhwsrv/kernel/eka/rombuild/SYBORGARMV5.IMG

~/syborg/sf/os/kernelhwsrv/kernel/eka/rombuild/SYBORGARMV5D.IMG

Boot the release ROM

 
$ export PYTHONPATH=${EPOCROOT}sf/adaptation/QEMU/symbian-qemu-0.9.1-12/qemu-symbian-svp/plugins<br>
$ cd ${EPOCROOT}sf/adaptation/QEMU/symbian-qemu-0.9.1-12/bin<br>
$ ./qemu-system-arm -M ${EPOCROOT}sf/adaptation/QEMU/baseport/syborg/syborg.dtb -kernel ${EPOCROOT}sf/os/kernelhwsrv/kernel/eka/rombuild/SYBORGARMV5.IMG<br>
 

All being well, the Symbian textshell will boot in a QEMU window.

Comments

Hamishwillee said…

There are a bunch of topics on how to build and run QEMU/Syborg in the wiki now, on various flavours of Ubuntu, Symbian^ and textshell or full ROM. Can we organise these better? Ie combine them into one document, or make some of them sub-topics?

Minimally it would be good to have a parent topic "How to build and run Syborg & QEmu" which links to all of the related topics and can act as a parent topic. ... Or have parent links from http://developer.symbian.org/wiki/index.php/Syborg_%26_QEMU.

--Hamishwillee 00:01, 26 November 2009 (UTC)

Arunabha said…

@ Hamish ,

Yes , I very well agree.

One suggestion - We should do a proper distinction between -

1. "Building Syborg" - Which for me is building the Syborg baseport to generate an rom.image (Textshell/UI) that runs on QEMU.

2. Building QEMU - Is building the QEMU Simulator itself from source. This gives you a flavours of QEMU for different targets/supports.

The names what we use (Building Syborg/QEMU) are confusing at times.May be its the correct time to call it SVP (Symbian Virtual Platforms)

--Arunabha 14:20, 26 November 2009 (UTC)

Hamishwillee said…

Hi Arunabha If these are logically separated options - ie a version of Syborg is QEMU independent - then I agree. You'd have a bunch of topics on getting QEMU set up on different hardware, linking to a bunch of topics on building roms that will work with QEMU.

Do you need my help to structure this? Or do you want to work with your teams to do this?

Regards H

--Hamishwillee 07:48, 27 November 2009 (UTC)

Sign in to comment…