RTEMS for Embedded Software Developers/Getting Started

RTEMS uses a patched version on the Gnu tools to compile RTEMS. This chapter will cover:

  1. building the RTEMS Toolset
  2. building/using a bootloader
  3. configuring RTEMS
  4. RTEMS Eclipse Plug-in
  5. using RTEMS on a hardware emulator
  6. using RTEMS on hardware

RTEMS ToolsetEdit

Although there are pre-built tools that can be installed on some platforms, some developers may desire to install the RTEMS toolset on a different platform, or install a more recent or more mature version of the RTEMS toolset on their machine.

RTEMS applications are designed to run on a different operating system (RTEMS as opposed to Windows, Mac, or Linux) and different hardware than the system the development is done on (such as Sparc, Arm or m68k as opposed to an x86-64). The tool set is a specially patched and configured version of binutils, newlib, and gcc. As this is a text book, this material will be presented in a lengthy explanatory fashion—the how-to can be found on the RTEMS website.

First, the platform must support patching code, writing configure scripts from configure.ac meta-scripts, generating Makefiles from Makefile.ams, and compiling the cross-compiler. Different platforms require different processes to achieve this goal. Ideally, this text will eventually include how to build the toolset on Windows, Mac, and Linux.

Getting the RTEMS ToolsetEdit

To get the RTEMS Toolset follow the directions at http://www.rtems.org/wiki/index.php/RTEMS_Development_Hosts

More on this topic can be found at:

How to build the tools from scratch http://www.rtems.org/wiki/index.php/Building_the_RTEMS_toolset_on_Ubuntu

Ideas for a Windows Installer: Using NSIS: see rtems/contrib/mingw at http://git.rtems.org/rtems/tree/contrib/mingw

Building RTEMSEdit

RTEMS has the following switches:

  1. list and describe them

RTEMS can be built for multiple architectures simultaneously. For our m68k example, we select the Coldfire architectures (because that is the m68k architecture that QEMU emulates), and the sim68000 (because that's what the RTEMS-GDB runs).

../rtems/configure --target=m68k-rtems4.11 --enable-tests=samples --enable-rtemsbsps=all
gmake RTEMS_BSP="av5282 uC5282"
gmake CC=/opt/rtems-4.11/bin/m68k-rtems4.11-gcc install

building/using a bootloaderEdit

This is a stub. The reason for covering the bootloader is to inform new developers how to get their code to run on a board without binary modification. Need a table of hardware RTEMS has been ported to and bootloaders that work with them. Possible reference:

http://en.wikipedia.org/wiki/Comparison_of_boot_loaders.

Some references for bootloaders for different architectures can be found in the Debian installer manual

http://wiki.debian.org/BootLoader

This subsection covers:

GRUBEdit

Micro MonitorEdit

A boot loader for a variety of hardware...

Reference material: http://www.rtems.org/wiki/index.php/MicroMonitor

http://www.microcross.com/html/micromonitor.html

SILOEdit

U-BootEdit

Insert information about the Universal Bootloader (U-Boot).

Building U-BootEdit

To compile U-Boot from the source, the typical steps are taken are similar to free-electrons.com/doc/u-boot.pdf:

  1. Look in boards.config for the correct configuration
  2. Configure U-Boot for the board using gmake eb_cpu5282_config
  3. Build U-Boot for the board using gmake CROSS_COMPILE=m68k-rtems4.11-

other bootloaders needed for hardware architectures RTEMS runs onEdit

A reference for filling out this section is: http://www.rtems.com/wiki/index.php/Building_Grub and http://www.rtems.org/wiki/index.php/QEMU

(Documentation will have to be written and posted on another web page first, and cited, so as not to put original work on Wikibooks) For demonstration purposes, the coldfire-m68k example may use u-boot. http://git.denx.de/?p=u-boot/u-boot-coldfire.git

RTEMS Eclipse Plug-InEdit

This is a stub. The reason for covering the RTEMS Eclipse Plug-In is to ensure material in the book is forward-looking. Other RTOSs use integrated development environments, and new RTEMS developers may find using Eclipse increases their productivity. For filling out this section reference:

http://www.rtems.org/wiki/index.php/RTEMS_Eclipse_Plug-in .

http://www.rtems.org/wiki/index.php/RTEMS_Eclipse_Information .

http://www.fogel.ca/2008/10/02/getting-eclipse-and-java-working-on-debian/ .

http://stackoverflow.com/questions/6044138/remote-debugging-in-eclipse-cdt

Using RTEMS on a Hardware EmulatorEdit

Building QEMUEdit

Qemu uses the zlib compression library, and the sdl library, which must be installed before building QEMU. To build QEMU This is a stub. Reference to draw ideas from for why Qemu:

lwn.net/images/conf/rtlws11/papers/proc/p09.pdf

The reason for covering a hardware emulator is because some RTEMS developers lack continual access to actual hardware. For filling out this section reference: http://www.rtems.org/wiki/index.php/QEMU (If possible, running Qemu out of eclipse should be documented elsewhere, such as the RTEMS wiki, and cited, so as not to put original work on Wikibooks, and included in this section)

1. Getting Qemu to run from Eclipse http://www.codeconfidence.com/technote-0002.shtml

2. Getting GDB and DDD to run from Eclipse

Walk reader through using DDD to debug RTEMS.

Example for using DDD to debug a native C program

http://www.youtube.com/watch?v=CkJRruFzwLM&feature=fvwrel

Slideshow of how to debug Uboot on Qemu using GDB on the command line

files.meetup.com/1590495/debugging-with-qemu.pdf

Post explaining how to run U-boot as a stand-alone on QEMU http://old.nabble.com/can-u-boot-run-standalone-in-qemu%28qemu-system-arm%29-without-kernel-image%28for-mainstone-II%29-td17534853.html

How to get Eclipse to build uboot and launch a debug session... http://www.at91.com/forum/viewtopic.php/t%2c20216/

Using RTEMS on HardwareEdit

This is a stub. Ideally loading executables on at least two board support packages should be covered. Again, documenting IDE support will be an end-goal.

Reference for getting RTEMS to work on LEON3 using Xilinx. http://www.rte.se/blog/blogg-modesty-corex/index