The University of Chicago
Department of Computer Science

CSPP 51081 Course Syllabus
Fall 2007

Unix Systems Programming

Unix Systems Programming Links Home Page

Teaching staff:

Instructor:          Mark Shacklette
Office:                 Ryerson 175A
Office Hours:     Monday,  3:30-4:30 pm (by appointment only)
                          Monday, 4:30-5:15 pm (drop in)

email:     mark@cs.uchicago.edu (read hourly or so)
               mshack@post.harvard.edu (read hourly or so)

NOTE:   ALL non-confidential email should be addressed to the list.

Lead TA: Ross Girshick
  Email: rbg@cs.uchicago.edu
  Lab hours: n/a
  Office hours:   TBD
Location:   Ryerson 4rd floor lab


Assistant TA: TBD
  Email:
  Lab hours: TBD
  Office hours:   TBD
Location:   TBD

Tutorial TA: Sonjia Waxmonsky
  Office: Ryerson 177
  Tutorial Time: Tues 8:30pm - 10pm (Weeks 1-3 only)
  Office Hour: Email for appointment
  C Tutorial web page

Text for the C Tutorial:  Kernighan & Ritchie, The C Programming Language, 2nd ed.   (ISBN: 0131103628)

Course Home Page: http://www.classes.cs.uchicago.edu/current/51081-1/
 
 
SUBJECT COURSE TITLE TIME BUILDING
324 51081 Unix Systems Programming Monday, 5:30 pm Eckhart 202

I. TEXT AND MATERIALS
 

Texts: Required (get the latest (i.e., currently published) editions of the following)

1.  Advanced Programming in the UNIX(R) Environment , Richard Stevens, Addison-Wesley, ISBN: 0201563177 (2 copies on Ready Reserve in Eckhart)

2.  Effective awk Programming, 3rd ed., Arnold Robbins, available online at: http://www.gnu.org/software/gawk/manual/gawk.html

AND Choose ONE of the following:

IF you are a total newbie to Unix and Unix C programming (i.e., a beginner with minimal hands-on experience):

3.a.  Beginning Linux Programming, 2nd Ed., Matthew & Stones, Wrox Press, ISBN:  1861002971 (2 copies on Ready Reserve in Eckhart)

ELSE, IF you already have a little hands-on experience with C programming: instead of Matthew & Stones use (this should be the majority of you):

3.b  Understanding Unix/Linux Programming:  A Guide to Theory and Practice, Molay, Prentice Hall, ISBN:  0130083968 (1 copy on Ready Reserve in Eckhart)

ELSE, IF you already have substantial experience with both Unix and C programming use:

3.c.  UNIX Systems Programming, Curry, O'Reilly, ISBN:  1565921631

Highly recommended, if you're not using Molay's introduction above in 3.b:

4.  UNIX Network Programming, Volume 1: Networking APIs - Sockets and XTI (2nd Edition), Richard Stevens, Prentice Hall, ISBN: 013490012X (2 copies on Ready Reserve in Eckhart)

5.  Programming with POSIX Threads, Butenhof, Addison-Wesley, ISBN:  0201633922 (2 copies on Ready Reserve in Eckhart)
 

Texts: Recommended

C Language Instruction

If you are new to C and need a good and substantive introduction to the language, we recommend either of:

Introductory C, Petersen; Morgan Kaufmann Publishers; ISBN: 0125521421 ; 2nd edition (January 15, 1997)

C Programming:  A Modern Approach, King; W.W. Norton & Company; ISBN: 0393969452 ; (April 1996)
 

General Unix C Programming:

Managing Projects with Make , Andy Oram and Steve Talbott, O'Reilly, 1991

Unix Systems Programming with SVR 4, David Curry, O'Reilly,   1996

Linux Socket Programming By Example, Warren Gay

Pthreads Programming, Nichols et. al, O'Reilly, 1996

The Unix Programming Environment, Kernighan & Pike, Prentice Hall, 1984

Advanced Unix Programming, Rochkind, Prentice Hall, 1985

Interprocess Communications in UNIX:  The Nooks & Crannies , Gray, Prentice Hall, 1988

Unix Distributed Programming, Brown, Prentice Hall, 1994

Power Programming with RPC, Bloomer, O'Reilly, 1992

Using C on the UNIX System, Curry, O'Reilly, 1989

GNU Online Documentation for make, gcc, gdb, etc.

General Unix:

Learning the UNIX Operating System , 4th Edition , Peek, et. al., Orielly, 1997

A Practical Guide to Linux , Mark Sobell, Addison-Wesley, 1997

Portable Shell Programming , Bruce Blinn, Prentice Hall, 1996

