UW: OS/161 and Toolchain FAQ


  1. Can I use machine X and operating system Y for my assignments?
    We will be testing and grading your software using the student.cs environment. So you MUST ensure that it builds and runs correctly in that environment. However, you may wish to do some development on other systems.

    See the rest of the FAQ below for information about some of the required software and libraries that are typically required. Some information about particular systems can be found at:
    Installing and Running OS/161 and the Toolchain on Different Platforms
    We'll try to collect information about particular systems there.

    Here is an incomplete list of systems and information about whether or not you can build all of the tools required on that system. Each term there are lots of useful postings to the newsgroup or to Piazza that can be helpful with installing the tools on different systems.

    System              Successful build
    ----------------------------------------------------------------------------------
    Ubuntu Linux    Confirmed for Some Distros (e.g., 10.04, 10.10, and 11.10).
                    For 11.10 see the link to and info that talks about "Different platforms".
                    (May need to install extra software. See other questions in FAQ)
    
    Other Linux     Very Likely Possible
                    (May need to install extra software. See other questions in FAQ)
    
    OS X Mavericks  Confirmed
                    (Does not work with llvm/clang/XCode or newer GCC versions)
                    (MUST install GCC 4.5 or 4.7 AND alter config/makefiles for all tools to use this version of GCC.
                    (May need to install extra software. See other questions in FAQ)
                    (Try adding --disable-werror on configure line)
    
    OS X Leopard    Confirmed 
                    (May need to install extra software. See other questions in FAQ)
                    (Try adding --disable-werror on configure line)
    
    OS X Lion       Confirmed
                    (May need to install extra software see other questions in FAQ)
                    (Try adding --disable-werror on configure line)
    
    Windows         Don't Even Try
    
    CYGWIN 32-Bit   Confirmed
                    (May need to install a variety of libraries and packages)
    
    CYGWIN 64-Bit   Unconfirmed Difficulties
                    (Some more intensive heavy lifting may be required, if it is possible at all)
    

  2. I'm having trouble getting OS/161 installed in the student environment.

    Here is a list of some of the most common problems/solutions.
    See more details and other problems/solutions below.
  3. I don't know how to read or post to the course newsgroup.

    Some recent terms have switched to using piazza.com so in those cases this information is not relevant. If your class is using a course newsgroup here is more info.
    See http://www.math.uwaterloo.ca/mfcf/faq/news.html for info about different options for to reading and posting to newsgroups.


  4. I'm having trouble configuring or building binutils on my home machine, e.g., Ubuntu or Mac OS.
    I see output like:
    
    > make  all-recursive
    > Making all in doc
    > make[3]: Nothing to be done for `all'.
    > Making all in po
    > file=/Users/snipe65/Desktop/OS161/cs161-binutils-1.4/./binutils-2.14/bfd/po/`echo fr | sed
    > 's,.*/,,'`.gmo \
    >  && rm -f $file && PATH=../src:$PATH msgfmt -o $file
    > /Users/snipe65/Desktop/OS161/cs161-binutils-1.4/./binutils-2.14/bfd/po/fr.po
    > /bin/sh: line 1: msgfmt: command not found
    > make[3]: *** [fr.gmo] Error 127
    > make[2]: *** [all-recursive] Error 1
    > make[1]: *** [all-recursive-am] Error 2
    > make: *** [all-bfd] Error 2
    
    In some cases this problem has been solved by installing the gettext package. On an Ubuntu system you should be able to use the Synaptic Package Manager.
    On the top menu follow/select:
    
    System -> Administration -> Synaptic Package Manager.
    Then search for gettext.
    Select it for installation and then click "Apply".
    
    If that doesn't work or for Mac's it is available at:
    http://www.gnu.org/software/gettext

  5. What tools can I use to better browse/examine the source code.
    There are improved (at least to my mind) versions of two tools added to ~cs350/bin/ that you will probably find really useful (they are available with most Linux distros and you can probably get and compile them for other systems).
    cscope - is a developer's tool for browsing source code.
            # Allows searching code for:
              # all references to a symbol
              # global definitions
              # functions called by a function
              # functions calling a function
              # text string
              # regular expression pattern
              # a file
              # files including a file
      I find some of the features don't always work very well
      (e.g., functions called by a function) so sometimes
      I need to resort to searching for text strings.
    
    The web page has a man page and more info
    http://cscope.sourceforge.net/
    ctags  - is also useful for helping browse source code.
    The description from the web site says.
            Ctags generates an index (or tag) file of language objects found in
            source files that allows these items to be quickly and easily located
            by a text editor or other utility. A tag signifies a language object
            for which an index entry is available (or, alternatively, the index
            entry created for that object).
    
    See http://ctags.sourceforge.net/ for more info. The versions that have been installed allow the -R options to recursively search current directories (which the default versions on the student.cs environment do now). I've also added a script that I find handy. I call it cview.
    % cat ~cs350/bin/cview
    #!/usr/bin/csh
    set usebin = ~cs350/bin
    $usebin/ctags -R
    $usebin/cscope -R
    
    Run this from the main os161 directory (i.e., os161-1.99).

  6. I can't install OS/161 because it can't find cs350-gcc
    I tried to install OS/161 on Ubuntu and got the following error when I
    ran "make depend"
    
    /bin/sh: cs350-gcc: command not found
    make: *** [depend] Error 127
    
    It looks like either:
    Have a look at what your PATH is set to, as follows and the output should look something like below:
    % printenv PATH 
    /u5/kmsalem/bin:/u/cs350/sys161/bin:/u/cs350/bin:/software/.admin/bins/bin:/bin:/usr/bin:/usr/bin/X11
    
    The key is that you need to ensure that both /u/cs350/sys161/bin and /u/cs350/bin appear in your PATH. They should also appear before most other things in your PATH. Remember, if you set your PATH using the command line in one window it is NOT set in any other windows. So it will need to be set in each window and each time you log in. To avoid this problem, you should set the PATH as explained in the provided documentation, log out, and log back in. That way it should be set properly in all windows and each and every time you log in. CSCF and MFCF have lots of useful information for the student computing environment available at their web site. Some useful links might be:
  7. I'm having trouble with a CVS locking error
    cvs diff -c kern/main/main.c
    cvs diff: [02:25:12] waiting for username's lock in 
    /u7/username/cvsroot/cs350/os161-1.99/kern/main
    
    To get rid of the errors, you need to delete all the lock files in your ~/cvsroot directory...but there could be lots. Or you could delete that directory entirely and redo "Setting up your CVS repository" part in the assignment.

  8. I can't install OS/161 because it can't find gcc.

    You are likely not working on a machine that has the proper software installed. See "I'm having trouble getting OS/161 installed" in this document.


  9. I am having trouble configuring the GCC MIPS Cross-Compiler

    I see output like:
    ...
    > checking whether the C compiler (/usr/bin  ) works... no
    > configure: error: installation or configuration problem: C compiler cannot create executables.
    
    Check the directory of gcc:
    % which gcc
    /usr/bin/gcc
    
    Explicitly set the variable CC to the path to gcc in your call to configure:
    $ CC=/usr/bin/gcc ./configure -nfp --disable-shared --disable-threads --disable-libmudflap --disable-libssp --target=mips-harvard-os161 --prefix=$HOME/sys161/tools