CS 201 Computer Systems Programming II

Credit Hours: 4
Course Coordinator: Su-Hui Chiang
Course Description: Further introduction to computer systems from a software perspective. Basic operating systems concepts and calls. Defining, measuring and improving program performance. The memory hierarchy: storage technologies, caches, virtual memory, memory allocation techniques. Prerequisite: CS 162, 200.
Prerequisites: Computer organization and assembly language (CS 200)
Two quarters of introductory programming
Goals: Introduce computer systems from a software perspective. Teach C and assembly language programming and reading skills. Teach basic systems programming skills and tools. Show how to measure and improve program performance based on an understanding of key aspects of machine architecture.

Upon the successful completion of this course students will be able to:

  1. Explain how and why machine exceptions occur and how they are handled at machine level.
  2. Explain how system calls are invoked using traps on Linux/IA32 (or similar) systems.
  3. Explain the idea of multiprocessing and context switching.
  4. Explain application-level signal handling.
  5. Explain the impact of pipelining and superscalar processing on program performance.
  6. Explain the role of optimizing compilers.
  7. Describe one or more parallel architectures and how they can improve program performance.
  8. Explain the idea of the memory hierarchy.
  9. Describe the important characteristics of various storage technologies, including memory and disks.
  10. Explain the purpose and consequences of improving memory locality.
  11. Explain in detail how caches work, and simulate the behavior of a cache given a sequence of memory references.
  12. Explain the basic idea of virtual memory and its uses.
  13. Explain the goals and implementation issues for dynamic memory allocation.
  14. Explain the idea of garbage collection.
  15. Write C programs that perform file I/O, and use system calls and signals, in particular to perform process control.
  16. Measure program performance using O/S timing facilities.
  17. Use profiling to identify performance bottlenecks in C programs.
  18. Optimize C programs guided by analysis of the generated machine code.
  19. Optimize code to improve cache performance.
Textbooks: Computer Systems: A Programmer's Perspective, Bryant and O'Hallaron, Prentice Hall, 2002.
The C Programming Language, 2nd ed., Kernighan and Ritchie, Prentice Hall, 1998.
References: None.
Major Topics:
Exceptions and Interrupts
Processes and Process Control
File I/O and System Calls
Performance Measurement
Performance Improvement
Memory Hierarchy
Caches
Virtual Memory
Memory Allocation
Laboratory Exercises: Programming system calls (2 weeks)
Measuring program performance (2 weeks)
Improving program performance (2 weeks)
Using cache simulator (2 weeks)
Program memory allocator (2 weeks)

CAC Category Credits Core Advanced
Data Structures
Algorithms
Software Design 0.5
Computer Architecture 2.5
Programming Languages

Oral and Written Communications: None.
Social and Ethical Issues: None.
Theoretical Content: None.
Problem Analysis: Lab and homework problems in programming and improving performance.
Solution Design: Lab and homework problems in programming and improving performance.