Symbian developer community

 
wiki

Kernel & Hardware Services Quick Start

From Symbian Developer Community

Jump to: navigation, search

The Kernel & Hardware Services package is the foundation upon which the rest of the platform is built. However, to run the Symbian kernel you need a baseport. That is, a port of the "base" parts of the Symbian platform for the hardware that you want to run it on. For other systems this is more typically known as a Board Support Package (BSP). This term is used in Symbian, but the "Board Support Packages" package is currently rather empty, containing only a soon-to-be-deprecated Windows emulator and some hardware abstraction interface tests.

At the time of releasing the kernel under the EPL we have two open source baseports available to enable wider use and experimentation, and hopefully to facilitate the creation of further baseports. One of the baseports is known as Syborg: It allows you to run ARM binaries for the Symbian platform on the popular QEMU emulator. The other baseport is for the low-cost BeagleBoard development platform with its OMAP3530 processor from Texas Instruments.

In addition to the open source baseports there is also a binary baseport for the offical Symbian^3 hardware reference platform - the Zoom II. It should be available for download from omapzoom.org.

Contents

Getting Started

To get the Symbian kernel building and running on a supported platform, you must follow a common set of steps:

  1. Get the tools.
  2. Set up the environment.
  3. Get the kernel source code.
  4. Get the baseport source code.
  5. Build the baseport.
  6. Create a ROM image.
  7. Load the ROM image on the target platform.

To help you get started faster we have created a Kernel Taster Kit for SEE 2009, which has most of step 2 and steps 3-6 already done for you. It includes source, pre-built binaries and ROM images for both QEMU/Syborg and BeagleBoard baseports.

The instructions below assume that you are using Microsoft Windows (XP or Vista - possibly even Windows 7). It is possible to build and run Symbian code on Linux, but that requires a little more effort - see these forum posts.

Get the Tools

To build Symbian platform code and baseports you must install:

  • A supported compiler.
    • There's a free version of ARM RVCT 4.0 available for use with Symbian (installation instructions here).
    • GCCE support is in progress.
    • ARM RVCT 2.2 is still the officially supported compiler for use with the platform.
  • A Product Development Toolkit (PDT) and its Perl and Python dependencies (installation instructions here). Note: To use RVCT 4.0 you'll need PDT 1.3 or later

Installing the Kernel Taster Kit

Download the Kernel Taster Kit

Next, open a command prompt, create a new folder (in the example below I call it Symbian_Kernel_Taster) and subst(itute) it with a drive letter (X: in the example):

C:\>mkdir Symbian_Kernel_Taster
C:\>subst X: Symbian_Kernel_Taster

Leave the command box open. (In Windows Explorer) Unzip the Kernel Taster Kit into the root of the subst'ed drive. You can use a tool like WinZip or the "Extract all files..." option in Windows Explorer.

Set Up the Kernel Taster Environment

In your command prompt, set the following environment variables:

C:\>set EPOCROOT=\
C:\>set path=\epoc32\tools;\epoc32\gcc\bin;%path%

These let the tools know where find the code and other tools. We use paths without a drive letter; this means that we have to run all commands that access Symbian tools from the subst'ed drive.

If you are using RVCT 4.0, and do not have RVCT 2.2 installed, you may (if your kit is misconfigured, which they all are at the moment. This is our fault -- TimBand, Raptor Product Owner) also need to set the following environment variables to prevent the toolchain from looking for RVCT 2.2 environment variables. Any values will do.

C:\>set RVCT22BIN=ignored
C:\>set RVCT22INC=ignored
C:\>set RVCT22LIB=ignored

Note: This just sets the environment variables for this one session in this specific command prompt. You can set them more permanently via the Control Panel or, preferably, by creating batch files to set them whenever you need them within a new shell.

Loading a ROM Image on a Target Platform

The Kernel Taster Kit comes with debug and release ROM images for Syborg and the BeagleBoard. They can be found in \epoc32\rom. It also includes pre-built Windows binaries for the QEMU simulator.

To run the Syborg ROM image on QEMU, enter the following in your command prompt (changing the drive letter as necessary):

C:\>X:
X:\>cd \symbian-qemu-0.9.1\bin
x:\symbian-qemu-0.9.1\bin>arm-none-symbianelf-qemu-system -M \sf\adaptation\qemu\baseport\syborg\syborg.dtb -kernel \epoc32\rom\SYBORGARMV5D.IMG
 

If everything is set up correctly, a QEMU window with a Symbian text shell should pop-up - looking something like this:

Syborg ROM running in QEMU

For more details about using QEMU and Syborg with Symbian, try this wiki page and for debugging instructions this one.

If you've got a BeagleBoard (or are willing to buy one) and want to run the BeagleBoard ROM image then follow the instructions in this article.

What Next?

