Advanced Programming in the UNIX Environment

CS810 D - APUE

Note: The first day of classes will be 2008-09-02, not 2008-08-26.


Course Outline

In this course, students will learn to develop complex system-level software in the C programming language while gaining an intimate understanding of the UNIX operating system (and all OS that belong to this family, such as Linux, the BSDs, and even Mac OS X) and its programming environment.

Topics covered will include the user/kernel interface, fundamental concepts of UNIX, user authentication, basic and advanced I/O, fileystems, signals, process relationships, and interprocess communication. Fundamental concepts of software development and maintenance on UNIX systems (development and debugging tools such as "make" and "gdb") will also be covered.

While there are no prerequisite courses, students are expected to have a good working knowledge of the C programming language and to be able to competently use a UNIX system with a command-line shell interface.

You will be writing a lot of code in this class. You may also find the need to read a lot of code not written by you as well as the manual pages accompanying the sources. On lab.cs.stevens-tech.edu, you can find the complete source tree of NetBSD in /usr/src -- feel free to snoop around in there.


Time, Date & Place:

Fall 2008: Tuesdays 6:15-8:45pm, Babbio Center 221

Note: The first day of classes will be 2008-09-02, not 2008-08-26.


Resources:


Textbooks:

The textbook used in this class is:

The first edition is also acceptable, even though we will be teaching from the second edition.

The following books are recommended purely for your own personal reference. They're not used in the class as a text, but are related and very useful books to have:

  • ``The C Programming Language'' -- important: make sure you get the 2nd Edition covering ANSI C.
    by Brian W. Kernighan and Dennis M. Ritchie.
    Prentice Hall, Inc., 1988.
    ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
  • ``The Practice of Programming''
    by by Brian W. Kernighan and Rob Pike.
    Addison-Wesley, Inc., 1999.
    ISBN 0-201-61586-X.
Online vendors such as Amazon.com, bn.com, bookpool.com etc. usually sell these books for cheaper than the Stevens bookstore.

Instructor:

Jan Schaumann [jschauma@cs.stevens.edu]

Systems Used

All software development will be done on the linux-lab.cs.stevens-tech.edu and lab.cs.stevens-tech.edu systems. It is your responsibility to get an account on these systems.

All grading will be done on these systems. While you may choose to develop on your own personal host, you should make sure that your code compiles and runs flawlessly on these systems.


Grading:

There will most likely be:
  • 2 homework assignment, worth 20 points
  • 4 Quizzes, worth 20 points each. The quiz with the lowest grade will be dropped.
  • 1 midterm project, worth 100 points.
  • 1 final project, worth 200 points.
  • 1 final exam, worth 100 points.
  • no curve
Letter grades will be given as follows:
  • 450 - 500 points => A
  • 400 - 449 points => B
  • 350 - 399 points => C
  • 0 - 349 points => F

Plagiarism, Cheating and other ways to get an F

This really should not be necessary, but just to preempt any complains that I did not make myself clear:
Students are responsible for their own work. It is unethical (and in some cases illegal) to present as one's work the ideas, words or representations of another without the proper indication of the source. Therefore, it is the student's responsibility to give credit for any quotation, idea or data (such as statistical data or source code) borrowed from an outside source.

Failure to do so constitutes plagiarism, may imply copyright infringement and license violations and is viewed as cheating in this class.

Midterm Project:

Not yet finalized. In previous years, a common midterm assignment was to implement the ls(1) or cp(1) command. See this midterm project description for an example of a previous midterm assignment.

Final Project:

Not yet finalized. In previous years, example final assignments included a smsync client and server (smsync(1), smsyncd(8), smsyncd.conf(5) and smsync(4)), a simple chat client and server, or an http server capable of serving CGIs.

Syllabus:

Notes, slides, etc. below are from previous semesters for your reference. They will be updated as the semester progresses.  
Date Topic Reading Material Notes Podcasts
2008-09-02 Introduction, UNIX history, UNIX Programming Basics Stevens: Chapters 1, 2 Lecture Slides  
simple-cat.c
simple-ls.c
simple-shell.c
simple-shell2.c
01 02
2008-09-09 File I/O, File Sharing Stevens: Chapter 3 Lecture Slides
 
openmax.c
hole.c
lseek.c
openmax.c
sync-cat.c
 
2008-09-16 Files and Directories Stevens: Chapter 4 Lecture Slides
 
access.c
chmod.c
still-simple-ls.c
umask.c
 
2008-09-23 Filesystems, System Data Files, Time & Date Stevens: Chapter 4, 6 Lecture Slides
 
wait-unlink.c
cd.c
 
2008-09-30 Process Environment, Process Control Stevens: Chapters 7, 8 Lecture Slides
 
const.c
exit-handlers.c
forkflush.c
hw.c
setjmp1.c
setjmp2.c
setjmp3.c
 
2008-10-07 Signals Stevens: Chapter 10 Lecture Slides
 
getpwnam.c
pending.c
sigusr.c
 
2008-10-21 Interprocess Communication Stevens: Chapter 14 Lecture Slides

BSD IPC Tutorial
BSD IPC

pipe1.c
pipe2.c
socketpair.c
udgramread.c
udgramsend.c
dgramread.c
dgramsend.c
streamread.c
streamwrite.c
strchkread.c
 
2008-10-28 Advanced I/O: Nonblocking I/O, Polling, and Record Locking Stevens: Chapter 12 Lecture Slides

nonblock.c
 
2008-11-04 Go Vote!
Daemon Processes, final project discussion
Stevens: Chapter 13 Lecture Slides
Quiz #3 w/ solutions
initial final project thoughts
 
2008-11-11 UNIX tools: make(1), cvs(1), diff(1), patch(1), etc. CVS Documentation Debugging with GDB
Guide to Faster, Less Frustrating Debugging
gdb Tutorial
Lecture Slides

Makefile.1
Makefile.2
Makefile.3
Makefile.4
gdb1.c
gdb2.c
 
2008-11-18 Final Project Discussion, gdb(1) Debugging with GDB
Guide to Faster, Less Frustrating Debugging
gdb Tutorial
smsync(1) [roff]
smsyncd(8) [roff]
smsyncd.conf(5) [roff]
smsync(4) [roff]
 
2008-11-25 Encryption in a Nutshell
Final Project Discussion
  Lecture Slides
Quiz #4 w/ solutions
 
2008-12-02 Final Exam (example) - exam given at standard class time/place all covered chapters and materials Open Book  
2005-12-20, 10:59:59 Final Project due ----- -----