Back to Syborg on Linux, with GCCE
In my “Syborg” article I made the point that Syborg – the Symbian kernel port that runs on QEMU – is a breakthrough for Symbian development on Linux. Symbian virtual devices with the Syborg kernel, running in the QEMU virtual machine environment, offer the same emulated Symbian development target under both Windows and Linux. The Symbian Emulator of yore was Windows-bound.
I did some experimental work to show that, with fairly superficial hacks, the Syborg kernel could be built, and a Symbian textshell ROM could be built and run on Ubuntu Linux using the code base of Symbian^2.0.0. I wrote up my findings and posted them on the Symbian developer wiki:
How to build the Syborg/QEMU baseport for Symbian^2.0.0 on Ubuntu Linux
How to build Symbian QEMU on Ubuntu Linux
How to build and run a Syborg/QEMU textshell ROM on Ubuntu Linux
Toward Symbian development by open source means
These efforts represent initial moves toward the goal of making Symbian development doable with wholly open source means.
That goal entails making Symbian development doable on Linux. So knowing that it’s already practical to build and run a rudimentary Symbian vm on Linux is an important encouragement.
Those efforts fell short, however, of demonstrating how to build and run a Symbian vm by wholly open source means. I cheated on three points:
- I didn’t have an open source compiler that could build Syborg. I used ARM’s proprietory RVCT compiler v2.2, for which Symbian has licenses.
- I didn’t build the necessary ROM-building tools for Linux. So far, Symbian kits provide only Windows executables for these tools and though they are open source, they haven’t been ported to Linux. I let Ubuntu execute the Windows executables via the Wine program loader.
- I didn’t have an open source installation of the Symbian build system, sbsv2 (a.k.a. “raptor”). Raptor is also open source, and runs on Linux, but the Linux installer for Raptor is not open source, yet. I didn’t know how to install it from first principles, so I used a binary preview of the installer, obligingly furnished by the Raptor team in Nokia.
This last cheat was unimportant. The Linux Raptor installer will emerge from the contribution pipeline in due course, and in any case I soon afterwards figured out how simple it is to build Raptor on Ubuntu by conventional GNU make methods: the apparatus is all already present and correct in the source.
But the first and second cheats side-stepped real obstacles. Not having an open source compiler that can build the Syborg kernel is hardly less of a problem than not having Syborg. And even when you have built Syborg, without the ROM tools you can’t create a QEMU vm image from it. I didn’t have any idea what size of a task porting the ROM tools for Linux might be.
GCC 4.3 for Symbian
The news from both of these fronts is good. Early in November CodeSourcery, the embedded GCC compiler specialists, finalised a free release of the GCCE (”E” for embedded) v4.3.3 toolchain supporting Symbian on ARM devices. It’s called “G++ Lite for ARM Symbian OS”, and you can get it here, for both Windows and Linux. This release has generated an upsurge of activity in the Symbian community directed at porting the platform to GCCE. The kernel, inevitably, is the prime objective of these efforts. To pull them together, we now have a landing page up on our developer Wiki, The GCCE Toolchain Initiative.
ROM tools for Linux
Building the ROM tools on Linux turns to be a light-to-middling porting job that I’m equal to. I cloned out the build tools package source from its Mercurial repo, http://developer.symbian.org/oss/MCL/sftools/dev/build/, and identified the components I’d need to build a ROM. (Strictly they’re not all ROM tools: there’s a couple of tools in there you need just to build the Syborg kernel – elf2e32, checklib). I studied their MMP files (the Symbian build system’s “build recipe” files), wrote equivalent GNU make files, and then started trying to build the stuff with the the standard GNU/Linux GCC 4.3 toolchain and libraries as shipped with Ubuntu 9.04, plus the Symbian public headers as we shipped them in PDK 3.0.b.
As I encountered failures, I devised fixes and carried on. Mostly these fixes are superficial enough that I can be apply them via the makefiles: they’re to do with GCC 4.3’s more up-to-date and rigorous C++ Standard compliance, versus compilers that the code has previously known; or they’re to do with the fact that the Linux/x86/GCC build configuration isn’t one that the code yet supports. I’ve come across just one component in the build tools thus far ( the sisutils library) that’s thoroughly wedded to Windows APIs and will need thoroughly reworked for portability. But it’s not a library I need to make a ROM.
I’ve built the stuff I need to build a ROM and am familiar enough now with the build tools source to be confident that it will not be difficult to bring up the whole package on Linux. That’s a project I’d naturally like to nudge along, and I’ll get back to it another blog. I’ve committed my work-in-progess to a Mercurial FCL at http://developer.symbian.org/oss/FCL/interim/sftools/linux_build/.
And then again, Syborg
Meantime, I still can’t build a ROM with wholly open source means. Armed with GCCE. QEMU and my ROM tools, I turned to building the Syborg kernel. But that proves not to be a walk in the park. In theory, GCCE will do it. In reality there is a thorny thicket of things that GCCE objects to about the kernel source and I’ve yet to see daylight at the other side of it.
But happily here I have common cause with the brains engaged in the aforementioned GCCE Toolchain Initiative. The thorny problems lie between that compiler and the kernel. Linux isn’t implicated. The Toolchain Initiative is well-connected with the Kernel & Hardware Services team in Nokia, and a GCCE shipshape kernel will surely get committed to our master codeline in the next couple of months, whether or not I do anything to help it. I’ve done a bit to help, by way of committing half-a-dozen “Compiler Compatibility” bugs based on my GCCE kernl-building experience.
Then it will be possible to build and run a Symbian vm by wholly open source means. Or at least it will be possible to start discovering the bugs in my Linux ROM tools.
Be the first to comment.