CPTS 360 (Systems Programming)Fall 2023

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.

Note: We have an MS Teams space (CPTS 360 Fall 2023) created for this class. We will use MS Teams for Q\&A and communications. You also need MS Teams access to download lecture materials. The access code will be made available on Canvas and announced in class.

If you can’t access Teams, please get in touch with the instructor as soon as possible.

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.

Supplementary Book

Schedule and Class Materials

Note: The lectures and code files are hosted on the WSU OneDrive cloud. You need access to Teams to download the materials.

WkDateTopicSlidesRemarks
Week 1 08/22 (Tue) Course logistics & overview Lecture 01 Living Computer’s Unix Collection
Self-study:
See Git Tutorials
Week 1 08/24 (Thu) C programming recap Lecture 02 Self-study:
  • Run code examples
  • Go over the materials listed on Slide 39 & Slide 57
Week 2 08/29 (Tue) Computer memory systems Lecture 03 Lecture Reference:
CSAPP 6.2, 6.3, 6.4.1-6.4.4
Self-study:
CSAPP 6.1.1 (Page 617-618), 6.1.4, 6.4.2 (Conflict misses)
Week 2 08/31 (Thu) Memory systems (contd.) Lecture 04 Lecture Reference:
CSAPP 6.4.5-end, 6.5, 6.6.2, 6.6.3
Self-study:
Run mm.c and analyze the results
Week 3 09/05 (Tue) Linking Lecture 05 Lab 1 released Lecture Reference:
CSAPP 7.1, 7.2, 7.3, 7.4, 7.5, 7.6.1
Self-study:
CSAPP 7.4 (ELF file format),
Run examples on 7.6.1
Week 3 09/07 (Thu) Linking (contd.) Lecture 06 Lecture Reference:
CSAPP 7.7, 7.10, 7.11, 7.13
Self-study:
CSAPP 7.14, 7.15
Run code examples
Week 4 09/12 (Tue) Control flow handling Lecture 07 Lecture Reference:
CSAPP 8.1, 8.2, 8.3, 8.4.1, 8.4.2 (excluding Process Graph)
Self-study:
CSAPP Run fork-l7.c
Homework 2 solution
Week 4 09/14 (Thu) Process & signal Lecture 08 Lab 1 due Lecture Reference:
CSAPP 8.4.2-end, 8.5.1-8.5.3
Self-study:
CSAPP Read Program-vs-Process (8.4.6), Read Linux Signals (Fig. 8.26)
Run code examples
Week 5 09/19 (Tue) Signal handling
Exam 1 review
Lecture 09 Lecture Reference:
CSAPP 8.5
Self-study:
CSAPP Fig. 8.33 (signal-safe functions), 8.7, 8.8
Run code examples
Homework 3 solution
Week 5 09/21 (Thu) Exam 1 Exam duration: 45 minutes
Week 6 09/26 (Tue) Process scheduling Lecture 10 Lab 2 released Lecture Reference:
OSTEP 7.1-7.7
Self-study:
OSTEP 6.1-6.3 (excluding Fig. 6.4)
Exam 1 solution
Week 6 09/28 (Thu) Scheduling (contd.) Lecture 11 Lecture Reference:
OSTEP 8, 9.1-9.4
Week 7 10/03 (Tue) Scheduling (finished)
Linux kernel programming
Lecture 12 Lecture Reference:
OSTEP 9.6-end
LKMPG 2-4
Self-study:
Setup your machine for kernel programming
Run helloworld kernel module
Homework 4 solution
Informal early feedback (link)
Week 7 10/05 (Thu) Linux kernel programming Lecture 13 Lab 2 due Lecture Reference:
LKMPG 6, 7, 12.2, 14.2
Self-study:
Run example kernel modules
Week 8 10/10 (Tue) Virtual memory Lecture 14 Lab 3 released Lecture Reference:
CSAPP 9.1-9.5
Self-study:
CSAPP Read 9.4 bullets
Week 8 10/12 (Thu) Virtual memory (contd.) Lecture 15 Lecture Reference:
CSAPP 9.6.1-9.6.4
Week 9 10/17 (Tue) File system
Information sessions from VCEA Career Services
Class canceled
MH is traveling
Week 9 10/19 (Thu) Virtual memory (finished)
I/O (intro)
Lecture 16 Lecture Reference:
CSAPP 9.7.2, 9.11, 10.1-10.2
Self-study:
CSAPP 10.3
Homework 5 solution
Homework 6 solution
Lab 3 due deadline extended!
Week 10 10/24 (Tue) Network programming (contd.)
Information sessions from VCEA Career Services
MH is traveling
Week 10 10/26 (Thu) Network file systems
Information sessions from VCEA Career Services
Lab 3 due MH is traveling
Week 11 10/31 (Tue) Exam 2 review Lecture 17 Homework 7 solution
Week 11 11/02 (Thu) Exam 2 Exam duration: 45 minutes
Week 12 11/07 (Tue) I/O (contd.) Lecture 18 Lab 4 released Lecture Reference:
CSAPP 10.1-10.6, 10.8-10.11
Self-study:
CSAPP 10.7, 10.12
Run code examples
Week 12 11/09 (Thu) Network programming Lecture 19 Lecture Reference:
CSAPP 11.1-11.3
Week 13 11/14 (Tue) Network programming (contd.) Lecture 20 Lecture Reference:
CSAPP 11.4
Self-study:
Run code examples
Week 13 11/16 (Thu) Network programming (finished) Lecture 21 Lab 4 due Lecture Reference:
CSAPP 11.5
Self-study:
Run Tiny server
Week 14 11/21 (Tue) No Class Lab 5 released Thanksgiving break
(early release!)
Week 14 11/23 (Thu) No Class Thanksgiving break
Week 15 11/28 (Tue) Concurrent programming Lecture 22 Lecture Reference:
OSTEP 26, 27
Self-study:
Run code examples
Lab 5 released
Exam 2 solution
Week 15 11/30 (Thu) Concurrency issues and bug Lecture 23 Lecture Reference:
OSTEP 30.2, 31.1, 31.2, 31.3, 31.6, 32.3 (only Circular Wait & DL Avoidance via Scheduling)
Self-study:
OSTEP Fig. 30.14, 31.7
Run code examples
Homework 8 solution
Week 16 12/05 (Tue) Recap and closing Lecture 24
Week 16 12/07 (Thu) Done with classes! Lab 5 due See MH 9:00-9:45 for Lab 5 questions
Week 17 Finals Week Exam 3: 12/12/23
8:15 - 9:45 am @ Classroom
Exam syllabus: all lectures & labs (see Lecture 22 for details)

