CPS 444 (3 sem hrs) provides an introduction to systems programming in UNIX and C. Topics include library and system calls, operating system structures, concurrency, and interprocess communication (pipes and signals). Students can also expect a survey of various software tools supporting systems programming, including gcc, gdb, make, sed and awk, and lex and yacc. The course does not aim to be comprehensive, but rather focuses on thematic issues. Assignments are designed to provide students with a pragmatic exposure to these tools as well as issues faced by modern practitioners. CPS 444 is a programming-intensive course and assumes no prior experience with UNIX or C.


Pre-requisite(s): CPS 350 (Data Structures & Algorithms) (with a minimum grade of C for students enrolled in CPS 544) & CPS 346 (Operating Systems)

Meeting times: M W 4:30pm-5:45pm, MH 205

Instructor: Dr. S. Perugini, AN 145, 229-4079, e-mail id: perugisa, OH's: M W 5:45pm-6:45pm, T Th noon-1:00pm, & by appointment.

Teaching assistant: John Cresencia, AN 152, e-mail id: cresenjv, OH's: M W noon-2:00pm, T Th 4:30pm-5:30pm, F noon-1:00pm, & by appointment.

Required textbook: [UPE] The UNIX programming environment (2nd ed.) by Kernighan, B.W. & Pike, R. (1984). Upper Saddle River, NJ: Prentice Hall. ISBN: 0-13-937681-X.

Recommended textbooks:
    [CPL] The C programming language (2nd ed.) by Kernighan, B.W. & Ritchie, D.M. (1988). Upper Saddle River, NJ: Prentice Hall. ISBN: 0-13-110362-8.
    [USP] UNIX systems programming: Concurrency, communication, & threads (2nd ed.) by Robbins, K.A. & Robbins, S. (2003). Upper Saddle River, NJ: Prentice Hall. ISBN: 0-13-042411-0. An eBook of [USP] is available free to all UD students in the library's eContent collection. To access it conduct a search for the title in the library's catalog at library.udayton.edu.
Course objectives:
  • Develop a proficiency in UNIX and C as a systems programming language/environment.
  • Survey various system-oriented software tools, including debuggers, and compilation and configuration managers.
  • Establish an understanding of the design and development of systems software, such as command interpreters and compilers, through the study of system libraries, pattern matching and filters, interprocess communication, automatic program generation, and signals.
  • Explore UNIX internals and establish an understanding of UNIX system calls.
Evaluation, workload, & policies

Course outline, lecture notes, & homework & reading assignments (to be completed prior to class):
  1. Introduction to systems programming in UNIX & C ([UPE] Preface, Ch 1-3, 6)
    1. introduction & the UNIX philosophy (class UNIX page, vi quick reference, vi editor, UW vi reference, C exercises) (Ch 1): Aug 26
    2. files & directories (manipulation & management) (Ch 2): self study
    3. system libraries & I/O (Ch 3, 6): Aug 31
    4. processes (identification; getpid, creation; fork, & termination) (Ch 6) & memory allocation/deallocation: Sep 2
    5. the UNIX shell (Ch 3) & process environment (variables, configuration, customization) (Ch 3, §6.9) [HW 1 due]: Sep 9
    6. compiling C in UNIX (static vs. dynamic linking, macros, conditional compilation, error handling, & debugging) (Ch 6): Sep 14
    7. storage classes & thread-safe functions (Ch 6) [HW 2 due]: Sep 16 23
      Exam I (closed book, closed notes): Sep 21

  2. Communication & concurrency (through UNIX system calls) & the client-server model ([UPE] Ch 7, [USP] Ch1-7)
    1. low-level I/O (open & close, & read & write): Sep 28
    2. process manipulation (wait & exec): Sep 28
    3. implementing I/O redirection [HW 3 due]: Sep 30
    4. signals, (shell) job control, & terminals (Ch 2): Oct 5
    5. interprocess communication (IPC & special files; pipes & FIFOs) (§§4.7, 6.1-6.4): Oct 7
    6. files & directories (data structures, inodes, & hard & symbolic links) (Ch 2): Oct 7 12
    7. the client-server model ([USP] Ch 6): Oct 12 14
    8. compilation (Makefiles, make tutorial, another make tutorial, exercise in writing a Makefile) & configuration (RCS) management Oct 14
    9. token ring of processes [Robbins & Robbins' Process Ring Simulator User's Guide] ([USP] Ch7): Oct 19

  3. Pattern matching & filters ([UPE] Ch 4)
    1. regular expressions (grep) & extended regular expressions (egrep, regexp exercises i & ii, exercise in writing REs, & more REs) (§4.1): Oct 19
      regular expressions (grep) & extended regular expressions [HW 4 due]: Oct 21
      Exam II (closed book, closed notes): Oct 26
    2. sed (§4.3): Oct 28 Nov 2
    3. filters (§4.2) & interprocess communication: Nov 2
    4. awk (§4.4): Nov 4

  4. Shell programming ([UPE] Ch 5)
    1. command & control [HW 5 due]: Nov 4 9
    2. numbers & arrays: Nov 9
      numbers & arrays [HW 6 due]: Nov 11

  5. Compilation concepts & techniques, & automatic program generation ([UPE] Ch 8)
    1. scanning (finite state automata & lex): Nov 16
    2. parsing (Backus-Naur form) [HW 7 due]: Nov 18
      Exam III (closed book, closed notes): Nov 23
      parsing (Backus-Naur form): Nov 30
    3. yacc: Dec 2 7

  6. Selected advanced topics
    1. computer security (buffer overflows): Dec 9
    2. distributed systems (remote procedure calls): Dec 9
    3. course reflection [HW 8 due]: Dec 9

  7. Final Exam (comprehensive, closed book, closed notes): M Dec 14, 4:30pm-6:20pm, MH 205
Programming style guide

Grades: available in Isidore

Computer accounts: UDit | UNIX account access | CPS labs hours | Keeping your password safe | A beginner's guide to effective e-mail

Helpful links: academic calendar | student handbook | UDit policies 

Feedback: Dr. Perugini welcomes any feedback you may have on the style of the lectures, the concepts presented in class, the course webpage, homeworks, deadlines, course and grading policies, or your general experience in the course.