CS 406: Operating Systems

Spring 2020

Welcome to Operating Systems!

All the homework/labs/lectures will be distributed on Moodle.

We meet MWF, 1:10-2 pm, RISC 460.

Course Description

Course Description

This course introduces you to operating systems, their relationship to the computer hardware, and the system programming techniques you can use to take fuller advantage of the operating system to write more powerful application programs. As Alison Norman has said in the description of her Computer Systems Course at the University of Texas at Austin:

Students graduating with CS degrees should believe “there is no magic”: they should be able to describe the chain of events that occurs when they hit a key and cause a letter to appear on the screen from the register level (or logical gate level or transistor level) to the system architecture level to the operating system level to the application level. This is philosophically important, but it is also of practical interest to developers who need to figure out how to make a system do what they want it to do. [Syllabus of Computer Systems Course, retrieved January 21, 2018]

In this course you will learn about the fundamental abstractions in modern operating systems including processes, threads, virtual memory, protection, file systems, and i/o. You will have a chance to implement some operating system functions in these areas. You will also learn about concurrency, and how to write concurrent software. Understanding concurrency is essential not only in operating systems but also in most systems that serve groups of users or attempt to take advantage of modern multi-core processors. A database system, for example, uses concurrent programming techniques to run multiple transactions simultaneously while making it seem that they run in serial order.

Perhaps, one cautionary announcement is in order. Operating systems require detailed, precise work. Software that is right 99% of the time is not good enough. Software needs to be correct to avoid things like deadlock, resource exhaustion, and process starvation. Bugs that cause these problems are often difficult to find during testing. These problems need to be prevented during design and coding. That’s part of what this course is about. There will be several programming assignments during the course of the term. While I’m not expecting them all to be lengthy, they will require time because you will need to think deeply, build your understanding of computer systems, and then code with precision.

On the other hand, there’s nothing like operating systems programming to give you a feeling of accomplishment. In systems programming, you have complete control over the system. You can write more powerful and persistent programs with great impact. It’s another thing that I really enjoy in computer science, and hope you will enjoy it as well.


Instructor Information(back up↑)

  • Instructor: Dr. Joann J. Ordille
  • Email: ordillej at lafaytte.edu
  • Office: 565 RISC
  • Office Phone: (610) 330-5416
  • Office Hours: MW 4-5:30 pm, T 4-5 pm. Please email me if you would like to meet at any other time. Also, if my door is open, feel free to drop in.


Useful Links(back up↑)

CATME is the class tool for creating teams and evaluating the contribution of team members. This is a general information site. You will receive email for team creation and evaluation.

  • Papers published in the computer science literature as announced on Moodle.

We will read two or more papers together to broaden our perspective on operating systems. Reading computer science papers is a primary way to keep up with the state of the art once you graduate. You will learn approaches to reading a computer science paper that will increase your understanding of it.

  • Moodle

We will use Moodle extensively. In particular, detailed information for class activities and assignments will be available weekly. Please check Moodle frequently, and whenever you receive an email notification to do so.

Course Information

Course Information(back up↑)

    • Operating Systems: Three Easy Pieces, by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau.
    • This book has a free online version, and some some additional relatively inexpensive versions. You can obtain the free online version and other versions from this web site: http://pages.cs.wisc.edu/~remzi/OSTEP/My Sites
    • The C Programming Language, 2nd edition, by Brian W. Kernighan and Dennis M. Ritchie, (ISBN: 978-0131103627) Prentice Hall.
    • This book is the classic for learning C, known in the programming community as the K & R. It’s clear and concise, and a favorite of mine. It’s recommended here, because you need to know C for this class.  There are other resources for learning C included in this course, but I tend to go here for particularly tricky syntax and application questions.
    • Computer Systems: A Programmer’s Perspective, 3rd edition, by Randal E. Bryant and David R. O’Hallaron. (ISBN: 978-0-13-187325-409266-9), Pearson.
    • We have used this book for a number of years and it is the required book for CS 203.  To reduce cost, this book is no longer required, but it is recommended as a reference.  To see recommended sections of this book for topics in this course, refer to the schedule for last year’s course.
    • Other short readings from books and articles will supplement our textbooks.  These will be provided via links or information on Moodle.
  • Prerequisites:

    Students are required to complete CS 203 (Computer Organization) or ECE 313 (Computer Organization) successfully before registering for this course. Students are also required to co-register in CS 205 (Software Engineering).

