CSE4001 Syllabus
Operating Systems Concepts

Florida Tech, Fall 2005 - Aug. 22 to Dec. 16 - Mon. and Wed., 2:00-3:15 PM, room S401 Crawford Science Tower.
Class webpage: http://cs.fit.edu/~mmahoney/cse4001/

Course Description

Students will learn operating system concepts using UNIX/Linux as an example. Topics include the C shell, systems programming, design issues in process, memory, and file system management, networking, system administration and security.


Matt Mahoney, mmahoney@cs.fit.edu or if that doesn't work, then matmahoney@yahoo.com Office hours are immediately after class.


(required) Unix for Programmers and Users, 3nd ed., Glass and Ables, Prentice Hall, 2003. Read chapters 1-5, 8, 13-15. If you're familiar with UNIX, you can skim the earlier chapters.

(recommended) Operating Systems Concepts, 6th ed., Silberschatz, Gagne, and Galvin. Note: the comprehensive exams are based on this book. You should be familiar with the following topics in general and not just as they pertain to UNIX. Supplementary material needed to cover these topics will be provided.

Grading Policy

Grades are based on 60% exams and 40% homework.
Grade = 0.2 * (highest 3 of 4 exams) + 0.4 * (sum of homework grades).

Exams. There will be 4 tests during the term including the final exam. Each will count equally. Your grade will be based on the highest 3 tests after dropping the lowest score. There will be no make-up tests for any reason. Exams are open book and open notes.

Spring 2004 exams:
Exam 1 solution
Exam 2 solution
Exam 3 solution
Final exam solution

Fall 2005 exams:
Exam 1 solution
Exam 2 solution
Exam 3 solution
Final exam solution

Homework will include programming assignments in UNIX shell and C/C++, and a short research paper on a topic related to operating systems (such as security). You will need login access to a UNIX (or Linux) account. Get a Tracks account by the second class day if you don't already have one. Homework should be submitted by email. Late homework will be penalized 20% per day (including non-class days and weekends).

You must do your own work and cite all sources, including help from other students. If in doubt, see the FIT honor code.

Mailing List

Within 24 hours after the first class you should receive an email notifying you that you have been added to the fit-cse4001 mailing list. If you do not, then email me to request an invitation. You are responsible for all material posted to the list, such as homework assignments, test announcements, and additional course material. Once you are a member, you are encouraged to post questions (or answers) to the class at fit-cse4001@googlegroups.com. If you have a Google account you may also access the list at the members-only website groups.google.com/group/fit-cse4001.

Program examples

Introduction to UNIX
Program examples from the UNIX book (from code.zip available here).
median.csh is a C shell (csh) script to compute the median of a list of integers.
median.bash is the same program in BASH
reverse.c uses UNIX I/O to reverse a file in place.
tb.c, a network client to read a web page.


Assignment 1

Due Midnight, Aug. 31, 2005 (10 points).

1. Log into a UNIX (or Linux) system of your choice. Report the following:

2. Try each of the following commands: cat, chmod, chown, chgrp, clear, cp, date, head, ls, mail, man, mkdir, more, pwd, rm, rmdir, stty, tail, tset, vi, emacs, echo, eval, exec, exit, kill, login, shift, tee, umask, wait, sleep, ps, chsh, csh, sh, ksh, tcsh, bash, alias, unalias, chdir, dirs, foreach, if, while, repeat, glob, goto, nice, nohup, notify, onintr, popd, pushd, source, stop, suspend, set, unset, setenv, unsetenv, rehash, jobs, diff, grep, egrep, fgrep, perl, find, ln, od, sort, su, tar, ted, uniq, whoami, who, w, uname, netscape, word. Be sure you understand what each one does, either by reading about it in your book, by man command, or from an online resource such as Basic UNIX commands from UVM. Some of these commands will fail for various reasons, such as they don't exist or you don't have permission to run them. List all such commands and the reason they failed. Passing the wrong arguments or options is not a reason for failure. Find out what input is expected.

Email your homework to Matt Mahoney at mmahoney@cs.fit.edu. Put your results in the body of the message. Don't send attached files.

Assignment 2

Due Sept. 14, 2005 (10 points). Write a shell script in bash to factor an integer argument like the UNIX factor command. See man factor.

Email your homework to Matt Mahoney at mmahoney@cs.fit.edu either as an attached file or in the body of the message.

Solution using csh

Assignment 3

