CMPE 117 - Lab, Esterel, and LegOS information
Lab Information
The lab is located in Baskin Engineering 150.
Pak Chan very kindly made the use of the lab available to us; he is
also using it for his class.
As a result, we can use only the 5 PCs located on the rear wall of
the lab.
The software is only installed on those 5 PCs.
Please do not use the other PCs, not even to check email.
We are there as guests.
First time software setup:
- Log in into the linux server at CATS:
ssh -l linux.ic.ucsc.edu
- Copy the LegOS in your home directory (you need approximately 1.6
MB of space):
cp /afs/cats.ucsc.edu/users/f/luca/public_html/legOS.tgz .
- Unpack LegOS:
tar xfvz legOS.tgz
To compile with LegOS and Esterel:
- Be sure that you have the following directory in your path:
/afs/cats.ucsc.edu/users/f/luca/public_html/esterelv5_21/bin
To insert it in the path, if you are using tcsh or
csh, you can execute the following or put it into your
.cshrc.mine file:
setenv PATH /afs/cats.ucsc.edu/users/f/luca/public_html/esterelv5_21/bin:$PATH
- Go to the directory legOS/esterel, which is where you
can keep your code.
- If your Esterel program is called try.strl, do:
- Compile the Esterel into C:
esterel -LLego try.strl
The resulting code is left in try.c.
- Compile the C into LegOS executable:
make try.lx
- The resulting file, try.lx, has to be installed on the
Lego. See the following instructions for doing so in the lab.
How to install the code on the Lego, in the lab:
- Get a Cygwin B20 shell (not the most recent implementation of
Cygwin, but use this one), and go to the directory
/legOS-0.2.4/legOS. If there is no sub-directory named code,
create it.
- If it is not there yet, copy legOS.srec from your unix
CATS directory legOS/boot; DO NOT use the
legOS.srec that comes with your windows distribution in
../boot as it will not work.
- To transfer programs from your cats account to your Windows
machine, use the secure shell application. Put the *.lx
files in the code sub-directory mentioned above.
Hint: if you have weird problems with permissions denied
(I had), just work in your public_html sub-directory of your cats
account. The problems have to do with how permissions are set up
on cats, and this is something I do not fully understand; it has
something to do with the fs setacl command.
- The first time, or whenever you take the batteries out of the
Lego, you have to load the LegOS firmware onto the Lego brick,
with the command:
../util/firmdl3 --slow legOS.srec
- If you want to install a file, for example try.lx, on
the Lego, do:
../util/dll lego_light.lx
- You are now ready to run your program!
Thanks
Many thanks to Ashwini, who helped with all the installation, and to
Vaibhav, who with Ashwini figured out which legos.srec was to be
used.
Luca de Alfaro