Systems Programming Spring 2024
  • CPTS 360
Powered by GitBook

CPTS 360

Systems Programming, Spring 2024

Last updated 9 months ago


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:

  • Email: monowar.hasan@wsu.edu

  • Class time: Tuesday, Thursday 10:35-11:50 AM

  • Class Location: Pullman Campus,

  • 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 :


Acknowledgment

This course uses materials from , , , , , , , , , , , and .


Course Syllabus


Textbook


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.

WK
Date
Topic
Slides
Remarks
1

01/09 (Tue)

N/A

Change of instructor due to unforseen reasons

1

01/11 (Thu)

N/A

Change of instructor due to unforseen reasons

2

01/16 (Tue)

No Class

MH was preoccupied with a professional event

2

01/18 (Thu)

No Class

MH was preoccupied with a professional event

3

01/23 (Tue)

Intro and C recap

3

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

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

4

02/01 (Thu)

Linking

Lecture Reference:

CSAPP 7.1, 7.2

5

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:

5

02/08 (Thu)

Linking (wrap up) Process scheduling

Lecture Reference:

CSAPP 7.13.2-7.13.3, 8.2 Self-study:

6

02/13 (Tue)

Scheduling (contd.)

Lecture Reference:

[OSTEP] 7.1-7.10

Self-study:

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

6

02/15 (Thu)

Scheduling (MLFQ)

Lecture Reference:

[OSTEP] 8 Lab 1 due

7

02/20 (Tue)

Mid-term review

7

02/22 (Thu)

Mid-term Exam

Exam duration: 60 minutes

8

02/27 (Tue)

Fair scheduling Kernel programming (intro)

Lecture Reference:

[OSTEP] 9.1-9.4, 9.6-end Lab 2 released

8

02/29 (Thu)

Kernel programming

Lecture Reference: [LKMPG] 2-4, 6, 7.1, 7.2

Self-study:

9

03/05 (Tue)

Kernel programming

Lecture Reference: [LKMPG] 7.2, 12.2, 14.2 Self-study:

9

03/07 (Thu)

Virtual memory

Lecture Reference:

CSAPP 9.1-9.5

Self-study:

CSAPP Read 9.4 bullets Lab 2 due

10

03/12 (Tue)

No Class

Spring break Lab 3 released

10

03/14 (Thu)

No Class

Spring break

11

03/19 (Tue)

Virtual memory (contd.)

Lecture Reference:

CSAPP 9.6.1-9.6.4, 9.7.2, 9.11

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)

12

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)

12

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

13

04/02 (Tue)

No Class

MH is unavailable due to a site visit Lab 4 released

13

04/04 (Thu)

Network programming (finished)

Lecture Reference:

CSAPP 11.5, 11.6

Self-study:

14

04/09 (Tue)

Concurrent programming

Lecture Reference:

[OSTEP] 26, 27

Self-study:

14

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

15

04/16 (Tue)

Privileged programs

Lecture Reference:

Self-study:

Suggested reading:

15

04/18 (Thu)

Exam review and closing

16

04/23 (Tue)

No Class

Done with classes!

16

04/25 (Thu)

Lab 4 demo

Demonstration slot for selected students only. See Canvas for the complete schedule.

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.

Programming Assignment Submission

For information on version control and how to use Git, see:

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

The course syllabus is available .

[CSAPP] , 3rd edition, by and .

[OSTEP] by and .

[LKMPG] , Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang. This book is helpful for Lab 3.

CSAPP 7.4 (ELF file format) Run Lab 1 released

CSAPP 7.14, 7.15 Run

Informal early feedback )

Run

Run

Run

Run

Run

Run

Run

Run Lab 4 due

Run

Apple Silicon Mac (, )

Note: for Windows systems, is not recommended. You must install a standalone VM image.

We will use to deliver programming assignments. This way, you can better manage your assignments using a widely-used version control system, .

To learn more about GitHub workflow, see .

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 . Install GitHub CLI using the instructions given . Then run the following command and follow the prompts to authenticate your system: gh auth login.

, By

GDB ,

GitHub Classroom: ,

Monowar Hasan
Carpenter Hall 102
Gabriel Parmer
Preparing and presenting yourself at office hours
Expected norms for online interactions
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
Hugh Lauer
here
Computer Systems: A Programmer's Perspective
Randal E. Bryant
David R. O'Hallaron
Operating Systems: Three Easy Pieces
Remzi H. Arpaci-Dusseau
Andrea C. Arpaci-Dusseau
The Linux Kernel Module Programming Guide
Sample Mid
Sample Final
Mid-term solution
Windows, Intel-based Mac, and Linux
from scratch
prebuild-images
WSL
GitHub Classroom
Git
Eddie Kohler’s Git notes
Git handbook from GitHub
GitHub Quickstart
GitHub CLI
here
Unix and Linux Tutorial
C declarations
Essential C
Nick Parlante
GNU C Reference Guide
Interactive C Tutorial with Exercises
Tutorial 1
Tutorial 2
Git Book
Linux Kernel Documentation
Tutorial 1
Tutorial 2
Lecture 01
Lecture 02
Lecture 03
Lecture 04
Lecture 05
code examples
Lecture 06
code examples
Lecture 07
Lecture 08
Lecture 09
(link
Lecture 10
Lecture 11
example kernel modules
Lecture 12
example kernel modules
Lecture 13
Lecture 14
Lecture 15
code examples
Lecture 16
code examples
Lecture 17
echo server/client example
Lecture 18
Tiny web server
Lecture 19
code examples
Lecture 20
code examples
Lecture 21
Set-UID Privileged Programs
code examples
How To Write a Setuid Program
Lecture 22
Page cover image