CPTS 360
Systems Programming, Spring 2024
Overview
This course aims to equip students with the skills to craft system software, utilize system capabilities, and construct small-to-medium scale software systems. Throughout this course, students will (a) develop and execute C programs, (b) comprehend the fundamental methods of creating applications through libraries and interfacing with services, (c) understand memory layout, program, and process representations, and (d) implement Unix/Linux abstractions for memory management, processes, process control, inter-process communication, scheduling, file systems, and networks.
Instructor: Monowar Hasan
Email: monowar.hasan@wsu.edu
Class time: Tuesday, Thursday 10:35-11:50 AM
Class Location: Pullman Campus, Carpenter Hall 102
Office Hours (EME B53): Monday, Wednesday 2:30-3:30 PM or by appointment
Course Staff (TA): YuQun Song (yuqun.song@wsu.edu) Trang Mai Hoang (trang.m.hoang@wsu.edu) Bruno Sanchez Parra (bruno.sanchezparra@wsu.edu)
TA Office Hours: Tuesday 1:00-2:00 PM, Sloan 333 (YuQun) Monday 3:30-4:30 PM, Sloan 333 (Trang) Tuesday 12:00-1:00 PM, Sloan 340 (Bruno) Thursday 2:00-3:00 PM, Sloan 333 (YuQun)
Important: To better prepare yourself for office hours and posting Teams interactions, read carefully the excellent guides from Gabriel Parmer:
Acknowledgment
This course uses materials from Randal E. Bryant, David R. O'Hallaron, Remzi Arpaci-Dusseau, Andrea Arpaci-Dusseau, Kung-Chi Wang, Bob Lewis, Youjip Won, Tianyin Xu, Mathias Payer, Sanidhya Kashyap, Peter Reiher, and Hugh Lauer.
Course Syllabus
The course syllabus is available here.
Textbook
[CSAPP] Computer Systems: A Programmer's Perspective, 3rd edition, by Randal E. Bryant and David R. O'Hallaron.
[LKMPG] The Linux Kernel Module Programming Guide, Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang. This book is helpful for Lab 3.
Schedule and Class Materials
Note: The lectures and code files are hosted on the WSU OneDrive cloud. You need WSU credentials to access the materials.
01/09 (Tue)
N/A
Change of instructor due to unforseen reasons
01/11 (Thu)
N/A
Change of instructor due to unforseen reasons
01/16 (Tue)
No Class
MH was preoccupied with a professional event
01/18 (Thu)
No Class
MH was preoccupied with a professional event
01/23 (Tue)
Intro and C recap
01/25 (Thu)
Computer memory
Lecture Reference:
CSAPP 6.2, 6.3, 6.4.1-6.4.2 (before Conflict Misses)
Self-study:
CSAPP 6.1.1 (Page 581-582), 6.1.4
01/30 (Tue)
Computer memory (contd.)
Lecture Reference:
CSAPP 6.4.5-end, 6.5, 6.6.2, 6.6.3
Self-study:
6.4.2 (Conflict misses)
Run mm.c
and analyze the results
02/01 (Thu)
Linking
Lecture Reference:
CSAPP 7.1, 7.2
02/06 (Tue)
Linking (Contd.)
Lecture Reference:
CSAPP 7.5, 7.6, 7.10, 7.11, 7.13.1 Opional Reading:
CSAPP 7.7
Self-study:
02/08 (Thu)
Linking (wrap up) Process scheduling
Lecture Reference:
CSAPP 7.13.2-7.13.3, 8.2 Self-study:
02/13 (Tue)
Scheduling (contd.)
Lecture Reference:
[OSTEP] 7.1-7.10
Self-study:
[OSTEP] 6.1-6.3 (excluding Fig. 6.4)
02/15 (Thu)
Scheduling (MLFQ)
Lecture Reference:
[OSTEP] 8 Lab 1 due
02/20 (Tue)
Mid-term review
02/22 (Thu)
Mid-term Exam
Exam duration: 60 minutes
02/27 (Tue)
Fair scheduling Kernel programming (intro)
Lecture Reference:
[OSTEP] 9.1-9.4, 9.6-end Lab 2 released
02/29 (Thu)
Kernel programming
Lecture Reference: [LKMPG] 2-4, 6, 7.1, 7.2
Self-study:
03/05 (Tue)
Kernel programming
Lecture Reference: [LKMPG] 7.2, 12.2, 14.2 Self-study:
03/07 (Thu)
Virtual memory
Lecture Reference:
CSAPP 9.1-9.5
Self-study:
CSAPP Read 9.4 bullets Lab 2 due
03/12 (Tue)
No Class
Spring break Lab 3 released
03/14 (Thu)
No Class
Spring break
03/19 (Tue)
Virtual memory (contd.)
Lecture Reference:
CSAPP 9.6.1-9.6.4, 9.7.2, 9.11
03/21 (Thu)
Process control
Lecture Reference:
CSAPP 8.3, 8.4 (up to 8.4.4)
Self-study:
CSAPP 8.2.3-8.2.5, Program-vs-Process (8.4.6)
03/26 (Tue)
Signal I/O
Lecture Reference:
CSAPP 8.5.1-8.5.3 — Signals
CSAPP 10.1-10.9 — I/O
Self-study:
CSAPP Fig. 8.33 (signal-safe functions), 8.5.5 (Fig. 8.6—Correct signal handling)
03/28 (Thu)
I/O Network programming
Lecture Reference:
CSAPP 10.10-10.12 — I/O CSAPP 11.1-11.4 (before 11.4.1), 11.4.9 — NW
Self-study:
Lab 3 due
04/02 (Tue)
No Class
MH is unavailable due to a site visit Lab 4 released
04/04 (Thu)
Network programming (finished)
Lecture Reference:
CSAPP 11.5, 11.6
Self-study:
04/09 (Tue)
Concurrent programming
Lecture Reference:
[OSTEP] 26, 27
Self-study:
04/11 (Thu)
Concurrency issues and bugs
Lecture Reference:
[OSTEP] 30.2, 31.1, 31.2, 31.3, 31.6, 32. 2 (Only Atomicity-Violation Bugs), 32.3 (only Circular Wait & DL Avoidance via Scheduling)
Self-study:
[OSTEP] Fig. 30.14, 31.7
04/16 (Tue)
Privileged programs
Lecture Reference:
Self-study:
Suggested reading:
04/18 (Thu)
Exam review and closing
04/23 (Tue)
No Class
Done with classes!
04/25 (Thu)
Lab 4 demo
Demonstration slot for selected students only. See Canvas for the complete schedule.
Finals Week
Final Exam: 04/30/24 10:30 AM - 12:30 PM @ Classroom
Exam syllabus: all lectures & labs
Sample Exams
Exam Solutions
Programming Assignments
We will have four programming assignments in this course. The assignments must be completed individually.
Lab 1: Design a Unix filesystem tree simulator using C Tree data structures
Lab 2: Implement various CPU schedulers (first-come-first-serve, round-robin, shortest-job-first)
Lab 3: Basic kernel-level programming on Linux
Lab 4: Develop a web proxy that interacts with the browser and the Internet
You will need access to a Linux machine (or VM) to complete the labs. Check the following links for details about setting up virtual machines on your systems.
Apple Silicon Mac (from scratch, prebuild-images)
Note: for Windows systems, WSL is not recommended. You must install a standalone VM image.
Programming Assignment Submission
We will use GitHub Classroom to deliver programming assignments. This way, you can better manage your assignments using a widely-used version control system, Git.
For information on version control and how to use Git, see:
To learn more about GitHub workflow, see GitHub Quickstart.
Are you using GitHub on your machine for the first time?
If you are using GitHub for the first time on your development machine, you need to authenticate your account — one way to do this is by using GitHub CLI. Install GitHub CLI using the instructions given here. Then run the following command and follow the prompts to authenticate your system: gh auth login
.
Submission Workflow
For each lab, you will find a GitHub Classroom link on Canvas. Once you click the link and log into your GitHub account, find your name in the student list and click it to accept the assignment. Please double-check your name and email address before accepting the assignment. If you accidentally choose another student's name, please contact the instructor.
A repo named
wsu-cpts360-term/paX-name
will be automatically created for you and hosted on GitHub with the starter code.You can then "clone" your repository onto your development machine. You will complete assignments on your development computer and then "push" your work to the GitHub-hosted remote repository for us to grade.
Final submission:
Copy the URL of your GitHub repository on the corresponding assignment section on Canvas.
For any questions on setting up GitHub, please contact the TA.
Useful Resources
GDB Tutorial 1, Tutorial 2
GitHub Classroom: Tutorial 1, Tutorial 2
Got stuck? Questions about anything? Feel free to contact the instructor on Teams (preferred) or via email: monowar.hasan@wsu.edu!
Last updated