CPS [45]44 UNIX/Linux Programming Lecture Notes

  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, A Brief Introduction to C, C exercises) (Ch 1)
    2. files & directories (manipulation & management) (Ch 2)
    3. the UNIX shell (Ch 3)
    4. system libraries & I/O (Ch 3, 6)
    5. memory management (allocation/deallocation)
    6. terminals (Ch 2)
    7. compiling C in UNIX (static vs. dynamic linking, macros, conditional compilation, error handling, & debugging; RMS's gdb tutorial, valgrind tutorial) (Ch 6)
    8. storage classes & thread-safe functions (Ch 6)

  2. UNIX system calls ([UPE] Ch 7)
    1. low-level I/O (open & close, & read & write)
    2. files & directories (data structures, inodes, & hard & symbolic links) (Ch 2)
    3. processes (identification; getpid, creation; fork, & termination) (Ch 6)
    4. process environment (variables, configuration, & customization) (Ch 3, §6.9)
    5. process manipulation (wait and exec)
    6. implementing I/O redirection & interprocess communication (IPC & special files; pipes & FIFOs) (§§4.7, 6.1-6.4)
    7. signals, signal handling, & (shell) job control

  3. Pattern matching & filters ([UPE] Ch4)
    1. regular expressions (grep) & extended regular expressions (egrep; regexp exercises i & ii, exercise in writing REs, & more REs) (§4.1)
    2. filters (§4.2) & interprocess communication
    3. sed (§4.3)
    4. awk (§4.4)

  4. Shell programming ([UPE] Ch 3, 5)
    1. command & control
    2. numbers & arrays

  5. Automatic program generation ([UPE] Ch 8)
    1. scanning (finite state automata & lex)
    2. compilation (Makefiles, make tutorial, another make tutorial, exercise in writing a Makefile) & configuration (RCS) management
    3. parsing (Backus-Naur form)
    4. yacc

  6. Putting in all together
    1. building client-server architectures and applications (e.g., token ring of processes)
    2. implementing command shells
    3. compiler construction

  7. Selected advanced topics
    1. computer security (buffer overflows)
    2. distributed systems (remote procedure calls)

Acknowledgment: the majority of the diagrams in these notes were drawn or (re-)generated by John P.V. Cresencia using xfig.


    [C] C Language for Experienced Programmers, Version 2.0.0, AT&T, 1988.
    [CGLY] T. Niemann. A Compact Guide to Lex and Yacc. ePaperPress.
    [CPL] B.W. Kernighan and D.M. Ritchie. The C Programming Language. Prentice Hall, Upper Saddle River, NJ, Second edition, 1988.
    [COPL] R.W. Sebesta. Concepts of Programming Languages. Addison-Wesley, Boston, MA, Sixth edition, 2003.
    [EOPL] D.P. Friedman and M. Wand. Essentials of Programming Languages. MIT Press, Cambridge, MA, Third edition, 2008.
    [LY] J.R. Levine, T. Mason, and D. Brown. Lex and Yacc. O'Reilly, Cambridge, MA, Second edition, 1995.
    [OSCJ] A. Silberschatz, P.B. Galvin, and G. Gagne. Operating Systems Concepts with Java. John Wiley and Sons, Inc., Seventh edition, 2007.
    [PGUS] M.G. Sobell. A Practical Guide to the UNIX System. Addison-Wesley, Reading, MA, Third edition, 1995.
    [TKS] M.I. Bolsky and D.G. Korn. The Korn Shell: Command and Programming Language. Prentice Hall, Englewood Cliffs, NJ, 1989.
    [UIAN] A. Robbins. UNIX in a Nutshell. O'Reilly, Beijing, Third edition, 1999.
    [UPE] B.W. Kernighan and R. Pike. The UNIX Programming Environment. Prentice Hall, Upper Saddle River, Second edition, 1984.
    [USP] K.A. Robbins and S. Robbins. UNIX Systems Programming: Concurrency, Communication, and Threads. Prentice Hall, Upper Saddle River, NJ, Second edition, 2003.
    [USPG] S.G. Kochan and P.H. Wood. UNIX Shell Programming. Hayden Books, Carmel, IN, 1990.

© S. Perugini, Fall 2008, University of Dayton. Permission to use ideas about the organization of topics and any notes or material is granted, provided suitable acknowledgments and citations are made.
Return Home