galsC Installation Instructions

Last updated 25 April 2004

The galsC compiler is an extension of the nesC compiler. nesC is "an extension to the C programming language designed to embody the structuring concepts and execution model of TinyOS. TinyOS is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM)." TinyOS, described at http://webs.cs.berkeley.edu/tos/, is used, for example, on the Berkeley MICA "motes," which are small wireless sensor nodes.

galsC programs are designed to run on the same platforms as nesC/TinyOS. However, galsC programs use the TinyGALS programming model, which replaces the TinyOS scheduler with a TinyGALS scheduler.

To install the galsC compiler and associated examples, you must first install TinyOS, then the galsC compiler. Choose one of the methods below to install each package. These instructions assume that you are either running linux or will be running Cygwin on Windows.

  1. Install TinyOS (includes galsC examples).
  2. Install the galsC compiler.
  3. Run the example:
    cd $TOSROOT/contrib/tinygals/apps/CntToLeds
    make mica
            

How to install the TinyOS rpms (TinyOS 1.1.x CVS Snapshots)

  1. To install a TinyOS 1.1.x snapshot, you must first have installed TinyOS 1.1.0. If you have not installed TinyOS 1.1.0, please see the TinyOS download page .

    You need not install any previously released 1.1.x snapshots. That is, if you have 1.1.0 installed on your machine, you can jump right to installing 1.1.5 rather than installing 1.1.1... up to 1.1.5. Each 1.1.x CVS snapshot supercedes previous 1.1.x CVS snapshot releases.

  2. If you already have TinyOS 1.1.0 installed, upgrade to TinyOS 1.1.x. Choose the appropriate directions for your operating system:
  3. Set the TOSROOT environment variable to the location of the TinyOS source tree; also set the TOSDIR environment variable.
  4. Download and install the galsC examples. Choose the appropriate directions for your operating system: (The directions above were modified from the original TinyOS CVS snapshot installation instructions).

How to install TinyOS from CVS

  1. Install the AVR tools using the appropriate directions for your operating system: (The directions above were modified from the original TinyOS installation directions).
  2. Make a directory into which to store the source code, for example:
        mkdir -p $HOME/galsc
            
  3. Check out the TinyOS CVS repository:

    cd $HOME/galsc
    cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tinyos login
    Hit Enter when prompted for a password
    cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x
            
    This will create a directory tinyos-1.x. For more information, see http://sourceforge.net/cvs/?group_id=28656.
  4. Set the TOSROOT environment variable to the location of the TinyOS source tree; also set the TOSDIR environment variable.

How to install the galsC rpm

Choose the appropriate directions for your system:

The galsC installation should now be located in /usr/local/galsc.

How to install the galsC source distribution (.tar.gz) and build it

  1. If you have not already done so, make a directory into which to store the source code, for example:
        mkdir -p $HOME/galsc
            
  2. Download the galsC distribution and save it in $HOME/galsc. Install it:
    cd $HOME/galsc
    gunzip galsc-0.1.0.tar.gz
    tar xvf galsc-0.1.0.tar
            
  3. Run configure for galsC:
    cd $HOME/galsc/galsc-0.1.0
    ./configure --prefix=$HOME/galsc
            
  4. Install galsC:
    make
    make install
            
    This will create directories in $HOME/galsc
  5. Set the environment variable (GALSC) that points to the galsC installation.

How to install galsC from CVS and build it

You can also download the galsC source code and build it. It is based on the nesC compiler, which requires an impressive suite of tools.

  1. Under Linux or Cygwin, you must have the following programs installed on your system:

    For help with how to install these in Cygwin, see The Cygwin FAQ. Note that most installations will not have gperf on them, at least, so you will likely need to install at least that.

  2. Get the galsC CVS Tree, see http://sourceforge.net/cvs/?group_id=56288
    cd $HOME/galsc
    cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nescc login
    Hit Enter when prompted for a password
    cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nescc co -r galsc nesc
            
  3. Boostrap galsC
    cd $HOME/galsc/nesc
    ./Bootstrap
            
  4. Run configure for galsC
    ./configure --prefix=$HOME/galsc
            
  5. Install galsC
    make
    make install
            
    This will create directories in $HOME/galsc
  6. Set the environment variable (GALSC) that points to the galsC installation.