Virtual Machines for RTEMS Development

From RTEMSWiki

Jump to: navigation, search

Contents

This page describes the VirtualBox image of Fedora 12 with the RTEMS 4.10 development environment preinstalled for the i386 and SPARC targets. BSPs within these CPU families can be run on simulators inside the virtual Fedora 12 environment. The Fedora install has been stripped of multimedia and office applications to save space. This image is configured to support the following RTEMS activities

  • basic testing of sparc/sis BSP using sis simulator in gdb
  • basic testing i386/pc386 BSP using qemu
  • coverage analysis using i386/pc386 BSP using qemu
  • testing networked RTEMS applications with i386/pc386 BSP on qemu
  • testing graphical RTEMS applications with i386/pc386 BSP on qemu
  • using Eclipse with RTEMS plugin

Downloading

You will need to download and install the free VirtualBox virtual machine player in order to use this image. The image is available via BitTorrent.

Please be kind and leave your BitTorrent client running to share this file with others.

Accounts and Passwords

There are two user accounts with the following passwords:

root  with password Virtual0
rtems with password rtems

Support

If you have questions or issue, please joing the RTEMS User's Mailing List and ask them there. We will work with you to solve them.

If you would like a custom development environment, contact JoelSherrill

First Time

The first time you run the virtual environment, please log in as root and do an update. Launch a terminal window and enter:

yum -y update

After that completes, log out and login as the rtems user. You will spend most of your time as this user. You will want to update the RTEMS source tree using the following command sequence:

cd $r
cvs up -Pd 2>&1 | grep -v cvs
./bootstrap

The bootstrap will probably take 10-15 minutes to execute depending on the speed of your computer.


rtems user account

When you log in as rtems, your PATH is set properly to include the RTEMS 4.10 development tools and some scripts which assist in using CPU simulators to run RTEMS applications. You will also have the following environment variables set as shortcuts:

  • r = top of RTEMS source tree
  • b = top of BSPs with RTEMS source tree
  • c = cpukit directory
  • B = top of build directory

At this point you have a completely up to date RTEMS development environment and checked out copy of the development tree. You are set to work but before you do, let's run the precompiled sample executables provided in the environment.

BSP/Simulator Specific Details

SPARC/sis

The SPARC/SiS BSP is one of the easiest targets to work with in RTEMS. The simulator is quick and easy to run. The sample SPARC/sis executable is in $B/ticker-samples and can be run using the "sis" helper script as follows:

sis -i sparc-sis-ticker.ralf

The -i indicates that the program is to be run "interactively" with the output display as it is generated. The default is to output to a log file for subsequent analysis. When you want to debug, just use the following:

sis-gdb sparc-sis-ticker.ralf

At this point you will be sitting at a gdb prompt and can type run.

If that worked, now we can build your own sis executables. To make this easy, we have placed a configure command in a file so your first configure will not have typos. You can tinker with it later to match your project requirements. The build-sis file contains the configure command. It disables many RTEMS features and only builds the sample executables.

cd $B 
mkdir b-sis
cd b-sis
sh -x ../build-sis
make 

If that all works, you should have a few sample executables in the build tree. Executing the following command will show you the set of samples built:

find . -name "*.ralf"

Pick one and run it. The "fileio" sample is interesting. Pick the "s" option and login to the RTEMS shell. Use rtems or root as the account with no password.

sis -i .../fileio.ralf

And that's all there is to the SPARC/sis. For many projects, this simulator has suffient capabilities to support all your development and debug needs.

i386/pc386

Qemu is a simulator for a PC. It is a very robust simulator and we will focus in this on a very specific configuration. The PC is configured to use COM1 as the console. This allows us to redirect all console output to a file using standard UNIX redirection commands.

Qemu can simulate networking but we will not be exercising that in this example. If you are interested in that, please ask on the RTEMS User's mailing list. A future revision of the virtual machine may come with network examples.

The combination of the i386/pc386 BSP and Qemu results in one of the most complete simulation environments to run RTEMS in. Unfortunately, it is not always the easiest simulators to work with. You have to deal with PC boot issues, network configuration etc. But the results are worth it for the functionality you can test.

The sample i386/pc386 executable is in $B/ticker-samples and can be run using the "sis" helper script as follows:

qemu-rtems -i i386-pc386-ticker.exe

The -i indicates that the program is to be run "interactively" with the output display as it is generated. The default is to output to a log file for subsequent analysis. When you want to debug, you have to run Qemu in a gdb server mode. The current instructions do not cover that.

TBD

At this point you will be sitting at a gdb prompt and can type run.

If that worked, now we can build your own pc386 executables for qemu. To make this easy, we have placed a configure command in a file so your first configure will not have typos. You can tinker with it later to match your project requirements. The build-qemu file contains the configure command. It disables many RTEMS features and only builds the sample executables.

cd $B 
mkdir b-qemu
cd b-qemu
sh -x ../build-qemu
make 

If that all works, you should have a few sample executables in the build tree. Executing the following command will show you the set of samples built:

find . -name "*.exe"

NOTE: The .exe files are ELF and the .ralf are Netboot format.

Pick one and run it. The "fileio" sample is interesting. Pick the "s" option and login to the RTEMS shell. Use rtems or root as the account with no password.

qemu-rtems -i .../fileio.exe

Play around in the shell. When you are ready to quit type halt.

NOTE: Qemu sometimes has to be killed manually. If this occurs to you, "ps -ef | grep qemu". Note the process id (PID) and send it a "SIGHUP" signal via "kill -9 PID" where PID is the process id you obtained doing the "ps -ef" command.

And that's all there is to the i386/pc386 on Qemu. For projects which require PC compatability or require more functionality than sis has, Qemu is a great option.

Personal tools