RTEMS Setup
===========

This file provide instructions on how to configure and build OpeGUI for RTEMS.
It is assumed that you are familiar enough with RTEMS and OpenGUI.
A development environment that works with both systems is expected.

Environment tested:

   + Cygwin 1.1.5
   + NT 4.0 SP4
   + Rtems 4.5.0 - snapshot 20001121
   + bsp -- pc486

It requires a PC with a mouse, serial on COM1 or a PS/2 mouse. Video 
card must be supported by svgalib 1.4.1.


Some of the examples that required files to be present, are not
included in the examples. They should compile and run just fine,
but adding files to RTEMS in memory file system is complicated
and we decided to avoid such examples for the time being.



a) RTEMS --- Patching & Building
==========================

 + Download RTEMS source (rtems-ss-20001121.tgz) from Oarcorp.

 + make a build directory
       mkdir work

 + untar rtems
      cd work
      tar xzf rtems-ss-20001121.tgz

Configure and install RTEMS. This assume that the proper
GNU toolset for i386-rtems is installed and operational.

  ./bit_rtems i386 pc486
# takes a while and ends up with /opt/rtems/pc486 installed


b) svgalib --- Patching & Building
=======================================
Please go to Rosimildo's web site, read the instructions about building
and installing sgvalib-1.4.1 for RTEMS:

  http://members.nbci.com/rosimildo/rtems_svga.html



c) OpenGUI --- Patching & Building
=======================================

 + Downloaded OpenGUI source (OpenGUI-3_0beta3.tgz or later) from:

http://www.tutok.sk/fastgl/

 + untar opengui
      cd work
      tar xzf OpenGUI-3_0beta3.tgz

Edit makeinclude.rtems to localize it.  
Make sure these variables are set as shown below:


# ****  IMPORTANT MACROS  *******

# This macro should point the location of your rtems build is installed.
RTEMS_BUILD	        = /opt/rtems

# Specify the BSP in use
RTEMS_BSP           = pc486

# Specify if the host computer ewuires one exension for exetutables.
# Under windows the tools create executables with .exe extensions.
EXE_EXT             =.exe 

# Define this macro as the prefix for your cross-compiler
CROSS_COMPILE = i386-rtems-

Now build OpenGui:

  make -f makefile.rtems install

This build the opengui library and some of the examples.


NOTE: As you may have read the instructions to compile OpenGUI,
it requires a new assembler called NASM. The nasm assembler is
required to be installed and in the system path.



d) MOUSE Setup
=======================================

In a nutshell shell, there are support for serial and PS/2 mouses.
The serial mouse is configured by default to use COM1. 
If your mouse fit the settings above, you are ok, and no 
further setup is required, except load the proper driver in the
rtemscfg.h file. The default mouse installed is serial on COM1.


  + Mouse driver setup: 
This needs to be improved later. Right now this is utter complex.
It reminds me setting up GRUB. :-).

You need to edit the device driver table in rtemscfg.h, around line 61.
Go to OpenGUI/rtems

There are two "/dev/mouse" drivers on RTEMS. Only one of them can be
loaded. Select the one that fits your needs.

    i) for PS/2 mouse:
Select to load PAUX_DRIVER_TABLE_ENTRY in the device driver table. You
would do this, defining PS2_MOUSE in the file rtemscfg.h before the
device driver table.

#define PS2_MOUSE


   ii) Serial Mouse 
   
-- Select the mouse type: "ms", "pc". Most serial mouses are microsoft ( "ms" )
compatible. This is the default selection.


-- Select serial port -- default is COM1

Both selections are made in the header file: 
       $RTEMS_SOURCE)/c/src/lib/libbsp/i386/pc386/console/serial_mouse.h
around line 72.

[snip from $RTEMS_SOURCE)/c/src/lib/libbsp/i386/pc386/console/serial_mouse.h ]
/* Select the mouse type:  "ms","pc","ps2" */
#define  MOUSE_TYPE        "ms"  

/* Select the serial port used by the mouse driver */
#define  SERIAL_MOUSE_COM1  1
/* #define  SERIAL_MOUSE_COM2  1  */

IMPORTANT: Any change on one of these settings, requires recompilation of RTEMS.




e) Credits
=======


Good Luck !!!.

Rosimildo.