Due Nov. 2, 2005 (50 points). Write a shell in C or C++. It should accept the following input:

  cmd args...                     Execute command with arguments
  *                               Matches all files unless starting with .
  name*                           Matches all files starting with "name"
  < file                          Redirect input from a file
  > file                          Redirect output to a file
  >> file                         Append to a file
  cmd1 | cmd2                     Pipe cmd1 output to cmd2 input
  >&  >>&  |&                     Redirect both stdout and stderr
  cmd1 && cmd2                    Execute cmd2 if cmd1 succeeds
  cmd1 || cmd2                    Execute cmd2 if cmd1 fails
  cmd1 ; cmd2                     Execute cmd1 then cmd2
  &                               Execute in background
  ^C                              Kill foreground process
  ^D                              Exit shell
Any sequence of words which is not one of the special symbols listed above is taken as a command followed by arguments. Commands should be executed by searching the PATH, or print an error message if not found. Operator precedence should be the same as in csh. From highest to lowest:
  1. Command arguments
  2. Redirection operators: < > >> | >& >>& |&
  3. Sequential operators: && || ;
  4. Background: &
with left to right evaluation for operators of equal precedence. For example
  echo this is a test && ls * | sort -r > log & tail -f log
runs echo, ls, and sort (but not tail) in the background. The output of sort (but not echo) is redirected to log. The output of ls (but not echo) is redirected to the input of sort (but not to tail). If echo fails, then ls and sort do not run, but tail still does. There are 4 arguments to echo, 1 to sort, 2 to tail, and 1 to ls for each file in the current directory not starting with .

You may assume that all symbols are separated by one or more spaces. You do not need to support wildcards other than *, and only at the end of a filename.

Your program must run on olin.fit.edu. Email ONE attached file (.c or .cpp) to Matt Mahoney at mmahoney@cs.fit.edu.

Grading: one point off for each test below that fails if received by midnight, Oct. 26. After that, 1.5 points off for each test that fails. These should all work as in the normal shells. You may resubmit revised versions to improve your grade, but allow at least one day for feedback.

1  Simple commands                 ls
2  Command not found               foobar
3  Commands with arguments         echo -n hello world
4  Wildcard expansion              echo *                 
5  Wildcard as a suffix            echo .*
6  Redirect input                  cat < file1
7  Redirect output                 echo hello > file1
8  Redirect standard error         rm / >& /dev/null
9  Redirect failure detected       cat < foobar > /
10 Append                          echo world >> file1
11 Append standard error           rm / >>& file1
12 Simple pipeline                 ps | sort
13 Pipe with arguments             ps -ef | sort -r
14 Pipe standard error             rm / |& wc
15 Pipe with redirection           cat < file1 | sort > file2
16 Background (check with ps)      sleep 10 &
17 Pipe in background              ps | sort &
18 Rerdirect in background         ps > file1 &
19 Sequence                        echo -n hello ; echo world
20 Pipe in sequence                ps | sort ; echo done
21 Redirection in sequence         echo -n hello > file1 ; echo world >> file1
22 Sequence in background          sleep 5 ; ps &
23 Pipe, redir, seq, in background sleep 5 ; ps -ef | sort > file1 &
   (file1 appears in 5 sec.)
24 Status succeeds                 cmp file1 file2 && echo files identical
25 Status fails                    cmp file1 file2 || echo files differ
26 Control-C does not kill shell   ^C
27 Control-C kills process         sleep 10
28 ^C kills all active processes   sleep 10 | sleep 10
29 ^C doesn't kill in background   sleep 10 &

If you use a modified version of ish.c then at a minimum you must remove code related to network server/client commands and your program must compile without the -lsocket -lnsl options.

Assignment 4

Due Dec. 7, 2005, midnight (30 points). The final project will be a paper on the topic of operating system security. Describe five attacks with at least one from each of the following categories. For each attack, describe:

As a starting point, read my summary, Computer Security: A Survey of Attacks and Defenses, but don't use this as your only resource. You should have at least one additional reference for each attack. Your references should provide enough information to both launch an attack and to protect your system against it.

I am looking for roughly 3-6 pages, including introduction, conclusion, and references. This should be a quality paper with good spelling, grammar, organization, and comprehensibility. Cite all your sources. You may submit a printed paper in class or email me an attachment in PostScript, PDF, or Word (.doc) format by midnight.

Extra Credit (15 points)

Prepare a 15 minute oral presentation to be given during the last week of class, describing one of the attacks in your paper. Your presentation should be about 5-8 slides (HTML or PowerPoint) and should be available on your website. You will be able to present it in class using the computer projector. (You have a website at http://my.fit.edu/~username/ at public_html/index.html in your TRACKS home directory, but you can use any website you want). Grading will be mainly on the content of your presentation (not on pretty graphics or on the actual talk).

If you plan to give a presentation, let me know so I can schedule you. I will schedule 5 per day from the last class and working backwards, first come first served. If you would like me to comment on your presentation in advance, send me the link.