Rtems Installation Procedure
Rtems Installation Procedure
estec
European Space Research and Technology Centre Keplerlaan 1 2201 AZ Noordwijk The Netherlands T +31 (0)71 565 6565 F +31 (0)71 565 6040 www.esa.int
Date From To
DESCRIPTION
This document provides information for the installation of RTEMS 4.8 with the PC386 BSP and QEMU under Ubuntu Linux. This will allow the user to execute RTEMS applications on top of QEMU.
The reference documentation can be found on the RTEMS official website. For the 4.8 release serie, the link is the following: http://rtems.com/onlinedocs/releases/rtemsdocs-4.8.0
The tools can also be used within a virtual machine provided with this document. This virtual machine is a VMWare image that can be run with VMWare Player. The user account is rtems, password is rtems.
Page 1/6
4.1
4.2 Configuration
Target: i386-rtems RTEMS BSP: pc386
5 5.1
apt-get install qemu cvs patch texinfo libc6-dev gcc4.3 gcc-4.1 libgmp3-dev libmpfr-dev automake autoconf
5.2
5.2.1
5.2.2
GDB
5.2.3
GCC
5.2.4
NEWLIB
5.2.5
Mirrors
If you encounter some issues while downloading the sources, copies are available at http://rtems.com/ftp/pub/rtems/SOURCES
5.3
The RTEMS release can be found at http://rtems.com/ftp. You can download it using the following command. cd build && http://www.rtems.com/ftp/pub/rtems/4.8.2/rtems4.8.2.tar.bz2
5.4.2
Download patches
Patches can be found using a web browser at http://www.rtems.com/cvsweb They are contained in the directory rtems/contrib/crossrpms/patches directory for the 4-8-branch of RTEMS.
5.5
5.6
Apply patches
We assume that patches are contained in the /home/rtems/build/patches directory. They can be found on the CVS repository, in the directory rtems/contrib/crossrpms/patches for the branch 4-8-branch.
5.6.1
Binutils
5.6.2
GCC
5.6.3
Newlib
5.6.4
GDB
5.7
5.7.1
cd build && mkdir b-binutils && cd b-binutils && CC=gcc-4.1 ../binutils-2.18/configure target=i386rtems4.8 prefix=/home/rtems/local
5.7.2
cd build && cd gcc-4.2.4 && ln s ../newlib1.15.0/newlib . && cd .. && mkdir b-gcc && cd b-gcc && PATH=/home/rtems/local/bin:$PATH ../gcc-4.2.4/configure target=i386-rtems4.8 prefix=/home/rtems/local withgnu-as with-gnu-ld with-newlib verbose enablethreads enable-languages=c
Page 4/6 Date 25/11/2010 Ref
5.7.3
cd build && mkdir b-gdb && cd b-gdb && PATH=/home/rtems/local/bin:$PATH ../gdb-6.8/configure target=i386-rtems4.8 prefix=/home/rtems/local
At first, you have to set the RTEMS_MAKEFILE_PATH variable to the directory that corresponds to your RTEMS BSP. You can do that with the following command line:
cd && mkdir examples && cd examples && wget http://www.rtems.com/ftp/pub/rtems/4.8.2/examples-4.8.2.tar.bz2 && tar jxvf examples-4.8.2.tar.bz2 Then, build and run the hello_world_c example
Page 5/6 Date 25/11/2010 Ref
cd && cd examples/examples-4.8/hello_world_c/ && make && cd o-optimize && qemu fda /home/rtems/rtemsboot.img hda fat:. boot a Then, once in QEMU, type the following lines in grub set root=(hd0,0) multiboot (hd0,0)/hello.exe boot
When you build the example, it creates the binary in the o-optimize directory. Then, to run it with QEMU, you need a bootloader. This is provided by the rtemsboot.img image file (available at http://www.rtems.com/ftp/pub/rtems/qemu/i386-pc/ ). Then, when you start GRUB, you need to tell it to use this file as a boot image. This is done with the fda option (which indicates the image for a floppy disk) and the boot a option (that indicates you boot on the floppy disk). Then, the had fat:. option is used to specify that the current directory is used as an harddrive. Once you are in grub, you have to tell grub that the root device is the harddrive. This is done with the set root=(hd0,0) command. Finally, you need to load the binary, indicating its location on the system. Here, the binary is on the harddrive considered by GRUB, so, (hd0,0). You load RTEMS application with the multiboot command, so, you use the following command to launch the hello.exe binary: multiboot (hd0,0)/hello.exe . Finally, you start the system using the command boot.