= MinGW Tools for Windows = Windows users can now use MinGW base RTEMS tools. These tools will generate the same application code for RTEMS as the tools on Linux or Cygwin. MinGW tools use the native Windows runtime rather than access Windows via the POSIX interface Cygwin provides. MinGW tools are faster than the Cygwin equivalent and are not confused by Cygwin mount points. Compiler errors will show a Windows path rather than a Cygwin path. The RTEMS MinGW tools are packaged in Windows installers. The latest tools are: * [ftp://www.rtems.org/pub/rtems/windows/rtems4.7-arm-3.exe ARM (rtems4.7-arm-3.exe)] * [ftp://www.rtems.org/pub/rtems/windows/rtems4.7-h8300-3.exe H8300 (rtems4.7-h8300-3.exe)] * [ftp://www.rtems.org/pub/rtems/windows/rtems4.7-i386-3.exe i386 (rtems4.7-i386-3.exe)] * [ftp://www.rtems.org/pub/rtems/windows/rtems4.7-m68k-3.exe M68K (rtems4.7-m68k-3.exe)] * [ftp://www.rtems.org/pub/rtems/windows/rtems4.7-mips-3.exe MIPS (rtems4.7-mips-3.exe)] * [ftp://www.rtems.org/pub/rtems/windows/rtems4.7-powerpc-3.exe PowerPC (rtems4.7-powerpc-3.exe)] * [ftp://www.rtems.org/pub/rtems/windows/rtems4.7-sh-3.exe SH (rtems4.7-sh-3.exe)] * [ftp://www.rtems.org/pub/rtems/windows/rtems4.7-sparc-3.exe SPARC (rtems4.7-sparc-3.exe)] The source code for the tools is under the GNU GPL and can be found here ftp://www.rtems.org/pub/rtems/SOURCES. Click on the target link above to install the tools. These tools are currenty missing GDB. This is to be added next. If you wish to use the Autotools such as autoconf and automake you should install MinGW and MSYS first. To test the tools run the rtems-cmd.bat file installed as part of the package. This will open a Windows Command prompt (cmd) with the path to the installed tools. enter the GCC command for your tool set. For example the ARM GCC command is: RTEMS(arm) C:\rtems\arm> arm-rtems4.7-gcc arm-rtems4.7-gcc: no input files A few batch files and a script are installed into the install point. The first is called rtems.bat. It sets up the path and environment variables you need to run the RTEMS tools. The second is rtems-cmd.bat. It will open a Windows command box with the RTEMS tools path and environment set. The last is sh-run.bat. You call this from your editor when you want to compile within the editor. You need to install the MinGW and MSYS packages to use this batch file. For example: c:\rtems\arm\sh-run.bat ./vs-make.sh /c/rtems/src/app all can be used with Visual Studio and an external make project to compile an application in c:\rtems\src\app. The script vs-make.sh will change directory and invoke GNU make converting the GCC error messages to MS format that Visual Studio understands. = Setting Up MinGW = The tools as installed do not need any extra packages, DLLs or installs to work. You could use any available make program or tools to build any RTEMS application. If you want some excellent tools or wish to build RTEMS on Windows the MinGW project provides just what you need. You can find the MinGW project at http://www.mingw.org/. The MinGW project has 2 packages we are interested in using. You should install both before you install the RTEMS tools. The first MinGW package which contains a Windows native GCC compiler, and GNU make (called mingw32-make). The second package is MSYS for Minimal SYStem. It is a stand alone package based on the excellent and sucessful Cygwin package but simplifed to providing a self hosted mingw32 target POSIX style environment. It provides a shell with enough functionality to run configure scripts from the autooconf package. It is simpler to install and setup than the larger more complex Cygwin package. * [http://prdownloads.sf.net/mingw/MinGW-5.0.2.exe?download MinGW Tools] * [http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download MSYS Installer] Click on the above and install each package. The default settings for these package should be ok for most users. If you have Cygwin installed, or another package which contains Cygwin you should consider removing any paths to it from your global path variable and using batch files to set paths specifically. It can be confusing if you end up mixing all of together. The example batch file above shows how you can manage specific paths for MinGW and RTEMS. With MSYS you can run the RTEMS configure script. You can use the MSYS shell which you can find as a menu or Desktop icon. This is just like a Unix shell so you need to know some basic Unix commands to use. You can also run configure from a Windows command prompt started with the rtems.bat file shown above by placing "sh" before the configure command. If you wish to modify RTEMS and need to run autoconf, automake or any of the autotools you will need to install the [http://prdownloads.sf.net/mingw/msysDTK-1.0.0.exe?download MinGW MSYS Developers Tool] kit. The RTEMS installer checks to see if the MSYS /etc/fstab is present and appends the prefix the tools are built with as a mount to the install point you set in the installer. This is a work around to get automake to work. The automake package cannot be relocated so this work around creates the tool's prefix for the MSYS environment automake uses. For example the tools can have a prefix of /home/chrisjohns/rtems/4.7/build/rpms and the tools are installed to C:\rtems\arm. The /etc/fstab will have the following entry: C:/rtems/arm /home/chrisjohns/rtems/4.7/build/rpm If you install MSYS to a non-default location you will need to update the C:\rtems\arm yourself. = Building RTEMS = To build RTEMS with the source code in a directory 'c:\rtems\src\rtems' you would do the following: > c: > cd \rtems\src > mkdir m68k > cd m68k > sh ../rtems/configure --target=m68k-rtems4.7 --enable-multilib --prefix=/c/rtems/m68k > sh make all install = Trouble Shooting = If you have trouble with MSYS when building RTEMS check what virus or spyware detection software you have. The PC Tools Spyware Doctor has been giving me problems. The machine looses all resources. Turing off Spyware Doctor does not help, it had to be uninstalled.