Systems Programming Fall 2023
  • CPTS 360
Powered by GitBook

CPTS 360

Systems Programming, Fall 2023

Last updated 1 year 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 09:10-10:25 AM

  • Class Location: Pullman Campus,

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


Acknowledgment


Course Syllabus


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

Self-study:

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:

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:

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)

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

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:

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

7

10/05 (Thu)

Linux kernel programming

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

Self-study:

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:

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

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:

13

11/16 (Thu)

Network programming (finished)

Lecture Reference:

CSAPP 11.5

Self-study:

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:

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

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


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.

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 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!

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

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.

's

See

Run

CSAPP 7.14, 7.15 Run

CSAPP Run

Run Lab 1 due

Run

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

Run Informal early feedback ()

Run Lab 2 due

CSAPP 10.3

Run Lab 4 released

Run

Run Lab 4 due

Run Lab 5 released

Run

Exam syllabus: all lectures & labs (see for details)

: Design a Unix filesystem tree simulator using C Tree data structures

: Design a shell with basic shell programs supporting job control using ctrl-c and ctrl-z keystrokes, implementation of fg, bg, and jobs commands

: Implement various CPU schedulers (first-come-first-serve, round-robin, shortest-job-first)

: Basic kernel-level programming on Linux

: Develop a web proxy that interacts with the browser and the Internet

Apple Silicon Mac (, )

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

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

To know more about GitHub workflow, see .

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 . 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
Lab 1
Lab 2
Lab 3
Lab 4
Lab 5
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
Living Computer
Unix Collection
Git Tutorials
Lecture 02
code examples
Lecture 03
Lecture 04
Lecture 05
Lecture 06
code examples
Lecture 07
fork-l7.c
Homework 2 solution
Lecture 08
code examples
Lecture 09
code examples
Homework 3 solution
Lecture 10
Exam 1 solution
Lecture 11
Lecture 12
helloworld kernel module
Homework 4 solution
link
Lecture 13
example kernel modules
Lecture 14
Lecture 15
Lecture 16
Homework 5 solution
Homework 6 solution
Lecture 17
Homework 7 solution
Lecture 18
code examples
Lecture 19
Lecture 20
code examples
Lecture 21
Tiny server
Lecture 22
code examples
Exam 2 solution
Lecture 23
code examples
Homework 8 solution
Lecture 24
Lecture 22
Page cover image