Virtualbox RTEMS Setup

Aric Hunter aricahunter at gmail.com
Thu Aug 16 20:39:42 UTC 2012


I got rtems to work with the lm3s6965.

1 major problem I was having seems like it has been addressed by the most
recent patch to rtems centos. I was getting error regarding libmpc.so.2, so
I had to use alternative methods to installing mpc rather than using the
method on the wiki page.
The other problem, was tha I coudn't get the patches to work with the
latest version of qemu (1.1). I had to use 1.0 instead.
For posterity, here is a pretty detailed list of instructions for setting
up rtems for lm3s6965

*Creating Virtual Machine:*

Download and install virtualbox: https://www.virtualbox.org/wiki/Downloads

Go to Applications and open virtualbox

Download the .ova file (CentOS) here:
http://sourceforge.net/projects/rtems-vms/files/Centos-6.2-RTEMS-4.11-20120223/

Go to file>import appliance and choose the .ova file that you just
downloaded

*Guest Additions (OPTIONAL)*

These steps will allow you to copy stuff from your host machine and paste
it to the guest virtual machine. It enables other features as well, but I
just wanted copy paste abilities.

Double click on the centos icon in the virtualbox manager to start the vm

When logging in login as root by clicking other and entering:

username: root

password: Virtual0

 Go to device tab and click install guest additions

click ok/run on the windows that should appear.

If no windows appear, then open a terminal, go to the additions disk in
/media, and run:

sh VboxLinuxAdditions.sh

Restart the computer and login as root again.

You should now be able to copy stuff from the host and paste into the guest


 *Installing Rtems*

While you're logged in as root (see above section if you're not sure how to
log in as root) open a terminal.

Run the following commands:

rpm -Uvh
http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm

yum install mpc

wget http://www.rtems.org/ftp/pub/rtems/SOURCES/4.11/gmp-4.3.2.tar.bz2

tar -xjf gmp-4.3.2.tar.bz2
mkdir b-gmp
cd b-gmp
../gmp-4.3.2/configure && make && make install
yum -y upgrade

log out of root and login as rtems

username: rtems

password: rtems123

open a terminal and run the following:

. ~/rtems-4.11-work/setenv

		cd $r
		git pull
		./bootstrap

Before you start working with rtems set your path using the command:

. ~/rtems-4.11-work/setenv

You know have the basic RTEMS up and running.






 *Installing ARM toolchain:
*login as root and run the following commands in a terminal:

rpm -ivh
ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-binutils-2.22-4.el6.i386.rpm

rpm -ivh ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-binutils-2.22-4.el6.i386.rpm>
rtems-4.11-arm-rtemseabi4.11-newlib-1.20.0-10.el6.noarch.rpm<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-newlib-1.20.0-10.el6.noarch.rpm>

rpm -ivh ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-binutils-2.22-4.el6.i386.rpm>
rtems-4.11-arm-rtemseabi4.11-gdb-7.4.1-1.el6.i386.rpm<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-gdb-7.4.1-1.el6.i386.rpm>

rpm -ivh ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-binutils-2.22-4.el6.i386.rpm>
rtems-4.11-arm-rtemseabi4.11-gcc-libstdc++-4.7.1-3.el6.noarch.rpm<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-gcc-libstdc++-4.7.1-3.el6.noarch.rpm>

rpm -ivh ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-binutils-2.22-4.el6.i386.rpm>
rtems-4.11-arm-rtemseabi4.11-gcc-libgcc-4.7.1-3.el6.noarch.rpm<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-gcc-libgcc-4.7.1-3.el6.noarch.rpm>

rpm -ivh ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-binutils-2.22-4.el6.i386.rpm>
rtems-4.11-arm-rtemseabi4.11-gcc-4.7.1-3.el6.i386.rpm<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-gcc-4.7.1-3.el6.i386.rpm>

