P436
Operating Systems

Fall 1997

Instructor

Scott Stoller

A.I.

Leena Unnikrishnan

Hours

Lectures: Monday and Wednesday, 4:00PM - 5:15PM, in BH304.
Discussion: Thursday, 5:45PM - 6:35PM, in BH003.
Instructor's Office Hours: Monday and Wednesday, 5:15PM - 6:15PM, or by appointment, or by chance. Lindley Hall 201D.
A.I.'s Office Hours: Tuesday and Thursday, 3PM-4PM. Lindley Hall 301E.

Home Pages from Previous Years

Fall 1996 P436/P536 Home Page

Official Description

Click above to see the official blurb describing this course.

Tentative Syllabus

LecturesTopic
1Introduction
2-12Processes and Threads: Synchronization, Scheduling, Deadlock
13-17Memory: Segmentation, Paging, Virtual Memory
18-20I/O, Filesystems
21-22Protection
23Distributed Systems: Introduction
24-25Communication: Messages, RPC, Group Communication
26-28Distributed Filesystems

The lectures are based in part on Tom Anderson's lecture notes for CS162 at UC Berkeley.

Textbook

Andrew Tanenbaum, Modern Operating Systems (Prentice Hall, 1992).

Project

The project is to design and implement parts of a small operating system, called Nachos, which runs in a simulator that runs on Sun workstations. You will be given a "skeleton" of the operating system and will be asked to implement some of the missing parts, e.g., synchronization primitives for threads, support for multiprogramming, and virtual memory management. You will work on the project in small teams. The programming is (almost) in C. A few simple features of C++ are used; they will be explained as needed. Here is a brief Overview of Nachos, from its developers at UC Berkeley.

Project Mechanics

Click above for information on accounts, software tools, submitting assignments, etc.

Project Guidelines

This handout describes what should be submitted for each assignment. It also covers grading policies, late-submission policies, etc.

Grading

The breakdown is:
Project + problem sets 50%
Midterm examination 19%
Second in-class exam10%
Final examination 21%
Grading on the project will emphasize good design as well as working code. Exams may cover all aspects of the course, including the project. The midterm will be a 75-minute, in-class exam. The final will be a 2-hour exam held at the time specified in the Registrar's Schedule of Final Examinations. The weights of the two exams are in proportion to their length.

Course Newsgroup: ac.csci.p436

If you have questions about the lectures or the project, this is a good place to ask them, so that other students can benefit from your questions. If you see a question and (think you) know the answer, post it! This will help your classmates and show us that you know what's going on.

Statistics

ItemMeanStddev
proj1 (out of 20)16.05.8
hw1 (out of 10)7.02.9
proj2 (out of 50)42.55.6
midterm (out of 35)22.6 (65%)5.8
hw2 (out of 10)12.82.2
midterm2 (out of 40)31.0 (77%)4.9
proj3 (out of 50)44.14.3
proj4intro (out of 50)48.92.5
proj4 (out of 50)43.54.0
final (out of 45)27.1 (60%)7.1
For hw2, the extra-credit problem was worth 5 points.

Histograms

proj1 scores
hw1 scores
proj2 scores
midterm scores
midterm2 scores

Weekly Announcements


Week of Dec 15

ENJOY THE WINTER BREAK!

Course Grades: Course grades have been sent by e-mail. If you didn't receive one, let me know.

Grading statistics: Statistics for the final exam have been added to the table above.

Office Hour: I will have an office hour on Thursday at 4pm.

Trivia: Number of course-related news/mail messages sent or received by the instructor this semester (excluding homework and project submissions): 1479.

Week of Dec 8

Handout Reminder: During the weeks of 17 Nov and 24 Nov, a handout with a description of Sun NFS was distributed (photocopied from another textbook). If you did not get that handout, you might want to copy it from a classmate (or from me).

Old Final Exam: Here is the Fall 1996 Final Exam (with solutions). Note that Problems 8-10 and the extra-credit problem are on topics that were not covered this year.

