Compiling and installing RTEMS for the Raspberry Pi
OK, The RTEMS compiler is ready to go on your Ubuntu machine, so it’s time to download and build RTEMS for the Raspberry Pi.
If you have not installed the compiler, then go back and follow that step
Step 1: Download and Prepare RTEMS:
Start by check out the RTEMS head build from the git repository
$ cd $HOME/development/rtems $ git clone git://git.rtems.org/rtems.git rtems-git |
Before RTEMS can be built, the autotools scripts must be generated ( Don’t forget the ./ in front of bootstrap )
$ cd rtems-git $ ./bootstrap |
Now, RTEMS is ready to build for the Pi. When you compile RTEMS, you choose the architecture, Board Support Package (BSP) and a few other options such as POSIX API, networking, etc. When you compile RTEMS in this next step, you are not really compiling something you run on the Pi just yet. You are compiling all of the operating system libraries, drivers, and installing them along with the headers. When you build your own RTEMS application, you will then use these headers and libraries.
Step 2: Configure RTEMS:
$ cd $HOME/development/rtems $ mkdir build-rtems-rpi $ cd build-rtems-rpi |
To build RTEMS for the Raspberry Pi use the following command:
$ ../rtems-git/configure --target=arm-rtems4.11 \ --enable-rtemsbsp=raspberrypi \ --enable-tests=samples \ --enable-networking \ --enable-posix \ --prefix=$HOME/development/rtems/bsps/4.11 |
When this step is is complete you should see something like this:
target architecture: arm. available BSPs: raspberrypi. 'make all' will build the following BSPs: raspberrypi. other BSPs can be built with 'make RTEMS_BSP="bsp1 bsp2 ..."' config.status: creating Makefile |
Step 3: Now, build and install:
$ make install |
When the make and make install is complete, the RTEMS libraries, headers, and some sample programs are in:
$HOME/development/rtems/bsps/4.11/arm-rtems4.11/raspberrypi
All of these directories may seem a little complicated, but it starts to make sense when you want to have different RTEMS versions, different architectures, and different BSPs all on the same development machine, without getting anything mixed up.
So now you have a cross compiler, and have RTEMS compiled and installed, so what about getting an RTEMS program to actually run on the Pi ?
文章转自:http://alanstechnotes.blogspot.com/2013/03/compiling-and-installing-rtems-for.html