CS 456 Systems Programming

From Computer Science
Jump to: navigation, search

Catalog Description

An introduction to both program translation and operating systems. There will be a survey of topics such as: top-down and bottom-up parsing, scanning, code generation, symbol table management, linkers and loaders, batch processing systems, interacting processes, multiprogramming systems, and memory management. Prerequisite - C or better in CS 202.

Prerequisites

C programming.


Standard Content

Course Outline

  • Version control: Make, RCS, Git
  • File system I/O - open/close/read/write, printf/scanf, opendir/closedir/readdir/stat
  • Local interprocess communication: signals, socketpairs, shared memory.
  • Fork and execve: how shells work.
  • Regular expressions (review!)
  • Condensed introduction to x64 assembly language.
  • How assemblers work.
  • Structure of ELF files -- use of tools like objdump, readelf, nm, od.
  • Lex/flex and yacc/bison examples starting with a simple calculator and then a simple programming language (something on the level of Dartmouth BASIC).

Learning Outcomes

Solid understanding of the Unix/Linux API. Basic understanding of programming language translation.


Important Assignments and/or Exam Questions

  • Write a variant of ls(1) requiring accessing permissions and subdirectory traversal.
  • A basic shell (command interpreter) with a read, parse, execute loop using a PATH, I/O redirection and pipes.
  • Assembly language programming exercises, with a view to introducing the subset of assembler needed for compiler code generation.
  • Extend calculator example done in class -- student might add parenthetical expressions or named (one line) functions, for example.
  • A working compiler for a simple programming language.
  • A working assembler would be a less time consuming alternative if more time was spent on the shell.

Standard resources

  • The manual.
  • Linux System Programming: Talking Directly to the Kernel and C Library, Edition 2, Robert Love (O’Reilly)
  • flex & bison, by John Levine (O’Reilly)