[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to Build Unix BSP



This is the recipe to build a Cygwin BSP POSIX
I think that you can use the lastest version of RTEMS snapshots and Cygwin
environment.
I can compile with sh-rtems and i386-rtems without problems.
+++++++++++++++++++++
-----Mensaje original-----
De: Stephan Merker [mailto:merker at decrc.abb.de]
Enviado el: lunes, 27 de noviembre de 2000 9:59
Para: RTEMS Mailing List
CC: correo at fernando-ruiz.com
Asunto: Re: Windows Environment


I got RTEMS to run fine under cygwin. However, it needs some patches and
settings. Here's how:

1. Install Cygwin (use an up-to-date version), use UNIX file mode
The Cygwin installation, I'm using is:
cygwin.dll  1.1.5-7
gcc  2.95.2-4 (downloaded from cygwin setup as 2.95.2-5)

2. in /bin link cc.exe to gcc.exe: ln gcc.exe cc.exe (otherwise configure
scripts fail)

3. Unpack RTEMS distribution into your project directory
I used Snapshot release rtems-ss-20001103.tgz.

4. Apply the patches to the RTEMS source (see below)

5. create a build-rtems directory

6. run the following configure command in build-rtems,
../rtems-ss-20001103/configure --enable-cxx --enable-rtemsbsp=posix --enable
-tests --prefix=/usr/local/rtems
It configures RTEMS for a generic POSIX BSP, enables the C++, and includes
the RTEMS test suite. The BSP will be installed in /usr/local/rtems

7. build RTEMS in the build-rtems directory
make all XCFLAGS=-U__STRICT_ANSI__  for the release version
make all VARIANT=debug XCFLAGS=-U__STRICT_ANSI__  for the debug version

8. You will encounter an error message in 2 tests/samples.
Comment out the 'paranoia' target in
build-rtems/c/posix/tests/samples/Makefile
Comment out the 'termios' target in
build-rtems/c/posix/tests/libtests/Makefile
Continue building (make all). Should compile now.

9. You may run the tests now.
cd build-rtems/posix/tests
./runtest
This takes a while. Sometimes the ./runtest command gets stalled (seems to
be problem with IO redirection). However, running the single tests has
always worked.

10. install the BSP
make install  or
make install VARIANT=debug

11. set the environment variable to the BSP install point
export RTEMS_MAKEFILE_PATH=/usr/local/rtems/posix

12. Now you can start with RTEMS development. Enjoy.

Directory structure (example):

/home/merker/pecos
    rtems-ss-20001103 rtems distribution
    build-rtems  rtems build directory
/usr/local/rtems   RTEMS BSP installation point
    posix   POSIX BSP

Patches to RTEMS:

The following patches should be applied to the RTEMS sources
(rtems-ss-20001103.tgz):

File: rtems-ss-20001103\c\src\exec\score\cpu\unix\rtems\score\cpu.h
Location: around line 632

Old:
#define CPU_ALIGNMENT              8

New:
#if defined(__CYGWIN__)
  #define CPU_ALIGNMENT              4
#else
  #define CPU_ALIGNMENT              8
#endif

Explanation:
gcc on cygwin seems to have problems with setting the alignment of variable
explicitly (using the attribute keyword). So lets behave like the i386 BSP
and set the CPU alignment to 4 (default for gcc on cygwin). I haven't
changed the other alignment macros, so probably some warnings will pop up.
Alignment is required for the memory areas of partitions and regions.


File: rtems-ss-20001103\c\src\lib\include\sys\ioccom.h
Location: around line 78

Old:
#define FIONBIO         _IOW('f', 126, int)     /* set/clear non-blocking
i/o */

New:
#if !defined(__CYGWIN__)
  #define FIONBIO         _IOW('f', 126, int)     /* set/clear non-blocking
i/o */
#endif

Explanation:
FIONBIO is already defined in the Cygwin header termios.h. This leads to a
lot of compiler warnings.


So, now you have a RTEMS on cygwin with the test suite running through.
However, I have not yet testes a larger application. I'm interested in any
further experience with this configuration. Another interesting thing would
be to get the POSIX API of RTEMS running on top of the POSIX/UNIX BSP ...

Stephan
+++++++++++++++++++++

> -----Mensaje original-----
> De: Joel Sherrill [mailto:joel.sherrill at oarcorp.com]
> Enviado el: miercoles, 08 de agosto de 2001 14:40
> Para: Kiran C
> CC: Ralf Corsepius; RTEMS
> Asunto: Re: How to Build Unix BSP
>
>
>
>
> Kiran C wrote:
> >
> > Hi,
> >     Thanks for ur reply
> >     How useful is a simulated or Synthetic environment in developement.
> >     Say you are implementing network protocols..then  such an
> environment is
> > really usefull isn't it( excluding driver development)?
>
> I have a long standing, not merged, patch from Ian Lance Taylor
> (formerly
> binutils maintainer) that lets the network stack work under Linux.
> The problem is the underlying conflict between RTEMS calls, header
> files, etc.
> and the native ones.
>
> >     The build debug cycle can be greatly be reduced.
> > What do u think about it?
>
> Personally, I would investigate either a CPU simulator or a virtual PC
> environment like Plex86 or VMware.  I think the Cygnus/RedHat SID
> simulation environment includes some simulated network devices.
>

The last version 2.0.4 of VMWare works fine for the i386-rtems pc686 BSP.
(Win2K version...). A Grub diskette and ready to run.

The problem is that the the simulated network hardware is a
pc-net family AMD card. Is valid any network driver in the rtems tree?

A little thing is that the vga mode (/dev/console vga driver) is not
a good mode for the full screen simulator.


Salu2.

Fernando RUIZ CASAS
home: correo at fernando-ruiz.com
work: fernando.ruiz at ctv.es



> IMO it is better to work on a simulated CPU since that is closer
> to the real thing.
>
> > Thanks,
> > Kiran
> >
> > ----- Original Message -----
> > From: Ralf Corsepius <corsepiu at faw.uni-ulm.de>
> > To: Kiran C <kiranc at tataelxsi.co.in>
> > Cc: RTEMS <rtems-users at OARcorp.com>
> > Sent: Wednesday, August 08, 2001 11:35 AM
> > Subject: Re: How to Build Unix BSP
> >
> > > Am 08 Aug 2001 11:11:09 +0530 schrieb Kiran C:
> > > > Hi,
> > > >     What build utils should I use to build UNIX
> BSP.(Synthetic Target).
> > > >     Can I use my native gcc compliers?
> > > Yes.
> > >
> > > >     Or should I be using any cross complier for it?
> > > No.
> > >
> > > >     The README.Configure does n't give any any information about the
> > > > parameters for the
> > > >     Configure script for the UNIX BSP.
> > > None are required, but you might want to apply --prefix=<somewhere>
> > > (Don't use /usr or /usr/local)
> > >
> > > >    I am trying to build it in Cygwin.
> > > In this case, native means using the Cygwin toolchain (Not a DOS/Win
> > > toolchain).
> > >
> > > >     Has anybody reported success in doing so?
> > > This is known to be broken at several places, with different problems
> > > popping up depending on which version of Cygwin and of RTEMS you are
> > > going to use.
> > >
> > > Fixing this properly would not be easy, but unfortunately, apparently
> > > nobody seems to care about.
> > >
> > > However, it is fairly easy to get it "compilable" with a couple of
> > > hacks.
> > >
> > > Ralf
> > >
> > > --
> > > Ralf Corsepius
> > > Forschungsinstitut fuer Anwendungsorientierte
> Wissensverarbeitung (FAW)
> > > Helmholtzstr. 16, 89081 Ulm, Germany     Tel: +49/731/501-8690
> > > mailto:corsepiu at faw.uni-ulm.de           FAX: +49/731/501-999
> > > http://www.faw.uni-ulm.de
> > >
>
> --
> Joel Sherrill, Ph.D.             Director of Research & Development
> joel at OARcorp.com                 On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>    Support Available             (256) 722-9985
>