Course Goals and Outcomes

Course Goals and Outcomes(back up↑)
Course Goals:

The goals of this course are to convey:

  • Understanding of the fundamental concepts in modern Operating Systems: processes, threads, synchronization (essential to concurrent programming), scheduling (for the processes and threads), memory management, i/o, and file systems.
  • Understanding of multi-programming and synchronization in such programming models.
  • Skill in presenting materials on group projects.

Course Outcomes: After successfully completing this course, students will be able to:

  • Analyze a complex computing problem and to apply principles of computing and other relevant disciplines to identify solutions (ABET Outcome 1).
  • Design, implement, and evaluate a computing-based solution to meet a given set of computing requirements in the context of the program’s discipline (ABET Outcome 2).
  • Function effectively as a member or leader of a team engaged in activities appropriate to the program’s discipline (ABET Outcome 5).

Assignment Types

(back up↑)Assignment Types

Class Attendance: Class attendance is critical to success. Students typically find the concepts in operating systems challenging when they first encounter them, so don’t put yourself at a disadvantage by skipping class. Every effort should be made to arrive on time and remain attentive for the entire class. In addition to unexcused absence, a pattern of late arrival, early departure or inattentiveness will be considered a violation of the attendance requirement. The percentage of the time you attend class will be combined with my evaluation of your level of participation to assign 3% of your grade.  If you have a dean’s excuse or a coach’s letter for a particular day, you will be excused from class.

Class Participation: Class participation includes asking or answering questions, expressing an opinion about a topic of discussion, meeting with me during office hours, and reporting on activities in a group project, a reading group, or other group activity. All sincere efforts to participate are admired, so don’t worry, just speak up. You are even welcome to express an opinion different than mine. All types of participation count except participation that shows you failed to prepare for class. For example, asking: “Who is Ada Lovelace?” when the assignment was to read the Countess of Lovelace’s biography would not count as class participation.

Reading Groups: Before the second class meeting, we will form reading groups of four students. Two or more times during the semester, you will read a paper in the computer science literature, and meet with your reading group to discuss it. I will provide you with a strategy for reading the paper well, and some questions for discussion. Your group will be responsible for submitting a summary of your discussion in writing before the class meets to discuss the paper with me. The summaries will count as part of your homework grade.  You may also want to meet with your reading group to study for exams. Teams for the software projects may be different from your reading group.

zyBook Homework: The zyBook provides an interactive learning experience.  There are participation activities that you will need to complete in doing the assigned reading to prepare for class.  There are also challenge activities in the C part of the book that you need to complete.  You will receive points for doing these assignment by the due date, and the percentage of the assignments completed will determine your zyBook homework grade.  Since the zyBook assignments are to prepare for class, late assignments will not receive credit.

Other Homework: Other Homework assignments will be listed in Moodle to help all of us track them. Completing this homework will deepen your understanding, and assist you in preparing for projects and exams.

Quizzes: To help you stay current with the assigned reading, you will do graded interactive exercises in the zyBook (see above) and there may be unannounced quizzes for readings outside the zyBook. The quiz will test whether you completed the reading assignment. The intention here is to encourage you to complete reading assignments before class. If it appears that students in the class are falling behind, there will be announced quizzes that cover material from the previous week. The intention here is to encourage you to review the material each week in preparation for the next week.  The quiz and other homework grades are combined to determine 5% of your grade.

Group Projects: There will be three or four programming projects throughout the term to familiarize you with parts of the operating systems. You will work on the projects in groups of two or more as specified in the project description. For the first project, you will build a shell program for Linux. In this project, you have the option to work singly or in pairs. If you work in pairs, I urge you to use pair programming techniques to ensure that you both completely understand the solution. In pair programming, one person programs while the other watches both for understanding and to catch mistakes. The person who programs and the one who watches should switch roles frequently, so they are each at the keyboard about half the time. This technique was frequently used by the developers of the Unix Operating System. If it worked for them, it should also work for you. An intimate knowledge of the projects will be important in scoring well on the exams, so don’t miss a chance to learn all you can.

Exams: In addition to the ability to answer homework type problems, questions on the midterm and final exams will also test your conceptual understanding of operating systems. Are you able to synthesize solutions to new problems from what you have learned? We will discuss the types of possible exam questions before each exam. All work on the exam must be your own. There will be no make-up or early exam sittings without a request from the Dean on your behalf.