UNIX Power Tools, Peek et. al., O'Reilly, 1993

Learning the Bash Shell, 2nd. Ed., Newham & Rosenblatt, O'Reilly, 1998
 

Sed & Awk & Regular Expressions:

Unix Awk and Sed Programmer's Interactive Workbook, Peter Patsis, Prentice Hall, 1999

Mastering Regular Expressions , Jeffrey E. F. Friedl, O'Reilly, 1997

sed & awk , Dale Dougherty, O'Reilly, 1990

The AWK Programming Language , Aho, Kernighan, Weinberger, Addison-Wesley, 1988
 

General Operating Systems:

Modern Operating Systems, 2nd. Ed., Tanenbaum, Prentice Hall, 2001

Operating System Concepts, 5th Ed., Silberschatz & Galvin, Addison-Wesley, 1998

UNIX Internals:  The New Frontiers, Vahalia, Prentice Hall, 1996

UNIX Internals:  A Practical Approach, Pate, Addison-Wesley, 1996
 

Texts: Ready Reserve Reading List

The Unix Philosophy, Gancarz
 

II. PREREQUISITE:

Knowledge of C Programing is assumed and required.  C will not be taught as part of this course, although tutorials will be offered.  Some practical Unix experience from a user's level will prove helpful but is not required.

Basic familiarity with a Unix source code editor (vi, emacs, nedit, pico, gedit, etc.) will be necessary.

III. COURSE DESCRIPTION

CSPP 51081 is systems programming course which explores topics in systems  programming on Unix. Topics to be covered in detail will include:

Unix History and Philosophy
Advanced utilities and Here Documents
File system, files and  links
Static and Shared Libraries
Regular Expression parsing and engines (grep, egrep, sed, awk, vi)
Processes and Signals (fork, etc.)
Pipes (unnamed and FIFOs)
System V IPC (semaphores, message queues, shared memory)
Berkeley Sockets
Sun RPC

Various tools used in developing software in C on Unix will be covered, including gcc, gdb, ddd, gprof, cvs, etc.

Because this is a programming course, students will be expected to know the C programming language upon course entry.

IV. LEARNING OBJECTIVES

Upon completion of this course the student will::

A. Understand advanced UNIX operating system concepts and terminology.

B. Develop a command of the Unix Shell environment, including advanced Unix commands and utilities.

C. Learn basic AWK programming and the use of Regular Expressions.

D. Become acquainted with the basic tools used to develop software on the Unix platform.

E. Become familiar with basic IPC issues and techniques in Unix programming

F.  Become familiar with socket programming using the Berkeley socket API

G.  Become familiar with both the theory and practice of making Remote Procedure Calls in Unix

V. ACADEMIC INTEGRITY

Students are expected to have read and understood the University's policy on Academic Integrity. This policy is detailed in the Student Manual of University Policies and Regulations, available online at http://www.uchicago.edu/docs/studentmanual/ .
 

VI. METHOD OF INSTRUCTION

Methods include lecture and homework assignments.
 

VII. OTHER COURSE INFORMATION

Attendance:

No formal attendance taken. There may be information presented in class that is not in the texts. You will be responsible for all information discussed in class and assigned in the required readings.

Make-up Work:

If you miss an exam or quiz, you will need to speak with the instructor ASAP .

Students are expected to read the assigned texts before class in order to be able to full participate in the discussions.
 

VIII. METHOD OF EVALUATING STUDENT PROGRESS

Assigned work evaluated as follows:

Assigned work will be evaluated as follows:
 
 
6 Labs (55 points each) 330 pts
1 Mid-Term 335 pts
1 Final Exam (or option below) 335 pts
Total 1000 pts

Students may, with the prior permission of the instructor, opt to do either of the following  in lieu of the final exam:

1.    Write a 12-15 page page research paper, double spaced with 1 inch margins, including bibliography and footnotes, detailing the internal activities and interfaces of some substantial portion of the Linux kernel (process management, memory management, virtual memory, file system, scheduling, etc.)  The quality of the paper should be targeted as publishable.  You will need to demonstrate full command of the topic in detail through both the paper as well as possible oral review of its content with the instructor.  The approval process requires a 2 page detailed research topic statement including a proposed outline of contents, resources, etc.  Plagarism, in any form, will result in an F for the course.

