Page cover

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.

  • Instructor: Monowar Hasan

  • Email: monowar.hasan@wsu.edu

  • Class time: Tuesday, Thursday 09:10-10:25 AM

  • Class Location: Pullman Campus, Carpenter Hall 102

  • Office Hours (EME B53): Tuesday 11:00 AM-noon, Friday 2:00-3:00 PM, 1:15-2:15 PM, or by appointment

  • Course Staff (TA): Heyan Huang (huanghy@wsu.edu) Trang Mai Hoang (trang.m.hoang@wsu.edu) Albert Lucas (albert.lucas@wsu.edu)

  • TA Office Hours: Monday, 10-11 AM, Sloan 333 (Trang) Tuesday, 12-1 PM, Dana 149 (Albert) Thursday, 4-5 PM, Sloan 332 (Heyan)

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

Supplementary Book

This book is helpful for Lab 4.


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.

WK
Date
Topic
Slides
Remarks
1

08/22 (Tue)

Course logistics & overview

1

08/24 (Thu)

C programming recap

Self-study:

  • Go over the materials listed on Slide 39 & Slide 57

2

08/29 (Tue)

Computer memory systems

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)

2

08/31 (Thu)

Memory systems (contd.)

Lecture Reference:

CSAPP 6.4.5-end, 6.5, 6.6.2, 6.6.3

Self-study:

Run mm.c and analyze the results

3

09/05 (Tue)

Linking

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 Lab 1 released

3

09/07 (Thu)

Linking (contd.)

Lecture Reference:

CSAPP 7.7, 7.10, 7.11, 7.13

Self-study:

CSAPP 7.14, 7.15 Run code examples

4

09/12 (Tue)

Control flow handling

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

4

09/14 (Thu)

Process & signal

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 Lab 1 due

5

09/19 (Tue)

Signal handling Exam 1 review

Lecture Reference:

CSAPP 8.5

Self-study:

CSAPP Fig. 8.33 (signal-safe functions), 8.7, 8.8

Run code examples Homework 3 solution

5

09/21 (Thu)

Exam 1

Exam duration: 45 minutes

6

09/26 (Tue)

Process scheduling

Lecture Reference:

[OSTEP] 7.1-7.7

Self-study:

[OSTEP] 6.1-6.3 (excluding Fig. 6.4) Exam 1 solution

Lab 2 released

6

09/28 (Thu)

Scheduling (contd.)

Lecture Reference:

[OSTEP] 8, 9.1-9.4

7

10/03 (Tue)

Scheduling (finished) Linux kernel programming

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)

7

10/05 (Thu)

Linux kernel programming

Lecture Reference: [LKMPG] 6, 7, 12.2, 14.2

Self-study:

Run example kernel modules Lab 2 due

8

10/10 (Tue)

Virtual memory

Lecture Reference:

CSAPP 9.1-9.5

Self-study:

CSAPP Read 9.4 bullets Lab 3 released

8

10/12 (Thu)

Virtual memory (contd.)

Lecture Reference:

CSAPP 9.6.1-9.6.4

9

10/17 (Tue)

File system Information sessions from VCEA Career Services Class canceled

MH is traveling

9

10/19 (Thu)

Virtual memory (finished) I/O (intro)

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!

10

10/24 (Tue)

Network programming (contd.) Information sessions from VCEA Career Services

MH is traveling

10

10/26 (Thu)

Network file systems Information sessions from VCEA Career Services

MH is traveling Lab 3 due

11

10/31 (Tue)

Exam 2 review

11

11/02 (Thu)

Exam 2

Exam duration: 45 minutes

12

11/07 (Tue)

I/O (contd.)

Lecture Reference:

CSAPP 10.1-10.6, 10.8-10.11

Self-study:

CSAPP 10.7, 10.12

Run code examples Lab 4 released

12

11/09 (Thu)

Network programming

Lecture Reference:

CSAPP 11.1-11.3

13

11/14 (Tue)

Network programming (contd.)

Lecture Reference:

CSAPP 11.4

Self-study:

Run code examples

13

11/16 (Thu)

Network programming (finished)

Lecture Reference:

CSAPP 11.5

Self-study:

Run Tiny server Lab 4 due

14

11/21 (Tue)

No Class

Thanksgiving break Lab 5 released (early release!)

14

11/23 (Thu)

No Class

Thanksgiving break

15

11/28 (Tue)

Concurrent programming

Lecture Reference:

[OSTEP] 26, 27

Self-study:

Run code examples Lab 5 released Exam 2 solution

15

11/30 (Thu)

Concurrency issues and bug

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

16

12/05 (Tue)

Recap and closing

16

12/07 (Thu)

Done with classes!

See MH 9:00-9:45 for Lab 5 questions Lab 5 due

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:

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: monowar.hasan@wsu.edu!

Last updated