Click here to see a PREVIEW of important rules that was posted before the semester started.

This is an undergraduate course on computer operating systems. (But only graduate students are permitted to be in this class. USC undergraduate students must take CS 350 in order to get credit for OS. If you are an undergraduate student, you cannnot be in this class and you cannot get credit for Operating System if you take this class. Please check with your adviser to see which Operating System class you need to take!) In addition to exploring concepts such as synchronization, virtual memory, processes, file systems and virtualization, students will develop elements of a fairly complete operating system during the course of the semester.
 

Instructor Bill Cheng (click to see office hours)
E-mail: <bill.cheng@usc.edu>.  (Please do not send HTML-only e-mails. They will not be read.)
  DEN Section (29945D+29946D) PM Section (30243D) TT Section (30203D)
Time MW 10:00am - 11:20am (NEW)  MW 12:25pm - 1:45pm (NEW)  TT 9:30am - 10:50am 
Location OHE 136  SGM 226  VHE 217 
TA Ben Yan, E-mail: <wumoyan@usc.edu>
Office Hours: Mon 3:00pm - 5:00pm in SAL 200
Chien-Lun Chen, E-mail: <chienlun@usc.edu>
Office Hours: Fri 1:30pm - 3:30pm in SAL 200
Chien-Lun Chen, E-mail: <chienlun@usc.edu>
Office Hours: Fri 1:30pm - 3:30pm in SAL 200
Course Producer
Chang Xu, E-mail: <cxu925@usc.edu>, Helpdesk Hours: Tue 1:00pm-3:00pm, Thu 1:00pm-3:00pm, Fri, 2:30pm-4:30pm in SAL student computer lab (SAL 125)
Graders
Parth Kapadia, E-mail: <pkapadia@usc.edu>
Deepa Sreekumar, E-mail: <dsreekum@usc.edu>
(If needed, the grader will hold office hours the week after the announcement of each assignment's grades.)
Midterm Exam during class time, Wed, 10/30/2019 (firm) during class time, Wed, 10/30/2019 (firm) during class time, Thu, 10/31/2019 (firm)
Final Exam 8am-10am, Mon, 12/16/2019 (firm). 11am-1pm, Fri, 12/13/2019 (firm). 11am-1pm, Thu, 12/12/2019 (firm).
Class Resources
Description   :   textbooks, topics covered, grading policies, additional resources, etc.
Lectures   :   information about lectures (and lectures slides in PDF format).
Videos   :   information about DEN lectures and discussion sections videos.
Discussions   :   information about discussion sections.
Projects   :   programming assignments (please also see important information about the class projects below.)
Participation   :   how to earn extra credit for class participation.
Forum   :   Google Group online forum for discussing course materials and programming assignments. All important announcements will be made using this online forum. Therefore, you are required to be a member of this group. (This group is by invitation only and you need to make sure that you are a member.) Please do not send request to join this group until after Lecture 1.
(in reversed chronological order)
  • 12/4/2019: The final exam will be closed book, closed notes, and closed everything (and no "cheat sheet"). Also, no calculators, cell phones, or any electronic gadgets are allowed. Please bring a photo ID. Your ID will be collected at the beginning of the exam and will be returned to you when you turn in your exam. Please only go to the exam for the section you are registered. Also, no matter how late you show up for the exam, your exam must end at the same time as everyone else in your section. There will be assigned seating.

    The final exam will cover everything from slide 31 of Lecture 13 to slide 43 of Lecture 15 PLUS from slide 37 of Lecture 17 to the last slide of Lecture 30.

    Since the 2nd part of the course depends on stuff covered by the midterm, I cannot say that I will not ask anything covered by the midterm and you do need to know the material covered by the midterm. Therefore, it would be more appropriate to say that the final exam will focus on the material not covered by the midterm.

    Regarding what types of questions will be on the exam, please see the Exams section of the course description web page. Regarding regrade policy, please see the Regrade section of the course description web page.

    Please note that if you are asked to run the Stride Scheduling algorithm, to get any credit, you must run the algorithm described in Lecture 29 (and not the one in the textbook).

    Here is a quick summary of the final exam topics (not all topics covered may be listed):

    • Ch 3 - Basic Concepts
      • shared libraries
    • Ch 4 - Operating-System Design
      • devices
      • virtual machines, microkernels
    • Ch 5 - Processor Management
      • threads implementations
      • interrupts
      • scheduling
    • Ch 6 - File Systems
      • the basics of file systems
      • performance improvements
      • crash resiliency
      • directories and naming
      • RAID, flash memory, case studies
    • Ch 7 - Memory Management
      • virtual memory
      • OS issues
    • Kernel assignments 2 & 3
      • spec
      • FAQ
      • my posts to class Google Group

  • 12/3/2019:
    • The CP is not available this Thursday (12/5/2019) and Friday(12/6/2019) . Therefore, the helpdesk hours this Thursday and Friday are canceled.
  • 11/24/2019:
    • Below is the grade normalization information for kernel2. Please note that this only applies to the grader-dependent part of your grade. If you are graded by Parth Kapadia <pkapadia@usc.edu>, his kernel2 average was 90.87 with a standard deviation of 9.90. If you are graded by Deepa Sreekumar <dsreekum@usc.edu>, her kernel2 average was 92.45 with a standard deviation of 12.31. The overall class average for kernel2 was 91.59 with a standard deviation of 11.09.

      To figure out your normalized score for kernel2, here's what you can do. If your grader-dependent part of your grade is X and your grader's average is A with a standard deviation of D, then Y=(X-A)/D is the number of standard deviations away your score is from your grader's average. Therefore, your normalized grader-dependent part of your grade would be 91.59+Y*11.09 (i.e., same number of standard deviation away from the overall class average). Your minimum score is still one point if you have submitted something for grading.

      As I have mentioned in Lecture 1, although we assume that we have a bell-shaped curve, when your score is normalized, linear interpolation is used. It's clearly not perfect since the actual curve will never be bell-shaped and linear interpolation is not the same as bell-shaped-curve interpolation. But this is what was announced at the beginning of the semester, and therefore, we will stick to this particular way of normailzation for all the programming assignments for the rest of the semester, knowing that it's not perfect.


  • 11/14/2019:
    • The CP is holding helpdesk hours in SAL 109D today.
  • 11/5/2019:
    • The CP is holding helpdesk hours in SAL 109C today.
  • 11/4/2019:
    • Below is the grade normalization information for kernel1. Please note that this only applies to the grader-dependent part of your grade. If you are graded by Parth Kapadia <pkapadia@usc.edu>, his kernel1 average was 88.37 with a standard deviation of 10.30. If you are graded by Deepa Sreekumar <dsreekum@usc.edu>, her kernel1 average was 88.96 with a standard deviation of 6.48. The overall class average for kernel1 was 88.68 with a standard deviation of 8.52.

      To figure out your normalized score for kernel1, here's what you can do. If your grader-dependent part of your grade is X and your grader's average is A with a standard deviation of D, then Y=(X-A)/D is the number of standard deviations away your score is from your grader's average. Therefore, your normalized grader-dependent part of your grade would be 88.68+Y*8.52 (i.e., same number of standard deviation away from the overall class average). Your minimum score is still one point if you have submitted something for grading.

      As I have mentioned in Lecture 1, although we assume that we have a bell-shaped curve, when your score is normalized, linear interpolation is used. It's clearly not perfect since the actual curve will never be bell-shaped and linear interpolation is not the same as bell-shaped-curve interpolation. But this is what was announced at the beginning of the semester, and therefore, we will stick to this particular way of normailzation for all the programming assignments for the rest of the semester, knowing that it's not perfect.


  • 10/31/2019:
    • The CP is holding helpdesk hours in SAL 109L today.
  • 10/30/2019:
    • I'm cutting my office hour short tomorrow (Thursday) so I can go record a make-up lecture. It will go from 11am to 11:45am. Sorry about the inconvenience.
  • 10/29/2019:
    • The CP will hold a make-up helpdesk hours tomorrow (Thursday) from 3:00pm to 5:30pm in SAL 125 (if there will be a location change, I will update it here).
  • 10/28/2019:
    • The CP's helpdesk hours tomorrow (Tuesday) will go from 2:30pm to 6pm in SAL 125 (if there will be a location change, I will update it here).
  • 10/28/2019:
    • A big fire broke out last night on the west side of LA. I will stay home today in case we have to evacuate. So, I'm canceling all lectures today and tomorrow. Sorry about the short notice.

      Since we are one lecture ahead of schedule this semester, we can simply shift the lecture schedule back to normal. I will have to record a lecture another time to make up for the missing lecture for Thanksgiving.


  • 10/22/2019:
    • The Course Producer's helpdesk hours this Thursday and Friday (10/24 & 10/25) are canceled. He will make up the hours next week. Sorry about the inconvenience. I will hold an extra office hour this Friday from 11am to 12pm.

  • 10/21/2019:
    • I'm moving my office hour this Thursday (10/24/2019) from 11am-noon to 3pm-4pm. Sorry about the inconvenience.

  • 10/20/2019:
    • Below is the grade normalization information for warmup2. Please note that this only applies to the grader-dependent part of your grade. If you are graded by Parth Kapadia <pkapadia@usc.edu>, his warmup2 average was 79.76 with a standard deviation of 26.80. If you are graded by Deepa Sreekumar <dsreekum@usc.edu>, her warmup2 average was 71.60 with a standard deviation of 33.93. The overall class average for warmup2 was 75.18 with a standard deviation of 30.92.

      To figure out your normalized score for warmup2, here's what you can do. If your grader-dependent part of your grade is X and your grader's average is A with a standard deviation of D, then Y=(X-A)/D is the number of standard deviations away your score is from your grader's average. Therefore, your normalized grader-dependent part of your grade would be 75.18+Y*30.92 (i.e., same number of standard deviation away from the overall class average). Your minimum score is still one point if you have submitted something for grading.

      As I have mentioned in Lecture 1, although we assume that we have a bell-shaped curve, when your score is normalized, linear interpolation is used. It's clearly not perfect since the actual curve will never be bell-shaped and linear interpolation is not the same as bell-shaped-curve interpolation. But this is what was announced at the beginning of the semester, and therefore, we will stick to this particular way of normailzation for all the programming assignments for the rest of the semester, knowing that it's not perfect.


  • 10/16/2019:  The midterm exam will be closed book, closed notes, and closed everything (and no "cheat sheet"). Also, no calculators, cell phones, or any electronic gadgets are allowed. Please bring a photo ID. Your ID will be collected at the beginning of the exam and will be returned to you when you turn in your exam. Please only go to the exam for the section in which you are registered. Also, no matter how late you show up for the exam, your exam must end at the same time as everyone else in your section. There will be assigned seating.

    The midterm exam will cover everything from the beginning of the semester to slide 22 of Lecture 17 on 10/16,17/2019, MINUS Chapter 5 (i.e., material in Ch 5 is excluded from the midterm).

    Regarding what types of questions will be on the midterm, please see the Exams section of the course description web page and slides 26 through 36 of Lecture 17 on 10/16,17/2019. Regarding regrade policy, please see the Regrade section of the course description web page.

    Here is a quick summary of the midterm exam topics (not all topics covered may be listed):

    • Ch 1 - Introduction
      • introduction
      • a simple OS
      • files
    • Ch 2 - Multithreaded Programming
      • thread creation, termination
      • thread synchronization
      • thread safety, deviations
    • Ch 3 - Basic Concepts
      • context switching, I/O
      • dynamic storage allocation
      • static linking and loading
      • booting
    • Ch 4 - Operating-System Design
      • a simple system
      • storage management
    • Warmup assignments 1 & 2
      • specs
      • FAQs
      • my posts to class Google Group
    • Kernel assignment 1
      • spec
      • FAQ
      • my posts to class Google Group

    Please note that kernel 1 is included in the midterm coverage but Chaper 5 is not. This mean that I can ask weenix-specific questions.


  • 10/16/2019:
    • Please read the message I posted in the class Google group about the cancellation of the PM section lecture today and that I'm holding office hour starting at 11:30am today for at least half an hour. If no student is waiting to see me at noon, I will leave campus. Everyone will get rollsheet signing credit for today and tomorrow's lectures. Sorry about the short notice and inconvenience.

  • 10/15/2019:
    • Since some students missed the CP's helpdesk hours today because they couldn't find him, he will have an extra helpdesk hour tomorrow (Wednesday) from 3pm to 5pm. If he moves location, he will post to the class Google group. (Please also note that during the Fall recess, there will be no lectures, no discussion sections, no office hours, and no helpdesk hours.)
  • 10/15/2019:
    • I'm very sorry that I have to cancel office hour (but not lecture) today because I need to go to a doctor's appointment. Sorry about the short notice and inconvenience.

  • 9/25/2019:
    • The CP's helpdesk hours tomorrow (Thursday, 9/26) has been moved to 6-8pm (originally 1-3pm).

  • 9/22/2019:
    • Below is the grade normalization information for warmup1. Please note that this only applies to the grader-dependent part of your grade. If you are graded by Parth Kapadia <pkapadia@usc.edu>, his warmup1 average was 84.63 with a standard deviation of 24.36. If you are graded by Deepa Sreekumar <dsreekum@usc.edu>, her warmup1 average was 90.32 with a standard deviation of 16.92. The overall class average for warmup1 was 87.48 with a standard deviation of 21.17.

      To figure out your normalized score for warmup1, here's what you can do. If your grader-dependent part of your grade is X and your grader's average is A with a standard deviation of D, then Y=(X-A)/D is the number of standard deviations away your score is from your grader's average. Therefore, your normalized grader-dependent part of your grade would be 87.48+Y*21.17 (i.e., same number of standard deviation away from the overall class average). Your minimum score is still one point if you have submitted something for grading.

      As I have mentioned in Lecture 1, although we assume that we have a bell-shaped curve, when your score is normalized, linear interpolation is used. It's clearly not perfect since the actual curve will never be bell-shaped and linear interpolation is not the same as bell-shaped-curve interpolation. But this is what was announced at the beginning of the semester, and therefore, we will stick to this particular way of normailzation for all the programming assignments for the rest of the semester, knowing that it's not perfect.


  • 8/6/2019:
    • Watch this area for important announcements.

    • To get user ID and password for accessing protected area of this web site, please visit the request access page after semester starts and submit the requested information. (You do not have to be registered for the course to get the password. You just need to have an USC e-mail address.)

    • Please do not send request to join the class Google Group until after the Lecture 1.
In the official syllabus, it is listed that the prerequisites are:
(CSCI 201L or CSCI 455x) and (EE 357 or EE 352L)

Please see:

Apparently, they are the prerequisites for undergraduate students only. The CS department would waive these prerequisites for graduate students. Since undergraduate students are required to take CS 350 for OS credit, there should only be graduate students enrolled in CS 402. Therefore, these prerequisites are really not prerequisites. They should be considered recommended preparation for graduate students. The basic idea behind these prerequisites is that you are expected to know how to program and you are expected to know something about computer architecture (such as what the CPU does).
 
The programming assignments of this class will be very demanding. You will be required to write C code. Since C is a proper subset of C++, knowing C++ well would give you enough background. However, some of the things that available in C++, such as strings and streams, are not be available in C. So, you need to know how to do things such as manipulating null-terminated array of characters (using functions such as strchr, strrchr, strlen, strcmp, strncpy, etc.) and performing console and file I/O (using functions such as printf/snprintf, fread/fwrite, read/write, fgets, etc.) in C. No other programming language will be accepted. We will not teach C in this class. You are expected to pick up C on your own if you are not familiar with it.

You should also get familiar with the Unix development environment (vi/pico/emacs, cc/gcc, make, etc.) You are expected to know how to use Unix. If you are not familiar with Unix, please read Unix for the Beginning Mage, a tutorial written by Joe Topjian. You can also visit UNIX Tutorial for Beginners or Learn tcsh in Y Minutes. If you knew how to use Unix/Linux before and just need a refresher, please review a summary of some commonly used Unix commands.

The kernel programming assignments must run on 32-bit Ubuntu 16.04. Therefore, you should install a 32-bit Ubuntu 16.04 on your laptop or desktop as soon as possible. If you do not have a personal laptop or desktop that runs Windows or Mac OS X, please contact the instructor as soon as possible. If you are considering buying a laptop, please buy a laptop that runs Windows or Mac OS X.

These days, I have been using VagrantBox (i.e., Vagrant with Virtualbox) to install and run Ubuntu 16.04. I think it has a better integration with Windows 10 than other systems. The down side is that it does not have a desktop environment. If you would prefer to run Ubuntu Linux without a desktop, You can install Vagrant on your laptop/desktop.

If a student registered late for this class or could not be present at the beginning of the semester, the student is still required to turn all projects and homeworks on time or the student will receive a score of 0 for these assignments. No exceptions!