Academic Honesty

(back up↑)Academic Honesty

It is essential that you follow the Lafayette College Code of Conduct with respect to academic honesty and avoidance of plagiarism as described in the Student Handbook. The beginning of the semester is a good time to review the handbook in this regard.

“To maintain the scholarly standards of the College and, equally important, the personal ethical standards of our students, it is essential that written assignments be a student’s own work, just as is expected in examinations and class participation. A student who commits academic dishonesty is subject to a range of penalties, including suspension or expulsion. Finally, the underlying principle is one of intellectual honesty. If a person is to have self-respect and the respect of others, all work must be his/her own.”

The Handbook gives the following examples of intellectual dishonesty:

  1. Submitting someone else’s work as your own.
  2. Incorporating someone else’s ideas or work into your own without attribution.
  3. Paying or arranging for someone else to do your work.
  4. Re-using material from another course without permission of your instructor.
  5. Engaging in unauthorized collaboration including asking for homework or programming assignment answers from an online discussion group.
  6. Obtaining the Instructor’s Answer Guide to the exercises in the book and using it. (This would also constitute theft, since the guide is only licensed to instructors.)

Academic dishonesty also includes copying explanatory material, such as descriptions of software packages, into documentation without indicating the source of the text and that it was copied.

When in doubt about whether an action is considered academic dishonesty, it is best to consult with me before you act. Cases of suspected intellectual dishonesty will be reported to the Dean, and the Dean will investigate and impose penalties.


(back up↑)Grading

Graded Material:
The course grade is based on the materials listed below graded on a 100 point scale, with each item contributing a specified percentage to the overall score. As specified in the student handbook, A will reflect excellent work, B will reflect good work, C will reflect acceptable work, and D will reflect passing work.

Class Attendance & Participation 3%
zyBook Homework 7%
Quizzes and Other Homework 6%
Group Projects 24%
Midterm 1 20%
Midterm 2 20%
Final Exam 20%

Grading Scale:
Typically, grades are assigned as follows from your final numerical grade:

A: 93-100 B+: 87-89 C+: 77-79 D+: 67-69 F: 0-59
A-: 90-92 B: 83-86 C: 73-76 D: 63-66
B-: 80-82 C-: 70-72 D-: 60-62

Tentative Schedule

(back up↑)Tentative Schedule*

The currently assigned zyBook readings will be managed by the zyBook, so refer to the zyBook for the readings due in preparation for a class meeting. 
Wk. Dy. Date Topic

(Z: zyBook,
P3: Three Easy Pieces,
C: University of Illinois Coursebook)
1 M 1/27
Course Overview, Programming in C
Z: Ideally, you will review C using the zyBook C- Week 1 assignment before class starts.  If that is not possible, you have until Sunday.
W 1/29
History of Operating Systems
Z: Introduction,
F 1/31
(Try the code on the course linux server!)
2 M 2/3
Enabling Technologies:
Dual Mode Execution
Z: Dual Mode Execution
W 2/5
Z: Processes
F 2/7
Processes and Concurrency, System Services
P3: Sections 3, 4, 5, 6
3 M 2/10
Unix Process Creation: Fork, Exec, Wait
W 2/12
Exec and Signals
F 2/14
Safe Signal Handling
Bryant and O’Hallaron: 8.5.5-8.5.7
4 M 2/17
Z: Scheduling
P3: 7, 8, 11
W 2/19
Z: Threads and Concurrency
P3: 25, 26, 27
F 2/21
Threads and Locks
P3: 28
5 M 2/24
Midterm 1
W 2/26
Z: Semaphores
P3: 31, 32, 34
F 2/28
Semaphore and Lock Exercises
6 M 3/2
Monitors, Pintos Project Discussion
Z: Monitors
Thread excerpt from Chapter 15 in Head First Java by Kathy Sierra and Bert Bates.
W 3/4
Monitor Semantics
Mesa Monitors Paper
(Sections 4, 4.1, 3.2)
F 3/6
Thread Safety and Performance
Bryant and O’Hallaron: 12.6-12.7.4
7 M 3/9
Z: Deadlock
P3: 32
W 3/11
F 3/13
Debugging in Pintos
8 M 3/16
Spring Break
W 3/18
Spring Break
F 3/20
Spring Break
9 M 3/23
Therac-25 Discussion
Helpful graphics that require Flash (try one-time activation in Microsoft Edge):
W 3/25
Intro to Virtual Memory
Z: Virtual Memory Introduction
P3: 12, 13, 14, 15
F 3/27
10 M 3/30
Midterm 2
W 4/1
P3: 16
F 4/3
Free Space Management
P3: 17
11 M 4/6
The Memory Hierarchy
Section 13.1, 13.4 and 13.5 from “Memory Hierarchy” in Computer Organization and Design Fundamentals by David Tarnoff
W 4/8
Intro to Paging
Z: Paging
P3: 18
F 4/10
P3: 19
12 M 4/13
Advanced Paging
Z: Advanced Paging
P3: 20
W 4/15
Swapping, Replacement Algorithms
Z: Page Replacement Algorithms
P3: 21, 22, 24
F 4/17
I/O, Disk Drives, RAID
Z: Input/Output
P3: 35, 36, 37, 38
13 M 4/20
File System Interface and Design
Z: File System
P3: 39, 40
W 4/22
File System Optimization
P3: 41
M 4/24
File System Crash Recovery
P3: 42
14 M 4/27
Journaling File System
P3: 43, 46
W 4/29
Z: Protection and Security
F 5/1
15 M 5/4
Mini OS Conference
W 5/6
Mini OS Conference
F 5/8