Before going any further, you should validate your environment by rebuilding the Syborg baseport, re-creating the ROM and making sure you can still run it. Optionally, if you have a BeagleBoard, you may also want to rebuild the BeagleBoard baseport and ROM.

Building Syborg

Close your current QEMU window (if it's still running) and issue these commands from your command prompt:

 
X:\symbian-qemu-0.9.1\bin>cd \sf\adaptation\qemu
X:\sf\adaptation\qemu>sbs -s package_definition_2.0.1.xml -c armv5.rvct4_0 -k -j 4
 

This changes to the root directory of the QEMU package, which contains the Syborg baseport, and builds it with SBSv2 (aka Raptor) using RVCT 4.0. Depending on your PC it should take a little over three minutes to complete with zero errors and 136 warnings.

[Note: in fact armv5.rvct4_0 is not the "correct" way to do it, because armv5 imples RVCT2.2, and the .rvct4_0, while supplanting the compiler version, does not remove the requirement for the RVCT22... environment variables to be set; hence the workaround described above. The "correct" way to do it is -c arm.v5.udeb.rvct4_0 -c arm.v5.urel.rvct4_0 but I understand if you prefer the workaround while we work on something friendlier! In time, kits should come configured to use the correct RVCT by default and this won't be a problem for the vast majority of cases -- TimBand Product Owner, Raptor]

The package_definition_2.0.1.xml file tells Raptor what to build, while the -j 4 option specifies the number of compilations to attempt in parallel. The number 4 was selected to ensure maximum utilisation of a typical dual-core system. It should work fine if you only have a single core.
Next, build the ROM image using these commands:

 
X:\sf\adaptation\qemu>cd \sf\os\kernelhwsrv\kernel\eka\rombuild
X:\sf\os\kernelhwsrv\kernel\eka\rombuild>rom --variant=syborg --inst=armv5 --build=udeb --type=tshell --name=\epoc32\rom\SYBORGARMV5D.IMG
 

This changes to the directory where the rom building tools are located and then creates a Syborg ROM. The parameters are:

  • --variant identifies a folder in \epoc32\rom which contains IBY files specifying the target-specific binaries to be included in the ROM
  • --inst identifies the target architecture
  • --build determines whether debug or release binaries are to be used
  • --type=tshell selects the tshell.oby file from the current directory which then specifies the names of the IBY files to get from the variant directory and the remaining IBY files required to define a standard text shell ROM
  • --name specifies the output image file name

Assuming the ROM is generated without errors you can now repeat the steps from the previous section to run the image on QEMU.

Building BeagleBoard

To rebuild the BeagleBoard baseport and generate a ROM, use these commands:

 
X:\>cd \sf\adaptation\beagleboard
X:\sf\adaptation\beagleboard>sbs -s package_definition_2.0.1.xml -c armv5.rvct4_0 -j 4
X:\sf\adaptation\beagleboard>cd \sf\os\kernelhwsrv\kernel\eka\rombuild
X:\sf\os\kernelhwsrv\kernel\eka\rombuild>rom --variant=beagle --inst=armv5 --build=udeb --name=\epoc32\rom\BEAGLEARMV5D.IMG
 

Note: The tshell option that we used above (to create our Syborg ROM) is actually the default so we have not specified it this time.

Now that you have proven that you can rebuild and run your ROM you can begin exploring and modifying source on your own. Here is a simple starting point: Kernel & Hardware Services - Things To Try.

Troubleshooting

Having problems getting started? Common problems and their solutions can be found on this page, please leave comments about your specific problems (rather than errors in the instructions) there.

Summary

If you've worked through this article and the linked instructions you should have a working environment for experimenting with the Symbian kernel and the supplied baseports. You should be able to build the open source baseports and generate ROM images.

What next? Well, here are some things to try.

References & Further Reading

Comments

Royerfa said…

Hi, I would like to add a warning on this wikipage. I use to have a Kernel panic when I was booting Symbian on the Beagle after following the above wiki instructions. Actually I noticed that if you first do a Syborg build followed by a build for the Beagle board. The image BEAGLEARMV5D.IMG would boot with kernel panic

Fault Category: TPS65950SpurioustInt Fault Reason: 00030005 ExcId bdbbdffd CodeAddr 80006108 DataAddr e7b7dffb Extra ab33dcde

But When I start again from scratch and I do directly a build for Beagle board I have an Image BEAGLEARMV5D.IMG which boot sucessfully.

Obviously there is a defect with the Build tools.

--Royerfa 14:15, 21 January 2010 (UTC)

William roberts said…

Please could you raise a defect for this, and if possible include the rom build logs for both working and non-working BEAGLEARMV5D.IMG ROMs. We didn't encounter this problem when testing the Kernel Taster Kit, but perhaps the folk with Beagleboards concentrated on their ROMs and didn't do the Syborg build first.

--William roberts 13:37, 25 January 2010 (UTC)

Sign in to comment…