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, & by appointment.

Teaching assistant: Trevor Dasch, AN 26, e-mail id: dascht1, OH's: T Th 10:00am-noon, & by appointment.

Recommended textbooks:
    [CPL] The UNIX programming environment (2nd ed.) by Kernighan, B.W. & Pike, R. (1984). Upper Saddle River, NJ: Prentice Hall. ISBN: 0-13-937681-X.
    [UPE] 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 & required 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 25
    2. files & directories (manipulation & management) (Ch 2): self study
    3. system libraries & I/O (Ch 3, 6): Aug 30
    4. compiling C in UNIX (static vs. dynamic linking, macros, conditional compilation, error handling, & debugging) (Ch 6): Sep 1
    5. processes (identification; getpid, creation; fork, & termination) (Ch 6) & memory allocation/deallocation [HW 1 due]: Sep 8
    6. the UNIX shell (Ch 3) & process environment (variables, configuration, customization) (Ch 3, §6.9): Sep 13
    7. storage classes & thread-safe functions (Ch 6) [HW 2 due]: Sep 15
      Exam I (closed book, closed notes): Sep 20

  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 22
    2. process manipulation (wait & exec): Sep 22
    3. signals, (shell) job control, & terminals (Ch 2): Sept 27
    4. implementing I/O redirection: Sep 27
    5. files & directories (data structures, inodes, & hard & symbolic links) (Ch 2) [HW 3 due]: Sep 29
    6. interprocess communication (IPC & special files; pipes & FIFOs) (§§4.7, 6.1-6.4): Oct 4 6
    7. the client-server model ([USP] Ch 6): Oct 6
    8. compilation (Makefiles, make tutorial, another make tutorial, exercise in writing a Makefile) & configuration (RCS) management: Oct 11
    9. token ring of processes [Robbins & Robbins' Process Ring Simulator User's Guide] ([USP] Ch7): Oct 13

  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 18
      regular expressions (grep) & extended regular expressions [HW 4 due]: Oct 20
    2. sed (§4.3): Oct 25
    3. filters (§4.2) & interprocess communication: Oct 27
    4. awk (§4.4): Oct 27
      Exam II (closed book, closed notes): Nov 1

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

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

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

    Final Exam (comprehensive, closed book, closed notes): M Dec 13, 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.