CS 406: Operating Systems

Spring 2021

Welcome to Operating Systems!

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

We meet MWF, 2:10-3pm via the video conferencing link on Moodle.

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

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: 3-5, F: 3-4 online on class link. Please email me if you would like to meet at another time.

Resources

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.

  • Resources for Learning C
    • Class resources including the zBook C chapters and the C chapters in the University of Illinois System Programming Coursebook (see additional information in the textbook section below).
    • C for Java Programmers: an easy read and helpful in leveraging what you already know about Java in learning C
    • MIT Open Course Ware Lecture Notes on the C Programming Language
    • University of Cambridge Resources for Learning C
    • LinkedIn Learning, accessible for free through your myLafayette page, offers several tutorials. You need to learn about pointers, memory allocation (malloc and free), and pointers to functions.
    • Additional resources for the Linux shell and debugging will be provided on Moodle.
  • 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.
    • 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 Participation: Class participation includes asking or answering questions, expressing an opinion about a topic of discussion, meeting with me during office hours, interacting with me on Slack, participating in your team and reporting on activities in a team project or other 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. But, it’s always better to ask than to sit there in the dark.

Lightweight Team Participation: Research has shown that students learn better in a community with their peers. We hope to help you form that community by creating lightweight teams that will collaborate in various course activities. The teams are lightweight, because they are for learning collaboratively without a lot of grade stress. Your contribution to your team counts for 2% of your grade.  Your lightweight team will also function as your reading group.  Several times during the semester, you will read a paper in the computer science literature, and meet with your lightweight team 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. You may also want to meet with your lightweight team to study for exams. Your software project group may be different from your lightweight team.

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. Quizzes will be counted as part of your homework 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.

Grading

(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 2%
Lightweight Team Participation 2%
zyBook Homework 6%
Quizzes and Other Homework 4%
Group Projects 23%
Midterm 1 21%
Midterm 2 21%
Final Exam 21%

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*


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

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

*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 19th
  • Spring Break: March 30th – 31st
  • Last day to Withdraw (WD): April 26th
  • Classes end: May 19th
  • Final Exams: May 22nd – 29th

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.