Computer Systems Programming

Instructor: Wu-chang Feng
Office hours: here
TA:Sascha Strand
TA Office hours/site:here
Resources
Resources
  • Course slides: PSU Google Drive
  • Textbook: Computer Systems: A Programmer's Perspective, 3rd ed., Bryant and O'Hallaron, Prentice Hall, 2015. ISBN-13: 978-0134092669.
Recommended textbooks
  • The C Programming Language, 2nd ed., Kernighan and Ritchie, Prentice Hall, 1998. ISBN 0-13-110362-8.
  • Introducing Python: Modern Computing in Simple Packages, Lubanovic, O'Reilly, 2014. ISBN-13: 978-1449359362

Schedule

Date Topic (Reading) Assignment
Week 1
Introduction, The C Programming Language (K/R Ch 1-4) A1
The C Library, GDB (B/O Ch1, Ch 7, K/R Ch 7)  
Week 2
Computer System Organization (B/O Ch 7)
Data Representation Pt #1 (B/O Ch 2.1-2.2)

Data Representation Pt #1 (cont) A1 Due
Week 3
Data Representation Pt #2 (floating point)
A2
Arithmetic operations (B/O Ch 2.3-2.5)

Week 4
x86 Basics (B/O Ch 3.1-3.5)
Midterm Exam (K/R Ch 1-4,7, B/O Ch 1-2,7) Sample | Sample solution | Practice | Practice site
A2 Due
Week 5
x86 Control Flow (B/O Ch 3.6) MetaCTF. Navigation instructions here
x86 Procedures (B/O Ch 3.7, K/R Ch. 5.11-5.12)
Week 6
x86 Stack Overflow (B/O Ch 3.10)
x86 Arrays (B/O Ch. 3.8 K&R Ch. 5.1-5.10)
Week 7
x86 Structures, Embedded Assembly, ARM (B/O Ch. 3.9, K&R Ch 6)
Program optimization (B/O Ch 5) Final project: MetaCTF level.
Sample source
Week 8
Program optimization - SIMD (B/O Ch 3.11) A3
Cache memories (B/O Ch 6)
Week 9
Cache memories A4
A3 Due
No class (Thanksgiving)

Week 10
Exceptional control flow (B/O Ch 8) A4 Due
Exceptional control flow, Final project CTF

Extra
Additional Topics, Final exam review
Practice problems and site
FinalReviewQs | FinalReviewSolutions | Screencast
Finals
Final Exam (K/R Ch 5,6, B/O Ch 3, 5, 6, 8)
Monday 12/3 (10:15am-12:05pm)
Final project due (12/7 at 11:30pm)
Submission instructions

Policies

Grading
A1 (C/libc) 5%
A2 (bit ops/floats) 10%
A3 (asm,SIMD) 5%
A4 (caching) 5%
MetaCTF 15%
Final project 10%
Midterm 15%
Final 15%
Kata 20%
Assignments
  • Due at the beginning of class
  • Docked 10% for each day late up to 5 days.
  • Not accepted after 5 days late
Exams
  • In class
  • Closed book
  • Closed notes
  • No electronics

Academic integrity
  • All assigned work is to be completed individually
  • For assignments, source code plagiarism tools will check that code has not been duplicated
  • Ensure your code is kept private
Academic misconduct
  • Includes allowing another student to copy your work
  • Results in a grade of 0 for the assignment or exam
  • Forwarded to the university for disciplinary action.

Course objectives

  • Describe basic computer system organization including the operating system (processes, files, virtual memory) and the underlying hardware (CPU, registers, memory hierarchy).
  • Describe the compilation system (preprocessing, assembling, compiling, and linking) and the function of object/executable files and shared libraries, as well as how basic system utilities such as debuggers and Makefiles work.
  • Write C programs to illustrate basic systems programming concepts, including file I/O, system calls, memory management, exception handling and process management.
  • Do arithmetic in hexadecimal, decimal, octal, and binary notation, and convert among these notations.
  • Explain how data types such as integers, characters, floating point numbers, arrays, pointers, and structures are represented
  • Describe the basic instruction set architecture for the Intel x86 family (or similar machine), including the arithmetic/logic instructions, registers, memory model and addressing, and control instructions.
  • Explain how high-level programming constructs such as loops and stack-based function calls are implemented in underlying machine code.
  • Explain how exceptions, traps, and context switches occur and how they are handled at the machine level.
  • Explain the performance impact of hardware features such as pipelining, and architecture principles such as memory locality.
  • Understand and identify performance bottlenecks in C programs.