*Tentative schedule, subject to change. Check Moodle for the most up to date information.

**No travel arrangements should be made until the final exam schedule has been issued

Additional Information

(back up↑)Additional Information

SM&RT (SMART) Advisor: Advisors in the Sexual Misconduct & Resource Training Program, formerly SASH, seek to prevent sexual and gender based violence and harassment. They also provide services to those who have suffered from such violence or harassment. I am an SMART Advisor, and am available through appointment to assist you or your friends if you experience sexual misconduct.

Respect for classmates, colleagues and team members: All students are expected to show respect and courtesy to each other. Mutual respect is a high ideal in academic, business, and personal life. It is central to learning well together. Disagreements over ideas or constructive criticism of someone’s work is in keeping with this ideal. Attacking or disparaging someone is not, and will not be tolerated. In group projects, mutual respect also includes reliably contributing to the project and keeping your commitments to the group.

We follow the College Diversity Statement which says in part:

All members of the College community share a responsibility for creating, maintaining, and developing a learning environment in which difference is valued, equity is sought, and inclusiveness is practiced.

To learn more about how these principles are followed in the computing industry, view the Google video:

Diversity at Google (https://youtu.be/_3RoQRN65AI)

and the eBay video:

Diversity Workshop at eBay, Europe (https://player.vimeo.com/video/159767606)

Privacy: Moodle contains student information that is protected by the Family Educational Right to Privacy Act (FERPA). Disclosure to unauthorized parties violates federal privacy laws. Courses using Moodle will make student information visible to other students in this class. Please remember that this information is protected by these federal privacy laws and must not be shared with anyone outside the class. Questions can be referred to the Registrar’s Office.

Equal Access: In compliance with Lafayette College policy and equal access laws, I am available to discuss appropriate academic accommodations that you may require as a student with a disability. Requests for academic accommodations need to be made during the first two weeks of the semester, except for unusual circumstances, so arrangements can be made. Students must register with the Office of the Dean of the College for disability verification and for determination of reasonable academic accommodations.

Important Dates:

  • Normal Add/Drop deadline: February 7th
  • Spring Break: March 16th – 20th
  • Last day to Withdraw (WD): April 20th
  • Classes end: May 8th
  • Final Exams: May 11th – 18th

Federal credit hour statement: The student work in this course is in full compliance with the federal definition of a four credit hour course. Please see the Registrars Office Website (https://registrar.lafayette.edu/wp-content/uploads/sites/193/2013/04/Federal-Credit-Hour-Policy-Web-Statement.doc) for the full policy and practice statement.

Credits: A special thank you to Alison Norman, University of Texas at Austin, for access to her syllabus and materials for a similar course. They were very helpful in developing this course.

Photo of Operating Systems Textbook © Zyante Inc. Photo of Operating Systems: Three Easy Pieces Textbook Copyright © Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau.  Photo of The C Programming Language © Prentice Hall.  Photo of Computer Systems: A Programmer’s Perspective Textbook Copyright © Pearson.