The University of Chicago
Department of Computer Science
MPCS 51081 Course Syllabus
Winter 2017
Unix Systems Programming
Teaching staff:
Instructor:
Mark Shacklette
Office:
Young 208B
Office Hours: Monday 3:30-5:30 PM
email: mark (at) cs.uchicago.edu (read hourly
or so)
mshack (at) post.harvard.edu (read hourly or so)
NOTE: ALL non-confidential
email
should be addressed to piazza.
TA: |
|
Email: |
|
Laboratory Hours |
Course Home Page: http://www.classes.cs.uchicago.edu/current/51081-1/syllabus.html
SUBJECT | COURSE | TITLE | TIME | BUILDING |
324 | 51081 | Unix Systems Programming | Friday, 5:30 pm - 8:20 pm |
Young 302 (unless otherwise noted) |
I. TEXT AND MATERIALS
Texts: Required (get the latest (i.e., currently published) editions of the following)
The Linux Programming Interface: A Linux and UNIX System Programming Handbook, Michael Kerrisk, No Starch Press, 2010, ISBN: 1593272200
(2 copies on Ready
Reserve in Eckhart)
Highly recommended:
Understanding Unix/Linux Programming: A Guide to Theory and Practice, Molay, Prentice Hall, ISBN: 0130083968 (1 copy on Ready Reserve in Eckhart)
Advanced Programming in the UNIX(R) Environment , Richard Stevens, Addison-Wesley, ISBN: 0201563177 (2 copies on Ready Reserve in Eckhart)
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)
Programming with POSIX Threads, Butenhof,
Addison-Wesley, ISBN: 0201633922 (2 copies on Ready Reserve in
Eckhart)
Texts: Recommended
C Language Instruction
Knowledge of C is required. If you need some review of C, we recommend either of:
The C Programming Language, 2nd ed. Kernighan & Ritchie. ISBN: 0131103628
C: A Reference Manual (5th Ed.), Harbison & Steele; Prentice Hall (2002). ISBN: 013089592X
Expert C Programming--Deep C Secrets, van der Linden, Prentice Hall (1994). ISBN: 0131774298
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:
Beginning Linux Programming, 4th Ed., Matthew & Stones, Wrox Press, 2008. ISBN: 9780470147627
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
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. PREREQUISITES:
1. Knowledge of C Programing is 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
Unix File I/O
Static and Shared Libraries
Processes and Signals (fork, exec, etc.)
Pipes (unnamed and FIFOs)
System V IPC (semaphores, message queues, shared memory)
Berkeley Socket programming
Sun RPC
POSIX pThread programming
Various tools used in developing software in C on Unix will be covered in class and/or tutorial, including gcc, gdb, ddd, gprof, cvs, etc.
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. Become acquainted with the basic tools used to develop software in C on the Unix platform.
D. Become familiar with basic IPC issues and techniques in Unix programming
E. Become familiar with socket programming using the Berkeley socket API
F. Become familiar with both the theory and practice of making Remote Procedure Calls in Unix
G. Become familiar with multithreaded programming in C using POSIX pThreads on 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://studentmanual.uchicago.edu/
.
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. Prepare for unhappiness.
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:
8 Labs (12 points each) | 96 pts |
1 Mid-Term | 402 pts |
1 Final Exam (or option below) | 502 pts |
Total | 1000 pts |
NB: The end of the quarter is the time at which the final grade you have earned through your work in the quarter is recorded with the registrar. It is not the time at which you begin negotiations with Professor Shacklette for extra credit opportunities. There is no extra credit offered in this course, either at the beginning or at the end.
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 20-30 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 multithreaded 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 and reporting to the program director.
NOTES:
1. You must obtain the instructor's approval, via email, for either of these options by 11:59 pm, Friday, February 10th, 2017. There 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 carry the same total point availability as the final exam.
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 are on the syllabus schedule below. 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 and public humiliation. All work is evaluated and 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 and supporting lab pages. 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 6 days late from the original due date will not be accepted and the student will receive a 0 on the assignment. All late deliveries, regardless of cause 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 or two 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 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 |
LPI |
Linux Programming Interface |
BLP | Beginning Linux Programming |
UNP1 | UNIX Network Programming, Volume 1 (optional) |
PPT | Programming with POSIX Threads (optional) |
APUE | Advanced Programming in the UNIX Environment (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 | Tuesday, January 3 Young 106 |
Introduction & syllabus review Historical Introduction to UNIX |
LPI, 1-2 [BLP, 1,2,4] [UULP 1] Intro FAQ |
Class 2 | Sunday, January 15 1 PM - 4 PM (Rescheduled) Young 302 |
Tools and Compilation:
C compiler, compiling & linking Introduction to make Unix File I/O |
LPI 3-5; 13-18 [BLP 3,4,8,9] [APUE 3,4,5] |
Class 3 | January 20 |
Creating and using static libraries Creating and using shared libraries Introduction to Unix Processes |
LPI 6; 12; 41-42 [APUE 3,4,5,7, 10] [UULP 3,4] |
Class 4 | January 27 |
Unix Processes & Signals Signal Processing Process Creation: fork & exec
|
LPI 20-25 [BLP 10] [APUE 7, 8, 10] [UULP 8,9] |
Class 5 | February 3 |
Problem Children: Orphans and Zombies
Introduction to Interprocess Communication: |
LPI 26-27, 43-44 [APUE 9, 14.1-14.5] [BLP 12] [UULP 10] FAQ 5 LAB 5 (continued) |
Class 6 | February 10 |
MID TERM EXAM
(Written & Live) Mid Term Study Guide |
|
Class 7 | February 17 |
System V Interprocess Communication (IPC): Semaphores Message queues Shared Memory |
LPI 45-48 [BLP, 13] [APUE 14.6-14.11] [UULP 15.3] |
Class 8 | February 24 |
C Socket Programming |
LPI 56-61 UNP1 1-9 [UULP 11,12,13] |
Class 9 | March 3 |
Sun RPC Multithreaded Programming on Unix with POSIX pThreads |
LPI 51, 29-33 PPT 1-5, 8 [UULP 14] FAQ 9 LAB 9 ( Due dates on lab page ) |
Class 10 | March 10 |
FINAL EXAM:
(Written (Cumulative) & Live (Classes 7, 8 & 9 only)) Final Exam Study Guide |
|
Class 11 |
March 17 |
Advanced topics in Unix |
X. Online Reference and Resources:
General:
Norman Matloff's Unix Tutoral Center
Davin's collection of unix programming links
Regular Expressions:
Single UNIX Specification: Regular Expressions
Steve Ramsay's Guide to Regular Expressions
Awk:
How to Get Things Done With Awk
C Programming:
A. D. Marshall's Programming in C: UNIX System Calls and Subroutines using C
C Programming on Unix Tutorial at University of Strathclyde
POSIX Threads:
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.