rpm -ivh ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-gcc-c++-4.7.1-3.el6.i386.rpm>
rtems-4.11-arm-rtemseabi4.11-gcc-c++-4.7.1-3.el6.i386.rpm<ftp://ftp.rtems.org/pub/rtems/linux/4.11/centos/6/i386/rtems-4.11-arm-rtemseabi4.11-gcc-c++-4.7.1-3.el6.i386.rpm>


 *Configure RTEMS for ARM/lm3s6965*

* *Open a terminal and run:

* *cd /home/rtems/rtems-4.11-work

* *export PATH=/opt/rtems-4.11/bin:$PATH

mkdir b-arm

cd b-arm

../rtems/configure --target=arm-rtemseabi4.11 --enable-rtemsbsp=lm3s6965
--enable-tests=samples --disable-posix

gmake all


 *Installing Qemu:*

Go to this site: http://wiki.qemu.org/Download

and download qemu-1.0.1.tar.gz (Don't download 1.1. It won't work )

By default the qemu-1.0.1 will be installed in the tmp directory, so open a
terminal and do the following:

cd /tmp

tar -xzf qemu-1.0.1.tar.gz

cd qemu-1.0.1

Now, install the patches for the lm3s6965 with the following commands:

cat
/home/rtems/rtems-4.11-work/rtems/c/src/lib/libbsp/arm/lm3s69xx/0001-target-arm-Fixed-ARMv7-M-SHPR-access.patch
| patch -p1

cat
/home/rtems/rtems-4.11-work/rtems/c/src/lib/libbsp/arm/lm3s69xx/0002-target-arm-Disable-priority_mask-feature.patch
| patch -p1

cat
/home/rtems/rtems-4.11-work/rtems/c/src/lib/libbsp/arm/lm3s69xx/0003-target-arm-Evil-hack-for-BASEPRI-and-BASEPRI_MAX.patch
| patch -p1

cat
/home/rtems/rtems-4.11-work/rtems/c/src/lib/libbsp/arm/lm3s69xx/0004-target-arm-Evil-hack-to-increase-the-RAM-size.patch
| patch -p1

Now make qemu with the following command.

./configure && make && make install

Congratulations, you should now be able to use the arm emulator and
lm3s6965 board.

To test the lm3s6965 run the following commands in a terminal:
/home/rtems/rtems-4.11-work/b-arm/arm-rtemseabi4.11/c/lm3s6965/testsuites/samples/hello

lm3s6965 -i hello.exe

NOTE: Don't worry if you receive a hardware error. This is just a problem
with rtems working with qemu. You just want to see:

*** HELLO WORLD TEST ***

Hello World

*** END OF HELLO WORLD TEST ***





On Tue, Jul 24, 2012 at 10:33 AM, Aric Hunter <aricahunter at gmail.com> wrote:

> This is part of the conversation that I had with the rtems user group.
>
> ---------- Forwarded message ----------
> From: Gedare Bloom <gedare at rtems.org>
> Date: Fri, Jul 20, 2012 at 10:06 AM
> Subject: Re: Virtualbox RTEMS Setup
> To: Aric Hunter <aricahunter at gmail.com>
> Cc: Steven Grunza <sgrunza at ctdi.com>, rtems-users at rtems.org
>
>
> A little more background. RTEMS is cross-compiled, meaning that you
> compile RTEMS for a particular target hardware (e.g. x86 or arm) using
> your host tools. So you need a toolchain for the target that you want
> to execute RTEMS on, and you compile RTEMS for that target and
> whichever board support package (BSP) will run. You "install" RTEMS on
> the host so that the pre-built RTEMS and BSP are available and then
> you will be able to compile applications/examples against the
> installed RTEMS. Then you can download and execute your cross-compiled
> application on the board (or simulator) supported by that BSP.
>
> So to execute an RTEMS application on a given piece of hardware you need:
> * toolchain for the target architecture (e.g. ARM)
> * RTEMS configured, compiled, and installed for the architecture and BSP
> * application compiled against the installed RTEMS
> * a way to download and execute the application on your target
>
> I think that covers the generalities. More specifics are available in
> the manuals and on the wiki, or you can ask questions here as you run
> into issues...
>
> On Fri, Jul 20, 2012 at 12:56 PM, Gedare Bloom <gedare at rtems.org> wrote:
> > maybe this will help:
> http://www.rtems.com/wiki/index.php/GSoC_Getting_Started
> >
> > that kind of gives an idea about how to build and "install" RTEMS;
> > you'll want to substitute arm for sparc, and the ARM's BSP for sis..
> >
> > Or read the manuals about building rtems:
> >
> http://rtems.org/onlinedocs/doc-current/share/rtems/html/started/started.html
> >
> >>
> >>
> >> On Fri, Jul 20, 2012 at 6:31 AM, Steven Grunza <sgrunza at ctdi.com>
> wrote:
> >>>
> >>> See replies in-line
> >>>
> >>> > -----Original Message-----
> >>> > From: Aric Hunter [mailto:aricahunter at gmail.com]
> >>> > Sent: Thursday, July 19, 2012 6:28 PM
> >>> > To: Steven Grunza
> >>> > Cc: rtems-users at rtems.org
> >>> > Subject: Re: Virtualbox RTEMS Setup
> >>> >
> >>> > does the configure file run those patches (I've never used a patch
> >>> > file)?
> >>>
> >>> No.  It's a manual operation.  Typically I use a command sequence such
> >>> as the following:
> >>>
> >>> {Acquire the correct version source files}
> >>>
> >>> git clone git://git.qemu.org/qemu.git qemu.git
> >>>
> >>> cd qemu.git
> >>>
> >>> cat 0001-target-arm-Fixed-ARMv7-M-SHPR-access.patch | patch -p1
> >>>
> >>>
> >>> The problem is getting the correct version source files.  The qemu
> >>> project was at version 1.0.50 when the patches were created.  I was
> able
> >>> to use version 1.0.90.  QEMU now appears to be at version 1.1.50 and
> the
> >>> patches do not apply properly.  Perhaps they are no longer needed?
> >>>
> >>>
> >>>
> >>> > and what example did you use? I don't see any test files
> >>> > (hello.exe) in the b-lm3s6965 branch.
> >>> >
> >>> >
> >>>
> >>> I used the example applications for RTEMS.  These are sample
> >>> applications that (as far as I know) work with any version of RTEMS.  I
> >>> got them by doing the following:
> >>>
> >>>
> >>>
> >>> git clone git://git.rtems.org/examples-v2.git examples-v2.git
> >>>
> >>> cd examples-v2.git/hello/hello_world_c
> >>>
> >>> export RTEMS_MAKEFILE_PATH=/opt/rtems-4.11/arm-rtemseabi4.11/lm3s6965
> >>>
> >>> make
> >>>
> >>> cd o-optimize
> >>>
> >>> grunzasr at stm32dbg% which qemu-system-arm
> >>> /usr/local/bin/qemu-system-arm
> >>>
> >>> grunzasr at stm32dbg% /usr/local/bin/qemu\-system\-arm --version
> >>> QEMU emulator version 1.0.90, Copyright (c) 2003-2008 Fabrice Bellard
> >>>
> >>> {Note: This is the patched version of qemu}
> >>>
> >>>
> >>> grunzasr at stm32dbg% qemu-system-arm -nographic -M lm3s6965evb -kernel
> >>> hello.ralf
> >>>
> >>>
> >>> *** HELLO WORLD TEST ***
> >>> Hello World
> >>> *** END OF HELLO WORLD TEST ***
> >>
> >>
> >>
> >> _______________________________________________
> >> rtems-users mailing list
> >> rtems-users at rtems.org
> >> http://www.rtems.org/mailman/listinfo/rtems-users
> >>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20120816/4632e96a/attachment.html>


More information about the users mailing list