picoTK makes a compact and easy to integrate GUI add-on for the RTEMS real-
time operating systems. RTEMS is an OpenSource POSIX compliant real-time
kernel written and maintained by the Online Application Research
Corporation, Huntsville, AL. RTEMS is available for many embedded 32-bit
platforms, including the PC, the Motorola PowerPC and the 68K. The most
current versions of RTEMS now support TCP/IP networking, making it suitable
for internet connected appliances. RTEMS is for real-time world, what Linux
is for the dektop/server OSses.
The following describes how to install RTEMS for a Linux development host
and a PC (i386) target. The required GNU C/C++ cross-compiler toolchains
for other host/target pairs are available precompiled from OAR's site
http://www.oarcorp.com/ as well. I personally used a SuSE 7.0 Linux
system - any other current Linux distribution shall do as well.
The following steps summarize the installation of RTEMS 4.5, the required additional tools for creating PC bootable floppy disks and linking of the picoTK demo application.
Get the following files from
These are the precompiled toolchain packages for i386/i386 host/target combination.
(for i386 Linux host, i386-Target): .../c_tools/linux_x86/RPMS/i386-rtems/ i386-rtems-binutils-22.214.171.124.24-1.i386.rpm i386-rtems-gcc-gcc2.95.2newlib1.8.2-7.i386.rpm i386-rtems-gdb-4.18-4.i386.rpm .../c_tools/linux_x86/RPMS/shared/ rtems-base-binutils-2.95.2newlib1.8.2-7.i386.rpm rtems-base-gcc-gcc2.95.2newlib1.8.2-7.i386.rpm rtems-base-gdb-4.18-4.i386.rpm
This is the RTEMS source. We have to compile it using the above toolchain.
RTEMS Bootloader. Allows booting RTEMS from floppy disk.
Simple test program. Instructive for building your own Makefiles.
Become root. From the directory where you collected the RPMs type:
rpm -i rtems-base*rpm i386-rtems*rpm
(Accidently the alphabetic order implied by the bash wildcards gets the RPMs installed in the right order)
.../ export PATH=$PATH:/opt/rtems/bin
Assuming you use
bash as your command shell. It is only needed for the
following initial compilation of RTEMS itsel. Your own projects will find
the compiler using a special environment variable as described in section
"Set the environment"(
Become an ordinary user. Create directory "rtems" somewhere in your home, e.g. /home/thomas/rtems. The rtems directory shall be on the same level as the "picotk" directory, see 4.1.2. The directory structure looks at follows (after the installation of all packages):
.../picotk/toolkit | /emulators | /demo/ | /rtems /rtems/rtems-4.5.0 /build /pc386_lilo
Cd to the rtems directory and untar RTEMS:
cd mkdir rtems cd rtems tar xzf <...>/rtems-4.5.0.tgz
Create empty directory in which the compilation results will be held during compilation. (See note below.)
Up to now you shall have the following dir structure:
IMPORTANT NOTE (Just for a better understanding):
This is very special with RTEMS and might cause some trouble to the
RTEMS newbie: Source texts and compilation output (i.e. objects) are
kept in different directory trees (
.../build respectively). Sometimes it is necessary to
change the RTEMS source text
(for doing configuration, tweaking drivers, etc.)
Changing/Recompiling RTEMS requires these three steps:
make install RTEMS_BSP=pc386. This copies things into the "public" installation directories. The default settings of RTEMS - which are wise to use nevertheless - spatter RTEMS around the
/optdirectories. Don't forget this step.
cd build ../rtems-4.5.0/configure --target=i386-rtems make RTEMS_BSP=pc386 su /* Become root */ make install RTEMS_BSP=pc386 chmod -R 777 /usr/local/pc386
The chmod line is necessary since the RTEMS Makefiles insist on writing into that directory - causing write errors when being an ordinary user.
Compiling RTEMS might take a considerable amount of time (15-20 min on a K6-3/400).
RTEMS requires this additional setting in your environment:
export RTEMS_MAKEFILE_PATH=/usr/local/pc386 (sic!)
Add this line to the end of your personal
.bashrc file. Logout
and login again for the settings to take effect.
(The RTEMS_MAKEFILE_PATH points to the directory where a "Makefile.inc" file resides. )
As an ordinary user type:
cd .../rtems tar xzf .../pc386_lilo.tgz
You can skip installation and test of the hello_world_demo and go straight to the picoTK RTEMS demo, ch. 5.2.
As ordinary user
cd .../rtems tar xzf .../hello_world_c.tgz cd hello_world_c make
If you get an error about the not writable file in
you can either simply ignore this message or execute the
from section "Configure, build and install RTEMS"(
There shall be an RTEMS "executable" now named
cd .. cd rtems tar xzf .../pc386_lilo.tgz cd pc386_lilo
Makefile.inc. Change the
RTEMS_IMAGE=... line to include
the hello world binary (it is required to enter the full path), e.g.:
This looks like the end of a Linux kernel compilation and yields
a zImage file. Copy this file to a diskette and check the hello_world
output. There is a bug in some versions of the GNU linker
in the following error:
If this is the case edit the Makefile and substitute all occurences of
ld: cannot open binary: No such file or directory
Now you are ready to compile the picoTK RTEMS library. This uses the RTEMS cross tool chain and the RTEMS OS installation - i.e. you definitely need to have them installed at this point.
Change directory to where you installed picoTK. Execute
This shall yield a file called "libPTKrtems.a" in the toolkit subdirectory. That is the statically linked picoTK library for RTEMS.
cd demo make rtems make zImage
Make sure that
RTEMS_IMAGE is pointing to your actual
demo.exe before executing make
zImage. If you get an error
ld please refer to the section describing the
This yields a file bootable zImage which can be copied to a diskette
cp zImage /dev/fd0
(Depending on the permissions of
/dev/fd0 you might have to do this
as root. You can set permissions of
/dev/fd0 to 666,
chmod 666 /dev/fd0 and futurely execute the copy command
as an ordinary user)
Simply boot this diskette on a PC.