Tuesday, May 7, 2013

An RTEMS Application Framework - RKI

Building and Running an RTEMS Application


Introduction

In the previous entries, I described how to set up an RTEMS development environment for the Raspberry Pi on an Ubuntu 12.10 system, build RTEMS, and run a sample program on the Pi. This entry will describe how to build and run a more complicated application.


RTEMS Kernel Image

The name of my application is called the RTEMS Kernel Image or RKI. You may have noticed that RTEMS is hard enough to set up a development environment. Unless you are using the examples that can be downloaded, it can be a bit more work to put together your first standalone RTEMS application. Other real time operating systems such as vxWorks have the tools to configure and create a base "kernel image" for your processor card. This RKI project is an attempt to provide a similar environment. If nothing else, it will provide an example of how to put together an RTEMS application that consists of multiple C files.


Installation

If you have the arm-rtems4.11 tools installed, and the Raspberry Pi RTEMS BSP compiled and installed on your development machine, then this next step is pretty simple.


1. Clone my RKI git repository:

$ git clone http://github.com/alanc98/rki.git

2. Switch to the rki/build-arm-rpi directory

$ cd rki/build-arm-rpi

3. Edit the Makefile and adust the environment

In this case, I am using the same directories we used in the tool setup.

Set the following variables in the makefile

##
## paths for the RTEMS tools and RTEMS BSP
##
RTEMS_TOOL_BASE=$HOME/development/rtems/compiler/4.11
RTEMS_BSP_BASE=$HOME/development/rtems/bsps/4.11

4. Now, just build:

$ make

You will end up with a binary file called rki.bin. Copy that to your SD card as kernel.img and you are ready to try it out.

For more details, see the readme file in the project, and spend some time checking out how the application is put together.

github RKI site


Whats next?

Eventually, I would like to see full perpheral support for the Raspberry Pi. We still need to add support for things like:

  • SD Card support - Ability to mount, read, and write files

  • USB and Network support

  • HDMI Console Support

  • Some sort of Graphics support - Could RTEMS use the GPU?

In addition, RTEMS has a few things on the horizon including a dynamic loader and support for porting BSD drivers.