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: [email protected]
  • 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 ([email protected])
    Trang Mai Hoang ([email protected])
    Bruno Sanchez Parra ([email protected])
  • 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

  1. [CSAPP] Computer Systems: A Programmer’s Perspective, 3rd edition, by Randal E. Bryant and David R. O’Hallaron.
  2. [OSTEP] Operating Systems: Three Easy Pieces by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau.
  3. [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.

WkDateTopicSlidesRemarks
Week 1 01/09 (Tue) N/A Change of instructor due to unforseen reasons
Week 1 01/11 (Thu) N/A Change of instructor due to unforseen reasons
Week 2 01/16 (Tue) No Class MH was preoccupied with a professional event
Week 2 01/18 (Thu) No Class MH was preoccupied with a professional event
Week 3 01/23 (Tue) Intro and C recap Lecture 01
Week 3 01/25 (Thu) Computer memory Lecture 02 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
Week 4 01/30 (Tue) Computer memory (contd.) Lecture 03 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
Week 4 02/01 (Thu) Linking Lecture 04 Lecture Reference:
CSAPP 7.1, 7.2
Week 5 02/06 (Tue) Linking (Contd.) Lecture 05 Lab 1 released Lecture Reference:
CSAPP 7.5, 7.6, 7.10, 7.11, 7.13.1
Opional Reading:
CSAPP 7.7
Self-study:
CSAPP 7.4 (ELF file format)
Run code examples
Week 5 02/08 (Thu) Linking (wrap up)
Process scheduling
Lecture 06 Lecture Reference:
CSAPP 7.13.2-7.13.3, 8.2
Self-study:
CSAPP 7.14, 7.15
Run code examples
Week 6 02/13 (Tue) Scheduling (contd.) Lecture 07 Lecture Reference:
OSTEP 7.1-7.10
Self-study:
OSTEP 6.1-6.3 (excluding Fig. 6.4)
Week 6 02/15 (Thu) Scheduling (MLFQ) Lecture 08 Lab 1 due Lecture Reference:
OSTEP 8
Week 7 02/20 (Tue) Mid-term review Lecture 09 Informal early feedback (link)
Week 7 02/22 (Thu) Mid-term Exam Exam duration: 60 minutes
Week 8 02/27 (Tue) Fair scheduling
Kernel programming (intro)
Lecture 10 Lab 2 released Lecture Reference:
OSTEP 9.1-9.4, 9.6-end
Week 8 02/29 (Thu) Kernel programming Lecture 11 Lecture Reference:
LKMPG 2-4, 6, 7.1, 7.2
Self-study:
Run example kernel modules
Week 9 03/05 (Tue) Kernel programming Lecture 12 Lecture Reference:
LKMPG 7.2, 12.2, 14.2
Self-study:
Run example kernel modules
Week 9 03/07 (Thu) Virtual memory Lecture 13 Lab 2 due Lecture Reference:
CSAPP 9.1-9.5
Self-study:
CSAPP Read 9.4 bullets
Week 10 03/12 (Tue) No Class Lab 3 released Spring break
Week 10 03/14 (Thu) No Class Spring break
Week 11 03/19 (Tue) Virtual memory (contd.) Lecture 14 Lecture Reference:
CSAPP 9.6.1-9.6.4, 9.7.2, 9.11
Week 11 03/21 (Thu) Process control Lecture 15 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)
Run code examples
Week 12 03/26 (Tue) Signal
I/O
Lecture 16 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)
Run code examples
Week 12 03/28 (Thu) I/O
Network programming
Lecture 17 Lab 3 due Lecture Reference:
CSAPP 10.10-10.12 — I/O
CSAPP 11.1-11.4 (before 11.4.1), 11.4.9 — NW
Self-study:
Run echo server/client example
Week 13 04/02 (Tue) No Class Lab 4 released MH is unavailable due to a site visit
Week 13 04/04 (Thu) Network programming (finished) Lecture 18 Lecture Reference:
CSAPP 11.5, 11.6
Self-study:
Run Tiny web server
Week 14 04/09 (Tue) Concurrent programming Lecture 19 Lecture Reference:
OSTEP 26, 27
Self-study:
Run code examples
Week 14 04/11 (Thu) Concurrency issues and bugs Lecture 20 Lab 4 due 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
Run code examples
Week 15 04/16 (Tue) Privileged programs Lecture 21 Lecture Reference:
Set-UID Privileged Programs
Self-study:
Run code examples
Suggested reading:
How To Write a Setuid Program
Week 15 04/18 (Thu) Exam review and closing Lecture 22
Week 16 04/23 (Tue) No Class Done with classes!
Week 16 04/25 (Thu) Lab 4 demo Demonstration slot for selected students only. See Canvas for the complete schedule.
Week 17 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.

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:

  1. Eddie Kohler’s Git notes
  2. Git handbook from GitHub

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

  1. 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.
  2. A repo named wsu-cpts360-term/paX-name will be automatically created for you and hosted on GitHub with the starter code.
  3. 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.
  4. 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

Got stuck? Questions about anything? Feel free to contact the instructor on Teams (preferred) or via email: [email protected]!