# CPTS 360

***

### 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](http://monowarhasan.info/)
* **Email:** <monowar.hasan@wsu.edu>
* **Class time:** Tuesday, Thursday 10:35-11:50 AM
* **Class Location:** Pullman Campus, [Carpenter Hall 102](https://li.wsu.edu/buildings-and-spaces/general-university-classrooms/classroom-specs/carpenter-102/)
* **Office Hours (EME B53):** Monday, Friday 2:15-3:00 PM or by appointment
* **Course Staff (TA):**&#x20;
  * Aayush Shrestha (<aayush.shrestha@wsu.edu>)
  * Bruno Sanchez Parra (<bruno.sanchezparra@wsu.edu>)
  * YuQun Song (<yuqun.song@wsu.edu>)
  * Md Tasnim Farhan Fatin (<m.fatin@wsu.edu>)
* **TA Office Hours:**&#x20;
  * Aayush: Wednesday, 1:00 - 2:00 PM, Sloan 345&#x20;
  * Bruno: Tuesdays and Thursdays 2:30 PM - 3:30 PM, Sloan 344&#x20;
  * Fatin: Thursday, 1:00 PM - 2:00 PM, Sloan 345&#x20;
  * Song: Tuesday, 2:00 PM - 3:00 PM, Sloan 343

> <mark style="color:orange;">**Important:**</mark> To better prepare yourself for office hours and posting Teams interactions, read carefully the excellent guides from [Gabriel Parmer](https://www2.seas.gwu.edu/~gparmer/):
>
> * [Preparing and presenting yourself at office hours](https://www2.seas.gwu.edu/~gparmer/resources/2021-09-20-Office-Hours-HOWTO.html)
> * [Expected norms for online interactions](https://www2.seas.gwu.edu/~gparmer/resources/2020-08-01-Online-Conduct.html)

***

### Acknowledgment

This course uses materials from [Randal E. Bryant](http://www.cs.cmu.edu/~bryant), [David R. O'Hallaron](http://www.cs.cmu.edu/~droh), [Remzi Arpaci-Dusseau](http://www.cs.wisc.edu/~remzi),  [Andrea Arpaci-Dusseau](https://www.cs.wisc.edu/~dusseau), [Kung-Chi Wang](https://school.eecs.wsu.edu/faculty/profile/?nid=kwang), [Bob Lewis](https://users.tricity.wsu.edu/~bobl/), [Youjip Won](https://oslab.kaist.ac.kr/professor-youjip-won/?ckattempt=1), [Tianyin Xu](https://tianyin.github.io), [Mathias Payer](http://nebelwelt.net), [Sanidhya Kashyap](https://sanidhya.github.io), [Peter Reiher](https://samueli.ucla.edu/people/peter-reiher/), and [Hugh Lauer](https://users.wpi.edu/~lauer/).

***

### Course Syllabus

The course syllabus is available [here](https://monowarhasan.info/courses/CPTS360_Syllabus_SP25.pdf).

***

### Textbook

1. <mark style="background-color:purple;">**\[CSAPP]**</mark> [Computer Systems: A Programmer's Perspective](https://www.pearson.com/en-us/subject-catalog/p/computer-systems-a-programmers-perspective/P200000003479/9780134092669), 3rd edition, by [Randal E. Bryant](https://www.cs.cmu.edu/~bryant/) and [David R. O'Hallaron](http://www.cs.cmu.edu/~droh/).
2. <mark style="background-color:blue;">**\[OSTEP]**</mark> [Operating Systems: Three Easy Pieces](https://pages.cs.wisc.edu/~remzi/OSTEP/) by [Remzi H. Arpaci-Dusseau](http://www.cs.wisc.edu/~remzi) and [Andrea C. Arpaci-Dusseau](http://www.cs.wisc.edu/~dusseau). &#x20;
3. <mark style="background-color:green;">**\[LKMPG]**</mark> [The Linux Kernel Module Programming Guide](https://sysprog21.github.io/lkmpg/), Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang.      *This book is helpful for Lab 3.*

***

### Course Schedule

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

<table><thead><tr><th width="75" data-type="number">WK</th><th width="85">Date</th><th width="208">Topic</th><th width="258">Remarks</th></tr></thead><tbody><tr><td>1</td><td>01/07 <br>(Tue)</td><td>Course logistics &#x26; overview</td><td></td></tr><tr><td>1</td><td>01/09<br>(Thu)</td><td>C recap</td><td></td></tr><tr><td>2</td><td>01/14<br>(Tue)</td><td>Computer memory</td><td></td></tr><tr><td>2</td><td>01/16<br>(Thu)</td><td>Computer memory (contd.)</td><td></td></tr><tr><td>3</td><td>01/21<br>(Tue)</td><td>Cache practice problem solution</td><td><mark style="color:blue;"><strong>PA 0</strong></mark> <mark style="color:blue;"><strong>released</strong></mark></td></tr><tr><td>3</td><td>01/23<br>(Thu)</td><td>Linking</td><td></td></tr><tr><td>4</td><td>01/28<br>(Tue)</td><td><mark style="color:green;"><strong>No Class</strong></mark></td><td><mark style="color:purple;">MH is traveling for a meeting</mark></td></tr><tr><td>4</td><td>01/30<br>(Thu)</td><td><mark style="color:green;"><strong>No Class</strong></mark><br></td><td><mark style="color:purple;">MH is traveling for a meeting</mark><br><mark style="color:red;"><strong>PA 0 due</strong></mark></td></tr><tr><td>5</td><td>02/04<br>(Tue)</td><td>Linking</td><td><mark style="color:blue;"><strong>PA 1</strong></mark> <mark style="color:blue;"><strong>released</strong></mark></td></tr><tr><td>5</td><td>02/06<br>(Thu)</td><td>Library Interpositioning</td><td></td></tr><tr><td>6</td><td>02/11<br>(Tue)</td><td>Scheduling</td><td></td></tr><tr><td>6</td><td>02/13<br>(Thu)</td><td><br>Scheduling</td><td><mark style="color:purple;">Informal early feedback (</mark><a href="https://forms.office.com/r/UWakRTr9aT"><mark style="color:purple;">link</mark></a><mark style="color:purple;">)</mark><br><mark style="color:red;"><strong>PA 1 due</strong></mark></td></tr><tr><td>7</td><td>02/18<br>(Tue)</td><td>Scheduling<br>Mid-term review</td><td></td></tr><tr><td>7</td><td>02/20<br>(Thu)</td><td><mark style="color:red;"><strong>Exam 1</strong></mark></td><td><mark style="color:orange;">Exam duration: <strong>60 minutes</strong></mark></td></tr><tr><td>8</td><td>02/25<br>(Tue)</td><td>Scheduling (contd.)</td><td><mark style="color:blue;"><strong>PA 2 released</strong></mark></td></tr><tr><td>8</td><td>02/27<br>(Thu)</td><td>Scheduling (contd.)</td><td></td></tr><tr><td>9</td><td>03/04<br>(Tue)</td><td><mark style="color:green;"><strong>No Class</strong></mark></td><td><mark style="color:purple;">MH is traveling for a meeting</mark></td></tr><tr><td>9</td><td>03/06<br>(Thu)</td><td>Kernel programming</td><td></td></tr><tr><td>10</td><td>03/11<br>(Tue)</td><td><mark style="color:green;"><strong>No Class</strong></mark></td><td><mark style="color:green;">Spring break</mark></td></tr><tr><td>10</td><td>03/13<br>(Thu)</td><td><mark style="color:green;"><strong>No Class</strong></mark></td><td><mark style="color:green;">Spring break</mark></td></tr><tr><td>11</td><td>03/18<br>(Tue)</td><td>Kernel programming</td><td><mark style="color:red;"><strong>PA 2 due</strong></mark><br><mark style="color:blue;"><strong>PA 3 released</strong></mark></td></tr><tr><td>11</td><td>03/20<br>(Thu)</td><td>Virtual memory</td><td></td></tr><tr><td>12</td><td>03/25<br>(Tue)</td><td>Virtual memory and memory-related bugs</td><td></td></tr><tr><td>12</td><td>03/27<br>(Thu)</td><td>Process control</td><td><mark style="color:red;"><strong>PA 3 due</strong></mark></td></tr><tr><td>13</td><td>04/01<br>(Tue)</td><td>Signal</td><td><mark style="color:blue;"><strong>PA 4 released</strong></mark></td></tr><tr><td>13</td><td>04/03<br>(Thu)</td><td>I/O and Network programming </td><td></td></tr><tr><td>14</td><td>04/08<br>(Tue)</td><td>Network programming</td><td></td></tr><tr><td>14</td><td>04/10<br>(Thu)</td><td><mark style="color:green;"><strong>No Class</strong></mark></td><td><mark style="color:purple;">MH is busy for a day-long meeting</mark></td></tr><tr><td>15</td><td>04/15<br>(Tue)</td><td>Concurrency issues and bug<br></td><td></td></tr><tr><td>15</td><td>04/17<br>(Thu)</td><td>Recap &#x26; closing</td><td><mark style="color:red;"><strong>PA 4 due</strong></mark><br><mark style="color:green;">Done with classes!</mark></td></tr><tr><td>16</td><td>04/22<br>(Tue)</td><td><strong>No Class</strong> (exam preparation)</td><td></td></tr><tr><td>16</td><td>04/24<br>(Thu)</td><td><strong>No Class</strong> (exam preparation)</td><td></td></tr><tr><td>17</td><td><mark style="color:red;"><strong>Finals Week</strong></mark> </td><td><mark style="color:red;"><strong>Exam 2 (in-class)</strong></mark><br><mark style="color:red;"><strong>Exam 3 (online submission)</strong></mark></td><td><p><mark style="color:orange;"><strong>Exam 2 5/1/25 10:30-11:30 AM</strong></mark> <br><mark style="color:orange;"><strong>Exam 3 due by 5/1/25, 1:00 PM</strong></mark></p><p><mark style="color:red;"><strong>Late submissions will not accepted</strong></mark><br>The date/time is chosen based on the <a href="https://registrar.schedule.wsu.edu/exams/final-exams/">final exam master schedule</a></p></td></tr></tbody></table>

***

### Programming Assignments <a href="#resources" id="resources"></a>

We will have five programming assignments in this course. The assignments must be completed individually.&#x20;

* **PA 0:** *C skill rehash: Design a Unix filesystem tree simulator using C Tree data structures*
* **PA 1:** *Simulating a cache memory system*
* **PA 2:** *Implement various CPU schedulers (first-come-first-serve, round-robin, shortest-job-first)*
* **PA 3:** *Basic kernel-level programming on Linux*
* **PA 4:** *Develop a web proxy that interacts with the browser and the Internet*

We strongly recommend using a Linux machine (or VM) to complete the labs, as we will use a Linux environment to grade your submissions. Some labs (e.g., PA 3) will not work without a Linux environment. Check the following links for details about setting up virtual machines on your systems.&#x20;

* [Windows, Intel-based Mac, and Linux](https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualbox#1-overview)
* Apple Silicon Mac ([from scratch](https://docs.getutm.app/guides/ubuntu/), [prebuild-images](https://docs.getutm.app/guides/ubuntu/))

**Note:** for Windows systems, [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) is **not recommended**. You must install a standalone VM image.&#x20;

### Programming Assignment Submission <a href="#pa" id="pa"></a>

We will use [GitHub Classroom](https://classroom.github.com) to deliver programming assignments. This way, you can better manage your assignments using a widely-used version control system, [Git](https://git-scm.com).&#x20;

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

1. [Eddie Kohler’s Git notes](https://cs61.seas.harvard.edu/site/ref/git/#gsc.tab=0)
2. [Git handbook from GitHub](https://guides.github.com/introduction/git-handbook/)

To learn more about GitHub workflow, see [GitHub Quickstart](https://docs.github.com/en/get-started/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](https://github.com/cli/cli). Install GitHub CLI using the instructions given [here](https://github.com/cli/cli#installation). Then run the following command and follow the prompts to authenticate your system: `gh auth login`.

#### Submission Workflow <a href="#resources" id="resources"></a>

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:**&#x20;
   * Copy the URL of your GitHub repository on the corresponding assignment section on Canvas.&#x20;

If you have any questions about setting up GitHub, please contact the TA.

***

### Useful Resources <a href="#resources" id="resources"></a>

* [Unix and Linux Tutorial](https://heather.cs.ucdavis.edu/~matloff/unix.html)
* [C declarations](https://cdecl.org)
* [Essential C](http://cslibrary.stanford.edu/101/EssentialC.pdf), By [Nick Parlante](https://cs.stanford.edu/people/nick/)
* [GNU C Reference Guide](https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html)
* [Interactive C Tutorial with Exercises](https://www.learn-c.org)
* GDB [Tutorial 1](https://github.com/mnwrhsn/gdb-tutorial/blob/main/gdbTutorial.pdf), [Tutorial 2](http://beej.us/guide/bggdb/)
* [Git Book](https://git-scm.com/book)
* [Linux Kernel Documentation](https://www.kernel.org/doc/html/latest/index.html)
* GitHub Classroom: [Tutorial 1](https://www.youtube.com/watch?v=ObaFRGp_Eko), [Tutorial 2](https://www.youtube.com/watch?v=8gbKzNlWNAk)

***

#### <mark style="color:blue;">Got stuck? Questions about anything? Feel free to contact the instructor on Teams (preferred) or via email: <monowar.hasan@wsu.edu>!</mark>