Practice Problems for Final: Here are Solutions to Selected Practice Problems for Final Exam. Solutions to other practice problems will not be distributed, but if after working on the problems, you have doubts about some of your solutions, you can post your solutions and your doubts to the newsgroup, or email them to c536, or come to my office during the office hour at 2pm on Sunday (or at other times).

Course Evaluation: Please fill out the On-line Course Evaluation. Your evaluation and comments would be appreciated.

Proj4: Grading statistics for proj4intro and proj4 have been added above.

Final Exam: The final exam will probably have 1 question about nachos. The question might deal with threads or user programs. It would not deal with details of the MIPS R2000 simulation; the only files in machine that it might assume familiarity with are machine/interrupt.*. I just eliminated machine/timer.cc from here, because it is not in the nachos code handout. Sorry for the confusion.

Extra-credit Project: I'd like to remind everyone that a correct and sensible design is always worth something for a project. So, even if you don't have time to implement and debug proj5, I still encourage teams to submit a design document, describing the important data stuctures and algorithms that would be used in their distributed file system, and how each kind of of file operation would be handled by the client and the server.

Course Evaluation: Please fill out the On-line Course Evaluation. The course has changed considerably from last year. Your evaluation and comments can influence its future.

Week of Dec 1

Proj3: Grading statistics for proj3 have been added above.

Final Exam: Here is a list of Practice Problems for Final Exam. Basically, I have listed all problems in Tanenbaum that correspond to material covered in lecture.

Proj5: Please read the Proj5 FAQ.

