Cebollita

Cebollita Setup & Downloads

Last modified: January 17, 2006
Sloop SMOK
  CSE Home  About Us    Search    Contact Info 

Setup and Downloads

The following is definitely not an idiot-proof installation. It assumes the user is willing to do a bit of fiddling to get everything working right.
  1. The system requires JDK1.4 or better. If it's not installed, you'll need to download and install it. It might work with older versions, but we make no guarantees.

  2. Create a directory (call it "cebollita"). This directory will hold the installation.

  3. Download the latest Cebollita distribution from the following location: Download. Distributions are named
         cebollita-full.[major number]-[minor number].[date].jar.
    Put it into the above directory.
    NOTE: If the minor version number is odd, then you will be downloading the latest, experimental version of the software. If you want a stable version, go for something with the same major version but the highest even-numbered minor number.

  4. Unpack the jar file you just downloaded. Something like: jar xf cebollita-full.xxxxx.jar should do the trick. (Note: If you're comfortable with jar's, or don't want access to the Cebollita source or the makefiles used to build the example programs, you can get away without unpacking the jar file. You'll have to modify your CLASSPATH setting from what is shown for this to work, though.)

  5. You need to add the root directory of the unpacked files ("cebollita") to your CLASSPATH environment variable, as well as the jlex.jar and cup.jar files you'll find in that directory. Some information on how to do that is at the end of this page.

  6. If you're using Cygwin, you need to set environment variable CYGWIN to tty. This must be done before Cygwin's launch sequence starts, meaning you must do it by setting the environment variable through Windows. The "(Raw)Windows" discussion at the bottom of this page tells you about setting environment variables in Windows. Follow those, but make the environment variable name CYGWIN and its value the string tty.

  7. I find it convenient to set up some aliases to invoke the primary Cebollita tools. (That way, I don't have to remember what packages they're in.) You can do that by adding the aliases to the profile file for your shell, e.g., in file ~/.bash_profile. Here are the ones I use:
    alias cebcc="java  comp.parser"
    alias cebasm="java  asm.parser"
    alias ceblink="java  asm.Linker"
    alias cebsim="java dbg.UI"
    alias cebdumpe="java  util.Exe"
    alias cebdumpm="java  asm.Module"
    
    You have to kill your current shells and start new ones after making this change for it to have effect.

Testing the Installation

  1. Navigate to directory cebollita/apps/myPrograms.

  2. Say make for-os. That establishes your build target.

  3. Say make cTest. That will compile and link cTest.c

  4. Assuming you've set up the aliases above, say cebsim cTest.exe. The graphical debugger appears.

  5. Hit the run button. "Test succeeded" is printed.

Your Program Files

The easiest thing to do is to put your program files (both C-- .c and assembly language .s files) in directory cebollita/apps/myPrograms. If you do that, a Makefile structure already in place will make life easier dealing with the variety of configurations for which your code can be compiled (e.g., targeted to the Cebollita software simulator or to a SMOK implementation of the Cebollita architecture).

To do this, edit your file in the myPrograms directory. Let's assume your file is named myTest.c. Edit the Makefile there to append the basename of your file (myTest in this example) to the line indicated by the comments in the Makefile. Having done that, you:

  1. Establish the build target using something like make for-os. You do this once. (Further details are elsewhere in this documentation.)
  2. Now you can compile/assemble and link your application with the command make myTest.
  3. Assuming you've set up the aliases above, you can run it with:
         cebsim test.exe

CLASSPATH

Setting environment variables differs from system to system, but here's a basic guide.
UNIX
Easiest is to set them in your shell RC file. If you use BASH, adding these lines to your .bashrc will do the trick (assuming Cebollita was installed to /usr/local/ceb):
export CLASSPATH="/usr/local/ceb:/usr/local/ceb/jlex.jar:/usr/local/ceb/cup.jar:$CLASSPATH"

CYGWIN on Windows
Easiest is to set them in your shell profile file. If you use BASH, adding these lines to your .bash_profile will do the trick (assuming Cebollita was installed to C:\cebollita):
export CLASSPATH="C:\cebollita;C:\cebollita\jlex.jar;C:\cebollita\cup.jar;$CLASSPATH"
(Raw) Windows
Easiest is to set them in the System Properties Control Panel (under "Advanced"). Under "Environment Variables" either edit or create a new variable called CLASSPATH. Assuming you've installed everything in C:\cebollita, you'd add this to CLASSPATH: C:\cebollita;C:\cebollita\cup.jar;C:\cebollita\jlex.jar.

Mac
I have no idea, but I guess it can be made to work in OS X.

There are a bunch of test C-- and assembly programs in a directory called apps/tests, plus a single, larger example in apps/quicksort. The OS and runtime libraries are also in apps/. Makefiles are provided to build the various components and test applications.


Department of Computer Science & Engineering
University of Washington
Box 352350
Seattle, WA  98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to zahorjan@cs.washington.edu]