Homework Assignments

Every week, practice homework problems will be assigned. Grading for practice problems will be based on submission or non-submission: total points for attempted assignments with reasonable answers will be awarded, while unattempted tasks will receive no points.

Homework problems will be posted every Monday on Canvas and must be submitted by the following Friday at 11:59 PM.

Programming Assignments

We will have five 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: Design a shell with basic shell programs supporting job control using ctrl-c and ctrl-z keystrokes, implementation of fg, bg, and jobs commands
  • Lab 3: Implement various CPU schedulers (first-come-first-serve, round-robin, shortest-job-first)
  • Lab 4: Basic kernel-level programming on Linux
  • Lab 5: 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 for delivering 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 know more about GitHub workflow, see GitHub Quickstart.

Using GitHub for the first time on your machine?
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 choose another student’s name by mistake, please contact the TA as soon as possible.
  2. A repo named wsu-cpts360-fa23/labX-name will be automatically created for you and hosted on GitHub with the starter code.
    • For instance, if your username id is cougs, for Lab 1, you should see a repository on GitHub called: wsu-cpts-fa23/lab1-cougs.
  3. Once that clone exists, you will perform a further clone to get that private 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:
    • Get the Git “commit id” of your work. A commit id is a 40-character hexadecimal string. You can obtain the commit id for the last commit by running the following command:
      git log -1 --format=oneline
      Make sure that the corresponding commit is pushed on GitHub.
    • Paste the commit id (i.e., the hexadecimal string) on the corresponding assignment section on Canvas. You should paste only the commit id (the entire string).
    • Note: You can submit as many times as you want; we will grade the last commit id submitted to Canvas before the deadline. Also, you can submit any commit id (not necessarily the last one) from your “pushed” Git history to Canvas. We will grade the version that you listed on Canvas.

For any questions on setting up GitHub, please reach out to TA.

Useful Resources

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