RTEMS Real Time OS ported to the Pi


9 posts
by alanc98 » Sun Mar 31, 2013 12:14 am
Hi everyone,
I wanted to announce that I have the RTEMS Real time OS working on the Raspberry Pi.

RTEMS is a free open source Real Time Operating System that has a number of features including:
Integrated Newlib C library
File systems
Device driver model
POSIX APIs, including posix threads
A command line shell
C++ support,
Network stack and drivers

Now for the Raspberry Pi, I have just the very basics working: Just a UART console and timer tick for the OS. It would be great to get additional device support for the Pi in RTEMS. SD card support, GPIO, I2C, USB, Ethernet, all need to be added.
RTEMS is hoping to participate in the Google Summer of Code Project again this year, and improving the Pi BSP would be a great project to work on for a college student.

An RTEMS development environment can be a little bit tricky to get set up: it needs an RTEMS specific GCC cross compiler, the autoconf/automake tools, and the directory structure can be a little bit of work to get used to.
So to help get anyone get started, I created a guide on getting started with RTEMS on the Raspberry Pi here:
http://alanstechnotes.blogspot.com/2013 ... ry-pi.html

It walks you through getting the compiler setup, building RTEMS, and running a sample. Note, that it's all on Ubuntu 12.10, but it should work on any recent Linux, BSD, or OSX. Windows may be difficult for the RTEMS Git head, because it relies on the absolute latest autoconf/automake tools.

If you are familiar with RTEMS, the Pi BSP is in the RTEMS Git head, which will eventually become RTEMS 4.11 when it is released.
http://git.rtems.org/rtems

More information about rtems at:
http://www.rtems.org

I want to thank the people that contribute on this forum, I spent a lot of time studying the examples and running the code that was posted on here.

Alan
Posts: 9
Joined: Sat Jan 19, 2013 10:29 pm
by alanc98 » Wed May 08, 2013 1:06 am
If anyone is interested, I have fixed a bug in my RTEMS port and I created an example RTEMS application that anyone can use on the Pi.

My RTEMS application is here:
http://github.com/alanc98/rki

When you run it on the Pi, it brings up an RTEMS shell and formats a 64MB RAM disk. You can run a number of commands to get a feel for RTEMS, including a Dhrystone and Whetstone benchmark program.

I also updated my original instructions above.

Once I can start to add some peripheral support ( HDMI Console, SD Card, network, USB, etc ) RTEMS could become a truly useful OS for the Pi.

Alan
Posts: 9
Joined: Sat Jan 19, 2013 10:29 pm
by tastenmonster » Tue May 14, 2013 2:10 pm
Hi Alan,

I want to use your port on qemu rpi emulator by torlus. Have you ever tried to run on an emulator?

I am able to run basic "Hello world" binaries, but the intrrupt from the timers are missing.

Any hints?
Posts: 5
Joined: Tue May 14, 2013 1:44 pm
by alanc98 » Sat May 18, 2013 4:55 pm
tastenmonster wrote:Hi Alan,

I want to use your port on qemu rpi emulator by torlus. Have you ever tried to run on an emulator?

I am able to run basic "Hello world" binaries, but the intrrupt from the timers are missing.

Any hints?


Sorry, I have never tried the emulator. I'll have to give it a try.

Alan
Posts: 9
Joined: Sat Jan 19, 2013 10:29 pm
by JohnBeardmore » Sat May 18, 2013 7:34 pm
So is this essentially an RT linux, or a new OS written from scratch ?

Cheers, J/.
Posts: 84
Joined: Thu Nov 15, 2012 11:03 pm
Location: Derbyshire UK.
by tastenmonster » Mon May 20, 2013 8:32 am
alanc98 wrote:
tastenmonster wrote:Hi Alan,

I want to use your port on qemu rpi emulator by torlus. Have you ever tried to run on an emulator?

I am able to run basic "Hello world" binaries, but the intrrupt from the timers are missing.

Any hints?


Sorry, I have never tried the emulator. I'll have to give it a try.

Alan


Hi Alan,

I got it working with Torlus QEMU Patches http://www.raspberrypi.org/phpBB3/viewtopic.php?f=72&t=26561&start=50

Martin
Posts: 5
Joined: Tue May 14, 2013 1:44 pm
by alanc98 » Mon May 20, 2013 11:36 pm
tastenmonster wrote:
alanc98 wrote:
tastenmonster wrote:Hi Alan,

I want to use your port on qemu rpi emulator by torlus. Have you ever tried to run on an emulator?

I am able to run basic "Hello world" binaries, but the intrrupt from the timers are missing.

Any hints?


Sorry, I have never tried the emulator. I'll have to give it a try.

Alan


Hi Alan,

I got it working with Torlus QEMU Patches http://www.raspberrypi.org/phpBB3/viewtopic.php?f=72&t=26561&start=50

Martin


Great! I will have to give this a try.
I hope to work on SD card access next.
Alan
Posts: 9
Joined: Sat Jan 19, 2013 10:29 pm
by alanc98 » Mon May 20, 2013 11:52 pm
JohnBeardmore wrote:So is this essentially an RT linux, or a new OS written from scratch ?

Cheers, J/.


RTEMS is an open source real time operating system similar to vxWorks or eCos. It is not related to Linux ( I'm pretty sure it was created before Linux, maybe 20 years ago? )

RTEMS does not (yet) support memory protection by MMU or a process model, but it does have a fairly complete POSIX threads API, file system support, network stack, C library, etc.

More info here:
http://www.rtems.org

I currently use RTEMS on this:
http://mms.gsfc.nasa.gov

Alan
Posts: 9
Joined: Sat Jan 19, 2013 10:29 pm
by timr » Thu May 23, 2013 10:31 am
EPICS - Experimental Physics and Industrial Control System http://www.aps.anl.gov/epics/ is an interesting set of tools which is supported on RTEMS. (As well as VxWorks, linux, and windows)
EPICS is used in lots of interesting places, and has a wide range of drivers and tools, from interfaces to stepper motor drivers, data acquisition hardware and cameras, through to data display and database tools. Yes, it runs on RPi (linux)

tim
Posts: 22
Joined: Wed May 30, 2012 10:11 am