CPS [45]44: Systems Programming I/Fall 2012

CPS [45]44 (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 [45]44 is a programming-intensive course and assumes no prior experience with UNIX or C.

CPS [45]44: Systems Programming I/Fall 2012
Pre-requisite(s): CPS 350 (Data Structures & Algorithms) (with a minimum grade of C for students enrolled in CPS 544) & CPS 346 (Operating Systems I)

Meeting times: T Th 5:55pm-7:10pm, MH 205

Instructor: Dr. S. Perugini, AN 145, 229-4079, e-mail id: sperugini1, OH's: M 11:00am-noon, W noon-1:00pm, T Th 7:10pm-8:10pm, & by appointment.

Recommended textbooks:
    [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.
    [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 and 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.
  • Introduce the client-server model.
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; [USP] Ch 1-2, 4)
    1. introduction & the UNIX philosophy (class UNIX page, vi quick reference, vi editor, UW vi reference, C exercises) ([UPE] Ch 1): Aug 23
    2. files & directories (manipulation & management) ([UPE] Ch 2): self study
    3. system libraries & I/O ([UPE] Ch 3, 6): Aug 28 30
    4. compiling C in UNIX (static vs. dynamic linking, macros, conditional compilation, error handling, & debugging; RMS's gdb tutorial, valgrind tutorial) ([UPE] §6.6): Aug 30
    5. the UNIX shell ([UPE] Ch 3) & process environment (variables, configuration, customization) ([UPE] Ch 3, §6.9) [HW 1 due]: Sep 6
    6. the UNIX shell ([UPE] Ch 3) & process environment (variables, configuration, customization) ([UPE] Ch 3, §6.9): Sep 6 11
    7. the UNIX shell ([UPE] Ch 3) & process environment (variables, configuration, customization) ([UPE] Ch 3, §6.9) [HW 2 due]: Sep 13
    8. storage classes & thread-safe functions (Ch 6): Sep 20

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

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

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

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

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

  7. Final Exam (comprehensive, closed book, closed notes): Th Dec 13, 5:55pm-7:45pm, MH 201.
Programming style guide

Grades: available in Isidore

Computer accounts: UNIX account access | UDit | 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.