The University of Sydney COMP2129 Operating Systems and Machine Principles
Semester 1, 2009

School of Information Technologies 

Contents
This page covers the following topics:
  • Unix & C learning resources
  • Changing your environment and window manager
  • Using the School of IT computers from home
  • Using a Unix environment on your own computer
  • Makefile advice (automated compiling)
  • Editing your code (text editors available)
Resources

Unix

C

  • The textbook is on the About page.

    Another reference is:

    The Indispensable Guide to C
    Paul Davies, Addison Wesley, ISBN 0-201-62438-9

  • A very good book on programming in C and Unix is:
    The Practice of Programming
    Kernighan & Pike
    Addison-Wesley
  • The Reflect web site is a system that allows you to try an exercise, assess your solution, assess given solutions and then compare your assessments with ours.
  • You will be introduced to the C debugger, gdb, in tutorials. If you get stuck, there is a good guide available.
  • This online reference covers all the topics for C in the subject
    (including concurrent programming with Pthreads): Programming in C
  • This is a very useful online reference to C: The C Library Reference Guide
Using the School of IT computers from home

Transferring files

Download an sftp client such as WinSCP, and give it the address of one of the School of IT computers (such as congo1.ug.it.usyd.edu.au). This will allow you to 'drag and drop' files between your system and the university's servers, and should automatically convert between Windows and Unix style line-endings (unless you're transferring an archive, such as a zip or tar file).

Telnet/SSH

SSH and telnet allow you to log in to your School of IT account remotely. If you use a Unix based system, such as Linux or Mac OS X, ssh is probably already installed; try typing ssh -l jsmit1234 congo2.ug.it.usyd.edu.au (where jsmit1234 is replaced by your user name).

If you're using Windows PuTTY is a very good client. Get the Windows installer from the Download Page.

Run PuTTY, and configure as follows (replace jsmit1234 with your undergraduate login name):


After clicking "Save" you can open a connection by double-clicking congo2.

Within PuTTY, you can use console-based text editors such as pico/nano and vi/vim. With an X Server (see below) you can run graphical editors such as kate, gedit and nedit.

Using graphical programs

To run graphical programs such as nedit and kate remotely you'll need to have an X Server installed on your home computer (the program will run on the School of IT server, but display on your machine). There are many available; a free one is available via the Cygwin installer. If you do this, you should set up PuTTY to forward X-connections as follows:

Unless you have a very fast network connection it won't be worth the effort.

Using a Unix environment on your own computer

Linux

To nurture your Unix skills, we suggest you do your coursework at home using a complete Linux distribution. If you have a broadband connection, we recommend downloading a recent CD image (ISO) of the Ubuntu distribution:

Note that Ubuntu operates somewhat like a Live CD as well, but does not have a full suite of applications available until you install it (e.g. gcc is not available).

Unix on Windows?

Another option is to run a Unix-like environment on top of Windows.

Makefiles

Makefiles provide a useful way to automate the compilation process and other repetitive tasks, such as testing. This Makefile can be used to automate the compile-test process -- just create a set of '.in' input test files and a corresponding set of '.out' expected outputs, then run make test. Make will compile your program (main.c for this Makefile) if it has changed and run the tests; showing you the difference between actual and expected output (if any).

To adjust it to your program, replace the two occurences of 'main' with the desired program name (optional) and 'main.o' with the name of your source file (with the '.c' replaced with '.o'). Note that it looks for all files ending in '.in', so you should keep separate directories for each of your programs. By the end of the course, you should understand how make test actually works!

Text Editors

The following text editors are installed. We suggest you try them all to find one you are comfortable with. However, editors further down each list are less recommended.

Console (Text-based) Editors

  • vim - or just vi (steep learning curve)
  • emacs - again a steep learning curve
  • nano - a more advanced pico - run ~helpdesk/linux/bin/nano and (try putting this .nanorc file in your home directory)
  • pico

Note that pico and nano should be run with the "-w" option if you want to disable word-wrap (unless you change the option in the .nanorc file for nano).

X11 Text Editors

  • kate
  • gedit
  • xfte - run ~tapted/bin/ft
  • nedit - slow
  • cooledit - run ~tapted/bin/cooledit - has integrated GDB
  • gvim - X11 version of vim
  • emacs
  • xemacs
  • red
Powered by  [Cellerator]