2.    Define a non-trivial systems programming project and implement it.  The approval process requires a 2 page statement of the project, detailing the project scope, deliverable, and tools to be used.  Delivery of the project involves a makefile that builds the software and supporting libraries, etc., and will be open to possible oral review with the instructor.  If you choose this option, you may tailor the labs to support the ongoing development of the project (where relevant) and with the approval of the instructor or TA.  Your project should include multiple topics of the course, for instance, multiple threads, thread concurrency controls, sockets, IPC, etc.  An example of a non-trivial programming project might be a  web server written in C that supports multiple simultaneous clients and basic HTML delivery and implements some subset of the HTTP protocol.  Plagarism, in any form, will result in an F for the course.

NOTES:

1.    You must obtain the instructor's approval for either of these options by 11:59 pm, October 22ndThere will be no exceptions to this.

2.    Plagarism in any form will result in a final grade of 'F' for the course and notification of the program director for disciplinary action.

3.    Both options produce the same total point availability as the final exam:  335 points out of 1000.

4.    You may not work together on either of these options.  Both options must be completed on an individual basis.
 

Delivery Process:

The due dates for labs have been updated and are on the syllabus calendar below in RED.  All labs are required.

Lab assignments, when completed, should be tarballed up into a single gzipped tarball and sent to the graders directly (NOT to the instructor or TA(s)).  The graders will post instructions on submitting labs.

For each part of the lab assignment there are detailed descriptions of what you should turn in. You should include ALL supporting files (source files, data files, etc.) as attachments to the submission email (a single message).  Please send only UNIX-readable (text) files (that is, no MS Word documents!!!).  Word documents will be considered a personal affront to the instructor and will result in ignominy.  All work is graded on the LINUX CLUSTER (not solaris, hpux, irix, aix, etc.)

FAILURE TO PROVIDE AND DELIVER TO THE GRADERS ALL SCRIPTS, ALL COMMANDS, AND ALL SUPPORTING FILES, TEXT OR SOURCE, YOU USED TO DELIVER AND PRODUCE THE SOLUTION WILL RESULT IN A LOSS OF POINTS.  IF THE GRADERS, WORKING SOLELY ON THE LINUX CLUSTER, CANNOT REPRODUCE YOUR SOLUTION OR ANY PART OF YOUR SOLUTION FROM THE SET OF INFORMATION YOU PROVIDE, YOU WILL LOSE PARTIAL OR FULL CREDIT.

Note: Labs are due as scheduled below.

All assignments are due as specified on this syllabus.  Students who turn in work late, regardless of the reason, will receive 2 points off from the first day the assignment is due (calculated as the first 24 hour period following the due date and time), and continuing for 6 days.  Assignments turned in more than 7 days late from the original due date will not be accepted and the student will receive a 0 on the assignment.  The ONLY exception to this penalty will be a doctor's approved note of severe illness requiring overnight hospitilization, etc.  All late deliveries, regardless of cause, including, but not limited to acts of God, war, riot, embargoes, acts of civil or military authority, terrorism, fire, flood, tsumami, earthquakes, hurricanes, tropical storms or other natural disasters, fiber cuts, strikes, shortages in transportation, facilities, fuel, energy, labor or materials, failure of the telecommunications or information services infrastructure, hacking, SPAM, or any failure of a computer, server or software, including Y2K errors or omissions, the common cold, the flu, asthema, stomach flu, work, family, childcare, golf, vacation, and other life related exceptions and necessities, while unfortunate, will still incur the penalty.  It is assumed that you will have plenty of time to work on each assignment, and that an individual penalty will have little overall effect on a student's final grade, unless lateness is chronic or other grades are poor, in which case, of course, the penalty will be more cumbersome.  If you are late with a delivery and therefore receive a penalty (which you will if you are late for any reason) and it's an isolated incident and the rest of your work is excellent, the penalty should be innocuous. 

The purpose of quizzes is to encourage students to do the required reading preparation BEFORE class lecture.

The instructor reserves the right to alter the course contents, dates, times or percentage of credit based on time allowed and class progress through the course material. The instructor also reserves the right to curve grades if he deems it in the best interest of the majority of students.
 

IX. COURSE SCHEDULE

NB: The Instructor reserves the right to alter the schedule as class progress dictates.

The following abbreviations reference the following works:
 
 
Abbreviation Text
BLP Beginning Linux Programming 
UNP1 UNIX Network Programming, Volume 1
EAP Effective Awk Programming
PPT Programming with POSIX Threads (optional )
APUE Advanced Programming in the UNIX Environment
USP UNIX Systems Programming (optional )
UULP Understanding Unix/Linux Programming (optional )

NOTE:  Numbers besides the references are chapter numbers.  Odd numbers like APUE 14.1-14.5 mean sections 1 through 5 of chapter 14 of APUE.
 
 
Class 1 September 24 Introduction & syllabus review 
Unix History, Basic Unix Review 
Unix File System (architecture) 
Links, Here Documents, Shell quoting, 
pipes, filters 
Introduction to the shells, advanced utilities & process control
BLP, 1,2,4 
[UULP 1] 

