Advanced Programming in the UNIX Environment
CS631 - APUE
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. This class overlaps significantly with
CS392 ``Systems Programming'' -- you cannot take CS631 if you have
taken CS392.
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. For the
complete sources of the NetBSD operating system, take a look here.
Time, Date & Place:
Mondays, 18:15 - 20:45, Edwin A. Stevens Hall 222
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 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@stevens.edu]
Systems Used
All software development will be done on the
linux-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:
- 5 homework assignment, worth 20 points each
- 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
Within each letter grade, there are +/- grades given at the
discretion of the instructor. (Exception: there is no A+)
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.
Implement the "ls(1)" command as
decribed in the manual page provided to you.
See the full midterm project
description for details.
Implement the "sws(1)" command as
decribed in the manual page provided to you.
See the full final project
description for details.
This year we have a take-home final exam. Please find
it here.
| Date |
Topic |
Reading Material |
Notes |
| 2012-08-29 |
Introduction, UNIX history, UNIX Programming
Basics |
Stevens: Chapters 1, 2 |
Lecture slides
simple-cat.c
simple-ls.c
simple-shell.c
simple-shell2.c
HW#1 |
| 2012-09-03 |
Labor Day Holiday |
| 2012-09-10 |
File I/O, File Sharing |
Stevens: Chapter 3 |
Lecture
Slides
hole.c
lseek.c
openmax.c
sync-cat.c
HW2: tcp(1),tcpm(1) |
| 2012-09-17 |
Files and Directories |
Stevens: Chapter 4 |
Lecture
Slides
access.c
chmod.c
size.c
still-simple-ls.c
umask.c
Midterm Project Assignment |
| 2012-09-24 |
Filesystems, System Data Files, Time &
Date |
Stevens: Chapter 4, 6 |
Lecture
Slides
wait-unlink.c
cd.c |
| 2012-10-01 |
Process Environment, Process Control |
Stevens: Chapters 7, 8 |
Lecture
Slides
entry.c
exit-handlers.c
forkflush.c
hw.c
setjmp1.c
setjmp2.c
setjmp3.c |
| 2012-10-09 |
Process Groups, Sessions, Signals |
Stevens: Chapter 10 |
Note: Tuesday class!
Lecture
Slides
FreeBSD Process Management (from "The Design and Implementation of the FreeBSD Operating System")
eintr.c
pending.c
reentrant.c
sigusr.c |
| 2012-10-15 |
Interprocess Communication |
Stevens: Chapter 14 |
Lecture
Slides
BSD IPC Tutorial
BSD IPC
pipe1.c
pipe2.c
popen.c
semdemo.c
shmdemo.c
memory-layout.c
msgsend.c
msgrecv.c
socketpair.c
udgramread.c
udgramsend.c
dgramread.c
dgramsend.c
streamread.c
streamwrite.c
strchkread.c
|
| 2012-10-22 |
Advanced I/O: Nonblocking I/O, Polling, and Record
Locking |
Stevens: Chapter 14 |
Lecture
Slides
nonblock.c
flock.c
Final Project
Assignment
HW#3
|
| 2012-10-29 |
Class cancelled due to hurricane Sandy |
| 2012-11-05 |
Class cancelled |
| 2012-11-12 |
Dæmon Processes, Shared Libraries |
Stevens: Chapter 13 |
Lecture
Slides
dlopenex.c
evil.c
ldtest1.2.c
ldtest1.c
ldtest2.c
main.c
setget.c
HW#4 |
| 2012-11-19 |
UNIX tools: make(1), revision control, diff(1), patch(1), gdb(1) |
CVS Documentation
Debugging with GDB
Guide to Faster, Less Frustrating Debugging
gdb
Tutorial
Git |
Lecture Slides
compile chain examples
make examples
gdb examples
|
| 2012-11-26 |
Encryption in a Nutshell
Final Project Discussion / Code Review |
|
Lecture Slides
HW#5 |
| 2012-12-03 |
Code Review / Porting |
bozohottpd |
Lecture Slides |
| 2012-12-10 |
Code Reading |
lighttpd
mini_httpd
nginx
|
Lecture Slides |
|