Windows Environment

Stephan Merker merker at decrc.abb.de
Mon Nov 27 08:59:13 UTC 2000


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

----- Original Message -----
From: <correo at fernando-ruiz.com>
To: "Rtems-Users" <rtems-users at oarcorp.com>
Sent: Thursday, November 23, 2000 10:46 PM
Subject: Windows Environment


>
> Hi,
>
> After "mise en place" the RTEMS BSP the hard engineer asks me
> to run the environment (Linux Mandrake 7.1 & RTEMS 4.5.0 (last snapshot))
> in a known environment (Windows 2000 or NT4).
>
>  I have downloaded the last version 2.29 of cygwin from INET.
> This works fine with native compiler i386 (686 version of course).
> I can run all the linux commands, scripts, etc. but...
>
>
> After following all the steps like in RTEMS linux Environment the
>
> ./bit_rtems sh CRASH!!!
>
> Are there any people that works with cygwin?
>
> Can you help me with the best version?
> The place to get it and the litle "trucs" to run RTEMS
> in the "UGLY" O.S from Microsoft.
>
> All the people recommend to work in linux to avoid the Win32 Virus and
more.
>
> I am delighted with LINUX but the boss is the boss and he doesn't want to
> change.
>
> Another point.
>
> All our developements have a multiterminal sessions.
> I have a little shell to run the commands like monitor rtems makes.
>
> I ask if the right way to make this is :
>
>       rtems_task
>       TaskTerminal(...) {
>        ...
>    stdin =fopen("/dev/com1","r+");
>        stdout=fopen("/dev/com1","r+");
>        stderr=fopen("/dev/com1","r+");
>        ...
>        for (;;) {
>         prompt();
>         if (getline(cmd))
>          exec_command(cmd);
>        };
>       }
>
>       Without previous fclose(stdXXX)
>
> in every task that I want that runs in a new terminal.
>
> Is this correct?
>
> Thanks in advance.
>
> Fernando RUIZ CASAS
> fernando.ruiz at ctv.es
>




More information about the users mailing list