FAQ 1  LAB 1
(Lab 1 will be due on 
Monday, October 1, by 5:00 pm
 

Class 2 October 1
Regular Expression Parsing, engines (grep, egrep, sed, vi) 
Awk Programming 
EAP, 1-8 

FAQ 2  LAB 2
(Lab 2 (HERE docs)will be due on Monday, October 8
Lab 2 (awk)will be due on Friday, October 12, by 5:00 pm)

Class 3 October 8
Tools and Compilation

C compiler, compiling & linking, 
creating and using static & shared libraries 
Introduction to Systems Programming:  Unix File I/O

BLP 3,4,8,9 
APUE 3,4,5 

FAQ 3  LAB 3
( Due dates for Lab3: Ex1,2,3: Monday, October 22, 2007 @5:00 pm; Ex4 (Signal Handling) Friday, October 26, 2007 @5:00 pm )

Class 4 October 15 Tools and Compilation continued

Introduction to make 
Debugging with gdb & ddd
Introduction to Systems Programming:  Processes & Signals
Processing Signals

APUE 3,4,5,7, 10 
[USP 2,3,4,5] 
[UULP 3,4] 

FAQ 3   LAB 3
(continued)

Class 5 October 22 Introduction to Systems Programming:   Processes & Signals 

Creating New Processes:  system, exec, fork 

BLP 10 
APUE 7, 8, 10 
[USP 10,11] 
[UULP 8,9] 

FAQ 4   LAB 4
(Lab 4 will be due on Monday, November 5, by 5:00 pm

Due date for project/paper option proposals

Class 6 October 29
Processes continued 

Pipes: unnamed & named (FIFO) 
Debugging multiple processes

APUE 9, 14.1-14.5 
BLP 12 
[USP 13(Pipes & FIFOs)] 
[UULP 10] 
FAQ 4   LAB 4
(continued) 
Class 7
November 5
NO CLASS

Class  8 November 12 MID TERM EXAM    (Written & Live) 
Mid Term Study Guide

Class 9 November 19
System V IPC: 
semaphores, message queues, shared memory
BLP, 13 
APUE 14.6-14.11 
[USP 13(System V IPC Functions)] 
[UULP  15.3] 

FAQ 5  LAB 5
(Lab 5 will be due on Monday, November 26, by 5:00 pm)

Class 10 November 26 C Socket Programming 
Sun RPC
UNP1 1-9 
[USP 14] 
[UULP 11,12,13] 

FAQ 6  LAB 6
(Lab 6 will be due on Monday, December 3, by 5:00 pm )

Class 11 December 3
FINAL EXAM: (Written & Live) 
Final Exam Study Guide

X. Online Reference and Resources:

General:

Norman Matloff's Unix Tutoral Center

IBM Developerworks Library

The Unix Reference Desk

Davin's collection of unix programming links

Unix Guru Universe

Unix FAQ Index at faqs.org

Stanford CS Education Library (C tutorials, programmer tools pdf, pointer references, fun with Binky, et. al.)

History of Unix by Mike Loukides

History of Unix by Dennis Ritchie

DDD Debugger

glibc Manual

Regular Expressions:

Regular Expression HOWTO

Single UNIX Specification:  Regular Expressions

 Steve Ramsay's Guide to Regular Expressions

Awk:

Introduction to Awk

How to Get Things Done With Awk

Awk Filters

C Programming:

Unix C Programming FAQ

A. D. Marshall's Programming in C:  UNIX System Calls and Subroutines using C

Introduction to C Programming

C Programming on Unix Tutorial at University of Strathclyde

POSIX Threads:

Threads FAQ

Programming Posix Threads Bounce Point
 
 

Supplemental Reading
(in no particular order)

Mastering Regular Expressions, Jeffrey E. F. Friedl (O'Reilly & Assoc. 1997, ISBN: 1-56592-257-3). An thorough discussion of an inexhaustible subject.

Learning the UNIX Operating System , 4th Edition, Jerry Peek, Grace Todino & John Strang (Orielly & Associates, 1997, ISBN: 1-56592-390-1) A virtual "Cliffs Notes" for the Unix Operating System.

Using C on the UNIX System, David A. Curry (O'Reilly & Assoc., 1985, ISBN: 0-937175-23-4). A good introduction to C programming on Unix.

Learning GNU Emacs, Debra Cameron & Bill Rosenblatt (O'Reilly & Assoc., 1991, ISBN: 0-937175-84-6). A good introduction to emacs.

UNIX for the Impatient, Paul W. Abrahams & Bruce R. Larson (Addison-Wesley Publishing Company, 1992, ISBN 0-201-55703-7). Good, clear coverage of the utilities, recommended for Unix beginners.

UNIX in a Nutshell: A Desktop Quick Reference for System V & Solaris 2.0 (O'Reilly & Associates, Inc., 1992, ISBN 0-56592-001-5). A handy reference for SysV and Solaris 2.

When You Can't Find Your UNIX System Administrator, Linda Mui (O'Reilly & Associates, Inc., 1995, ISBN 1-56592-104-6). The title says it all.

UNIX Power Tools, Jerry Peek, Tim O'Reilly, and Mike Loukides (O'Reilly & Associates, 1993, ISBN 0-679-79073-X). An excellent compendium of tricks of the masters, written for beginners and intermediates. Includes a CDROM of useful software.

Exploring the UNIX System, Stephen G. Kochan & Patrick H. Wood (SAMS, a division of Macmillan Computer Publishing, 1989, ISBN 0-8104-6268-0).(OUT OF PRINT)

Learning GNU Emacs, Debra Cameron and Bill Rosenblatt (O'Reilly & Associates, 1992, ISBN 0-937175-84-6).

Unix Shell Programming, Stephen G. Kochan & Patrick H. Wood (Hayden Book Co., 1990, ISBN 0-8104-6309-1). The classic on shell programming. The third edition is available at amazon

The Unix C Shell Field Guide, Gail Anderson and Paul Anderson (Prentice Hall, 1986, ISBN 0-13-937468-X).

A Student's Guide to UNIX, Harley Hahn. (McGraw-Hill, 1993, ISBN 0-07-025511-3). This, and its almost identical sister, Open Computing's Unix Unbound (same author and publisher), is an excellent aid for beginners. Hahn's wry humor runs throughout.

Tricks of the UNIX Masters, Russell G. Sage (Howard W. Sams & Co., Inc., 1987, ISBN 0-672-22449-6).

Unix System V: A Practical Guide , Mark Sobell (Benjamin/Cummings, 1995, ISBN 0805375678) (A classic)

Unix Network Programming, Volume 1: Networking APIs: Sockets and XTI , Richard Stevens (Prentice Hall, 1998, ISBN 013490012X) The definitive work on Unix Sockets

Unix Network Programming, Volume 2: Interprocess Communication, Richard Stevens(Prentice Hall, 1999, ISBN 0130810819) The definitive work on IPC.

Applied Unix Programming, Volume 2 , Bharat Kurani (Prentice Hall, 1997, ISBN 0133043460) The Unix C Library Reference Manual, includes C Library, math library, socket library, transport library, and internet library.

Advanced Programming in the Unix Environment , Richard Stevens (Addison-Wesley, 1992, ISBN: 0201563177). A practical guide to the theory of sockets and IPC on Unix.

The C Programming Language, Brian Kernighan and Dennis Ritchie (Prentice Hall, 1988, ISBN 0131103626). The definitive tutorial on the C Programming Language.

Pointers on C, Kenneth Reek (Addisson-Wesley, 1998, ISBN 0673999866). A good introduction to the C Programming Language.

C: A Reference Manual, Fourth Edition , Harbinson and Steele (Prentice Hall, 1995, ISBN 0133262243). A good reference manual for the C langugage.

Absolute Beginner's Guide to C , Greg Perry (Sams, 1994, ISBN 0672305100). One of the easiest avenues into C Programming in print.

Practical C Programming, Third Edition , Steve Oualline (O'Reilly, 1997, ISBN 1565923065). A good tutorial on C, and one of the few that assumes you might be using GNU tools as opposed to Microsoft's.

Design of the Unix Operating System , Maurice Bach (Prentice Hall, 1986, ISBN 0132017997). Perhaps the best general discussion of the details of the Unix Operating System.

Unix Internals: The New Frontiers , Uresh Vahalia (Prentice Hall, 1996, ISBN 0131019082). A newer discussion of the details of Unix, published 10 years after Bach's book.

Unix Internals: A Practical Approach , Steve Pate (Addison-Wesley, 1996, ISBN 020187721X). A good and readable discussion of the details of the Unix kernel.

The Linux Kernel Book, Card, et. al. (Wiley, 1998, ISBN 0471981419). A good book which concentrates on the particularities of the Linux Kernel code itself. A gentle tour through the kernel's source code. The book comes with a CD for RedHat 5.0, whose kernel's code is examined throughout the book.