next up previous contents
Next: Get, build and install Up: Infrastructure - Tools and Previous: Get and build the   Contents


Get, build and install RTEMS

Download the RTEMS source from the OAR web server.

The source releases are available at

The compressed tar archive in this directory can be downloaded using a web browser or a command-line program such as curl or wget:

curl --remote-name
wget --passive-ftp --no-directories --retr-symlinks
Depending on the type of firewall between your machine and the OAR FTP server you may need to remove the --passive-ftp option from the wget command.

When you are done you should have the compressed archive with a name something like


Unpack the RTEMS sources

Change to your RTEMS source directory and unpack the RTEMS sources by:
bzcat rtems-4.9.2.tar.bz2 | tar xf -
This will create the directory rtems-4.9.2 and unpack all the RTEMS source into that directory.

Make changes to the RTEMS source to reflect your local conditions.

Some of the board-support-packages distributed with RTEMS may require modifications to match the hardware in use at your site. The following sections describe changes commonly made to two of these board-support-packages.


The linker script distributed with RTEMS assumes an MVME167 with 4 Mbytes of on-board memory starting at location 0x00800000. A more common configuration is 16 Mbytes of memory starting at location 0x00000000. To reflect this configuration make the following changes to
@@ -24,8 +24,8 @@
  * Declare some sizes. Heap is sized at whatever ram space is left.
-_RamBase = DEFINED(_RamBase) ? _RamBase : 0x00800000;
-_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
+_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 16M;
 _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0;
 _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
@@ -35,7 +35,7 @@
       This is where we put one board. The base address should be
       passed as a parameter when building multiprocessor images
       where each board resides at a different address. */
-  ram  : org = 0x00800000, l = 4M
+  ram  : org = 0x00000000, l = 16M
   rom  : org = 0xFF800000, l = 4M
   sram : org = 0xFFE00000, l = 128K


A change I like to make to the RTEMS pc386 source is to increase the number of lines on the console display from 25 to 50 since I find that the output from some EPICS commands scrolls off the display when only 25 lines are present. To make this change, add the `#define' line shown below
 #include <bspopts.h>
 #define RTEMS_VIDEO_80x50
 /*--------------------------------------------------------+ | Constants

Another change I make is to automatically fall back to using COM2: as a serial-line console (9600-8N1) if no video adapter is present. This allows the pc386 BSP to be used on conventional PCs with video adapters as well as with embedded PCs (PC-104) which have no video adapters. To make this change, add the `#define' line shown below

  rtems_termios_initialize ();

   * If no video card, fall back to serial port console

Build and install RTEMS

  1. It is best to start with a clean slate. Create a new directory in which to build or clean out all files in your existing build directory.

  2. Configure RTEMS for your target architecture:
    cd /usr/local/rtems-4.9.2/build
    .../rtems-4.9.2/configure -target=powerpc-rtems4.9.2 \
      -prefix=/usr/local/rtems/rtems-4.9.2 \
      -enable-cxx -enable-rdbg -disable-tests -enable-networking \
      -enable-posix -enable-rtemsbsp=mvme2100 \
    You should replace the `powerpc' with the name of the architecture for which you're building RTEMS. Common alternatives are `m68k' and `i386' for the Motorola M68k and Intel x86 family of processors, respectively. You should replace the `mvme2100' with the board-support packages for your particular hardware.

    If you've got lots of free time and disk space you can omit the --enable-rtemsbsp argument in which case all possible board-support packages for that architecture will be built. You can build for more than one board-support package by specifying more names on the command line. For example, you could build for a Arcturus uCDIMM ColdFire 5282 system and an MVME-167 system by:

    cd /usr/local/rtems-4.9.2/build
    .../rtems-4.9.2/configure -target=m68k-rtems4.9.2 \
          -prefix=/usr/local/rtems/rtems-4.9.2 \
          -enable-cxx -enable-rdbg -disable-tests -enable-networking \
          -enable-posix -enable-rtemsbsp="uC5282 mvme167" \

  3. Compile and install:
    make -w
    make -w install

next up previous contents
Next: Get, build and install Up: Infrastructure - Tools and Previous: Get and build the   Contents
Eric Norum
Mon Oct 19 11:30:39 CDT 2009