Final Exam: You are strongly encouraged to bring a copy of the original nachos code to the final exam (you don't need to bring the code you wrote).

Homework: Several teams have expressed an interest in working on proj5. To encourage this, there will not be another homework assignment. It would be nice if teams are able to do at least part (1) of the project, described below under "More advice on the extra-credit proj5".

Final Exam: The final exam will cover the entire course. (The exam will not necessarily emphasize later material.)

Proj5: As mentioned in a newsgroup posting, ~c536/proj5 now contains code for writing to remote files.

Midterm2: Grading statistics and a histogram have been added above. Incidentally, on this exam, the mean for P436 is 77%; the mean for P536 is 75%.

Final Exam: Like the first midterm, the final exam will be open book and open notes. "Book" means Tanenbaum; no other books. "Notes" means your own handwritten notes: no photocopies of other people's notes. You can also bring all course handouts (problem sets, Nachos code, etc.).

Textbook Readings: By now, you should have read Tanenbaum, Chapter 9. Now read Tanenbaum, Chapter 13. Note that Tanenbaum's description of Sun NFS is (inconveniently) split between these two chapters. We won't have time to cover the material in Chapters 10-12.

Proj5: As I mentioned in lecture on Dec 1, the code in ~c536/proj5 has a "security hole", because it does not check whether the file descriptor supplied by a user process in a read or close system call is valid, i.e., corresponds to a file opened by that process. I mention this issue again here for the sake of people who missed that lecture.

Handout: In the handout with pictures of the tables used by Sun NFS, in the lower figure, entry 18 in the v-node table should contain "remote, 4" (instead of being empty). Don't forget that the pictures in this handout should not be taken too literally; for example, the i-node numbers (like 207 and 999) should really be entire file handles.

Midterm2: If you have questions about the grading of midterm2, please ask the appropriate person during their office hours (if possible): Madhu for problems 1-2; Scott for problems 3-6; Leena for problems 7-8. This will help ensure consistency of grading.

Week of Nov 24

Solutions to Midterm2 are now available.

Project: More advice on the extra-credit proj5. I recommend the following two-stage approach: (1) Implement the remaining operations (Write, Create, and Remove) for remote files (note: although there is no system call corresponding to FileSystem::Remove, you should implement Remove for remote files anyway, so that you can remove a remote swap file when the corresponding process exits). (2) Implement caching of blocks.

Final Exam Schedule: A significant number (about 1/3) of the students do not prefer to take the final exam on Dec 15, so it will be held at the originally scheduled time: 2:45pm-4:45pm on Fri, Dec 19. Sorry to disappoint those of you who were rooting for the earlier date.

Week of Nov 17

Final Exam Schedule: The P436 final exam is scheduled for 2:45pm-4:45pm on Fri, Dec 19. I am considering allowing P436 students to take their final exam concurrently with P536 students on Mon, Dec 15, 5pm-7pm. Probably I will do this only if all students indicate that they prefer taking the exam on that earlier date. Please be ready to indicate your preference in class on Monday, or by sending email to c536 before that class.

Practice Problems: Here are Solutions to Selected Practice Problems for 2nd Exam.

Extra Office Hours: Due to the exam, the instructor will have two extra office hours: Friday, 2pm-3pm, and Mon, 10am-11am.

Practice Problems: Here are Practice Problems for 2nd Exam.

Exam: The second in-class exam will cover Topics IV (Memory Management), V (I/O Hardware), and VI (File Systems).

Project: Project 5 is now available. It is extra-credit.

Textbook Readings: Tanenbaum, Chapter 9.

Week of Nov 10

Project: An important requirement was added for proj4. It is described in a newsgroup posting, duplicated here for your convenience.

Project: In deciding how to use your slip time, keep in mind that proj4 is the last required project. However, there will be an optional extra-credit project (proj5), which will have a due date. (You will get less extra-credit if you submit proj5 after the due date, unless you use slip time for it.)

Week of Nov 3

Grading Info: I updated the histogram of midterm scores (and the mean and std deviation) to reflect grading corrections. I also added the mean and std deviation for hw2 to the above table.

Textbook Readings: Tanenbaum, Section 5.1-5.3.

Exam: There will be an in-class exam on Mon, 24 Nov, worth approximately 10% of your course grade. The approximate weight of the final exam is therefore reduced by 10%. This in-class exam will be open textbook but closed everything else. At least two of the problems on the exam will be taken from the textbook, possibly with some numbers changed. This in-class exam does not cover material already covered on the midterm. Of course, the final exam covers everything in the course.

Week of Oct 27

Recommended Activities: This is almost too obvious to mention, but anyway... A good way to check your understanding of lectures is to do the problems in Tanenbaum, or in any other standard OS textbook (such as the one by Stallings, mentioned below, or Silberschatz et al.). For example, this would be a good time to do a bunch of problems from the Memory Management chapter(s) of any of these books.

Recommended Readings: A textbook that is (in places) clearer and more detailed than Tanenbaum is: William Stallings, Operating Systems, 2nd edition (Prentice-Hall, 1995). You might find this book useful to clear up the vague points from Tanenbaum's discussions or from lecture. I requested (on Oct 29) that this book be put on 24-hour reserve (i.e., you can check it out for 24 hrs) in Swain Library. The book should be available there within 10 days (it is checked out right now). If availability of the book becomes a problem, let me know, and I will have the status changed to 2-hour reserve.

Textbook Readings: Tanenbaum, Chapter 3 and Section 7.5.2.

Week of Oct 20

Project 4 handout is now available.

Week of Oct 13

Midterm: If you have questions about the grading of the midterm, please ask the appropriate person during their office hours (if possible): Leena for problems 1 and 2; Madhu for problems 3 and 5; Scott for problems 4, 6, and 7. This will help ensure consistency of grading.

The new due date for Project 3 is Tuesday, 21 Oct.

There are new sections above with grading statistics and histograms, to help you see how your scores compare to those of other students. Those sections will be updated periodically.

Week of Oct 6

Solutions to Midterm are now available.

Solutions to Practice Problems for Midterm are now available.

Solutions to Homework 2 are now available.

Project 3 is due on 19 Oct (this is a change from the original due date). The preliminary design document for proj3 is due on 12 Oct.

Practice Problems are now available.

Late Homework Policy: For homework (i.e., problem sets), there are no slip days. Late homework will be marked off 10% per day, until solutions are posted. Homework submitted after solutions are posted will be ignored.

Homework 2 was posted on 6 Oct and is due on 10 Oct.

Midterm: To minimize memorization anxiety, the midterm will be open book and open notes. "Book" means Tanenbaum; no other books. "Notes" means your handwritten notes: no photocopies of other people's notes. You can also bring all course handouts (problem sets, Nachos code, etc.).

Grading of Homeworks: In homeworks, all problems (except extra-credit problems, if any) are of equal weight, unless the homework indicates otherwise. In hw1, problem 1 is worth 10 points, and the extra-credit problem is worth 5 points.

Proj3: Some clarifications were posted to the newsgroup; they are repeated here for ease of reference. 1. You do not need to implement the Fork and Yield system calls. 2. For Join, you can require that a process Join only on its children. Without this requirement, there is a garbage-collection problem (it's never safe to discard the return-value of a process). If Join is called with a SpaceID that does not correspond to one of the caller's children, Join should return immediately, with (say) a return-value of -1 to indicate that an error occurred.

Solution to Homework 1.

Week of Sep 29

No announcements. Great!

Week of Sep 22

CPU Scheduling was covered in class on Sept 22.

Deadlock was covered in class on Sept 24.

Reminder: Preliminary design document for proj2 is due on 24 Sep. It should show us that you know what to do. For example, it should describe where the significant chunks of code will go (i.e., how they will fit into the Nachos skeleton that you are given) and what they will do.

Reminder: Homework2 is due on 22 Sep.

Office Hours: The instructor's office hours on Sep. 22 and Sep. 24 are cancelled. The A.I.'s office hours are not affected.

Week of Sep 15

Project: Projects 2+3 are now available.

Midterm will be held in class on Mon, 13 Oct. Don't miss it!

Homework 1 was posted on 15 Sep and is due on 22 Sep.

Exam Policy: Exams may cover all aspects of the course, including the project. This is partly to discourage people from letting their teammates do all of the work on the project.

Late Homework Policy: see above (Week of Oct 6).

Week of Sep 8

Please send course-related email to c536@cs.indiana.edu rather than stoller@cs.indiana.edu.

Project: Project 1 was posted on Sep. 9 and is due Sep. 16.

Textbook Readings: Tanenbaum, Section 12.1.

Textbook Readings: Tanenbaum, Chapter 2.

Handouts: Buggy versions of Thread Pseudo-Code were distributed in lecture on Mon., Sep. 8 and Wed., Sep. 10. A corrected version of Thread Pseudo-Code is available here. The corrections are described in some newsgroup postings. You should read the pseudo-code and (to check your understanding) trace the execution of the example (involving procedures main, B, C, and A' or A'') that I traced during lecture.

Week of Sep 1

Textbook Readings: Tanenbaum, Chapter 1.

Handouts: 4 handouts were distributed in lecture on Sep 3. They are: (1) Nachos code, (2) A Quick Introduction to C++, (3) Project Guidelines, (4) Roadmap to Nachos. You can easily print all of these yourself, except the Nachos code. If you didn't get a copy of the Nachos code, let me know.

Project:

(1) Try to form teams by Monday, Sep. 8.

(2) Read the Project Guidelines (handout).

(3) Read the Project Mechanics page.

(4) Read A Quick Introduction to C++ (handout).

(5) Read sections 1, 2, and 3 of A Road Map Through Nachos (handout) and the threads code (in the thick handout of Nachos code, or online in ~c536/nachos-3.4/code/threads). In the thick handout, the files are arranged alphabetically by directory and filename; for example, "threads/scheduler.cc" comes before "threads/synch.cc", which comes before "userprog/addrspace.cc" Also, each ".h" file immediately precedes the corresponding ".cc" file.

(6) Another helpful resource is Mike O'Donnell's Guide to Reading the [Nachos] Source Code. Mike's Guide is available only in HTML format, so we won't be supplying printouts.