Assignment/Project 0

CS/ECE 354, Fall 2015


Due Monday, Sep 14 before 9am.

Please post all questions to the piazza page: http://www.piazza.com/wisc/fall2015/cs354/

THIS PROJECT MUST BE DONE INDIVIDUALLY!

Purpose

This assignment is intended to give experience using a Unix(Linux) operating system. Knowing how to work within a Unix(Linux) environment is a valuable skill, and one that will be needed in further CS classes. It is also needed by many software developers. Please do not assume that you will get by in this class doing assignments using another (Windows) system, copying as necessary to turn in assignments.

Statement

All work for this assignment is to be done on one of the department's instructional Unix (Linux) machines. You are welcome to remotely log in using your own SW package (SecureCRT, ssh, putty, etc.), but you will have to figure out those details on your own. It is not that hard really.

This assignment requires you to use several different software tools, including a C compiler, web browser, and an editor, to obtain answers that are placed in a file.

Read the Lab Tutorial in the online book Operating Systems: Three Easy Pieces by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau. It has some useful tips for programming in the C environment.

In particular, there are two tools you need to become quite familiar with. The first is a shell. The shell is where you type commands; getting efficient at doing so (and in particular, learning all of the keyboard shortcuts, etc.) makes you more wizard-like. Spend the time and read the documentation! You can type man bash to learn more about the bash shell, for example; it is a long but worthwhile read! And while many people use the bash shell, others use tcsh (like me) or zsh or even more exotic ones. Pick one you like, learn how to use it well, customize it to make yourself more efficient, and in general spend the time to get better at it!

The second tool of note is your text editor. Becoming efficient within a particular text editor means spending a lot of time with it, learning all of the keyboard shortcuts, and in general being able to type in and move around code quickly. Many use emacs, and others use vim (like me), a variant of another old editor known as vi. Neophytes use tools like gedit, which perhaps is not a bad way to begin, but really not powerful enough to get the job done in your career; even if you start here, you'll need to eventually move to something better. There are some platform-specific rather cool editors out there, for example, TextMate for the Mac. You might feel like checking something like that out too.

Here are some useful tutorials. Do note that it takes a long time of simply using and learning about any of these tools to become proficient. Start spending the time now!

For this assignment, do the following:

  1. To launch a shell on department's instructional Unix (Linux) machines, go to Aplications->System Tools->Terminal.
  2. If you do a listing (figure out what shell command to use) of files in your home directory, you should see a directory named "private".
    Go inside (using a shell command) the private directory and create a new directory (another shell command) named "354".
    Next, create another directory inside "354" named "a0" and change your current directory to a0.
  3. We have written a little C program for you. You need to copy the program, compile the program, modify the program (to fix the error), and then recompile and run the program. Make note of the compiler's output as well as the corrected program's output. The program source code is in the file
    /p/course/cs354-common/public/bin/a0.c
    (C language source code programs end with the suffix .c by convention.)
    1. Copy the file using approriate linux command to your current directory.
    2. Compile the copied file (a C program). For information about how to compile, read further under Notes below.

    On purpose (to require you to edit the file), this program contains an error. Make note of the compiler error you receive. Then, use an editor to correct the program. Compile the corrected program, and then run the program, making note of the program's output.

  4. Almost everything you need to know about CS/ECE 354 is posted on the course web page. You need to run a web browser, find the course home page, (Note: you've already done this, to find this assignment!) and make note of the TA names and office hours.
  5. Look at the questions given in the file
    /p/course/cs354-common/public/html/homeworks/a0.questions
    Copy the file to your current directory and record your answers to the questions in it (using an editor).

Do not forget to record your name and section number at top of the file. This file is the end result of the assignment and needs to be turned in.

Notes

Handing In the Assignment

To turn in the assignment, copy the file "a0.questions" with your answers to the handin directory.
shell% cp a0.questions /p/course/cs354-common/public/fall15.handin/<yourloginID>/p0/