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) AM Section (30331D) PM Section (29971D)
Time MW 9:30am - 10:50am  TT 9:30am - 10:50am  TT 12:30pm - 1:50pm 
Location OHE 100D  GFS 116  SLH 102 
TA Ben Yan, E-mail: <wumoyan@usc.edu>
Office Hours: Wed 3:30pm - 5:30pm on Zoom
Zhuojin Li, E-mail: <zhuojinl@usc.edu>
Office Hours: Thu 3:00pm - 5:00pm on Zoom
(TBD)
Helpdesk
Chang Xu, E-mail: <cxu925@usc.edu>, Tue 3:00pm-5:00pm, Fri 1:00pm-5:00pm on Zoom
Mahikanth Nag Yalamarthi, E-mail: <yalamart@usc.edu>, Mon 4:00pm-6:00pm, Wed 11:00am-1:00pm on Zoom
Graders
Xinwei Li, E-mail: <xinweil@usc.edu>
Mahikanth Nag Yalamarthi, E-mail: <yalamart@usc.edu>
Sai Ramtirth, E-mail: <ramtirth@usc.edu>
(If needed, the grader will hold office hours the week after the announcement of each assignment's grades.)
Midterm Exam 4pm-4:40pm, Thu, 3/26/2020 (firm) 4pm-4:40pm, Thu, 3/26/2020 (firm) 4pm-4:40pm, Thu, 3/26/2020 (firm)
Final Exam (NEW) 9am-9:40am, Fri, 5/8/2020 (firm). (NEW) 9am-9:40am, Tue, 5/12/2020 (firm). (NEW) 3pm-3:40pm, Wed, 5/13/2020 (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)
  • 5/10/2020:
    • Below is the grade normalization information for kernel3. Please note that this only applies to the grader-dependent part of your grade. If you are graded by Xinwei Li <xinweil@usc.edu>, her kernel3 average was 86.10 with a standard deviation of 23.84. If you are graded by Mahikanth Nag Yalamarthi <yalamart@usc.edu>, his kernel3 average was 95.10 with a standard deviation of 7.37. If you are graded by Sai Ramtirth <ramtirth@usc.edu>, her kernel3 average was 93.20 with a standard deviation of 17.69. The overall class average for kernel3 was 91.48 with a standard deviation of 17.83.

      To figure out your normalized score for kernel3, 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.48+Y*17.83 (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.


  • 5/9/2020:
    • Just want to clarify about deadlines for final exam submissions.  Firstly, this is what I have said before:
         (1) You are not supposed to submit late for final exams!
         (2) (1) above may be too harsh, so, you won't be penalized if you are one or two minutes late.
      But how come you were allowed to submit the midterm exam later?  It's because it was the midterm exam and the final exam is NOT the midterm exam!

      What if you submit your final exam more than 2 minutes late?  Well, you get a zero!

      Okay, that may be too harsh, and I would agree.  So, the new rule is that for each minute afterwards, I will deduct 5%.

      Let's say that the original submission deadline is X:40:00 (X depends on which section you are in). Because of (2) above, if you submit before X:42:00, there is no penalty. Afterwards, if you submit before X:43:00, I will deduct 5%; if you submit before X:44:00, I will deduct 10%; if you submit before X:45:00, I will deduct 15%, and so on.

      As I have mentioned previously, as soon as you finish one pass of the final exam, you should make a submission. If you make changes to your answers, you should make additional submissions. By default, we will grade your final submission and apply the rules above.

      Why have such strict rules? Because I need to be fair. There are students who think that they can submit any time they want and I have to accept their submissions without penalty. That's just not fair to other students!

      If this is not clear, please send me e-mail now to make sure you understand the rules.


  • 4/29/2020: 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. No matter how late you start your exam, your exam must end at the same time as everyone else in your section. So, please make sure that you are ready and available during the scheduled exam time indicated at the top of this web page.

    The final exam will cover everything from slide 45 of Lecture 13 to slide 44 of Lecture 15 PLUS from slide 33 of Lecture 17 to the last slide of Lecture 30. Also included are discussion section slides from Week 9 through Week 13.

    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
      • scheduler activations model
      • 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


  • 4/21/2020:
    • 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 Xinwei Li <xinweil@usc.edu>, her kernel2 average was 92.19 with a standard deviation of 9.79. If you are graded by Mahikanth Nag Yalamarthi <yalamart@usc.edu>, his kernel2 average was 95.87 with a standard deviation of 4.71. If you are graded by Sai Ramtirth <ramtirth@usc.edu>, her kernel2 average was 95.24 with a standard deviation of 11.61. The overall class average for kernel2 was 94.68 with a standard deviation of 9.24.

      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 94.68+Y*9.24 (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.


  • 4/20/2020:
    • 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 Xinwei Li <xinweil@usc.edu>, her kernel1 average was 92.79 with a standard deviation of 6.59. If you are graded by Mahikanth Nag Yalamarthi <yalamart@usc.edu>, his kernel1 average was 92.59 with a standard deviation of 7.63. If you are graded by Sai Ramtirth <ramtirth@usc.edu>, her kernel1 average was 96.83 with a standard deviation of 3.80. The overall class average for kernel1 was 94.14 with a standard deviation of 6.41.

      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 94.14+Y*6.41 (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.





  • 3/30/2020:
    • I don't know why I thought that today's lecture video is Lecture 22! This lecture is Lecture 21. Sorry about the mistake.


  • 3/27/2020:
    • Today's discussion video has been posted on D2L. Zoom has not finished creating an audio transcript for this video yet. Zoom has been slow recently. Maybe they are a little overwhelmed. I will post it as soon as it becomes available.

  • 3/23/2020:
    • There will be a midterm exam rehearsal on Tuesday, 3/24/2020 at 4pm. I will e-mail your a fake midterm exam to you at 4pm if you have submit a signed academic integrity honor code pledge.

  • 3/21/2020:
    • Please participate in the mock midterm exam between now and the end of next Monday (3/23/2020). The exam is fake, but I need you to submit your academic integrity honor code pledge before I can give you your real midterm! Please read the pledge carefully before you sign it!

      At this time, I'm planning on having the midterm exam on Thursday, 3/26/2020, from 4pm to 4:40pm and this will be a common exam for all 3 sections of CS 402. If you are not available to take the exam this coming Thursday at 4-4:40pm, please let me know NOW. If that's the case, please let me know WHY you cannot take the exam at that time and also let me know when you can take the exam LATER on that day (or if that's not possible, let me know why, and when you can take the exam).



  • 3/12/2020:
    • This Friday's 11am to 12:50pm discussion sections will be held online by Zhuojin Li on Zoom (information removed for security concerns, please check class Google Group message archive).

  • 3/11/2020:
    • 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 Xinwei Li <xinweil@usc.edu>, her warmup2 average was 82.17 with a standard deviation of 21.90. If you are graded by Mahikanth Nag Yalamarthi <yalamart@usc.edu>, his warmup2 average was 87.09 with a standard deviation of 19.60. If you are graded by Sai Ramtirth <ramtirth@usc.edu>, her warmup2 average was 88.48 with a standard deviation of 22.13. The overall class average for warmup2 was 85.93 with a standard deviation of 21.42.

      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 85.93+Y*21.42 (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.


  • 3/10/2020:
    • This Friday's helpdesk hour for Chang Xu will be hosted on Zoom (information removed for security concerns, please check class Google Group message archive).
    • This Thursday's office hour for Zhuojin Li will be hosted on Zoom (information removed for security concerns, please check class Google Group message archive).
    • This Wednesday's office hour for Ben Yan will be hosted on Zoom (information removed for security concerns, please check class Google Group message archive).

  • 3/10/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 32 of Lecture 17 on 3/9,10/2020, MINUS Chapter 5 (i.e., material in Ch 5 is excluded from the midterm). Also included are discussion section slides from Week 1 through Week 8, excluding stuff about kernel 2.

    Regarding what types of questions will be on the midterm, please see the Exams section of the course description web page and slides 22 through 32 of Lecture 17 on 3/9,10/2020. 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.


  • 3/9/2020:
    • Tomorrow, I need to get ready to move the lecture and discussion section online for this Wednesday and Friday. I will be doing Zoom and Blackboard training and need to learn and practice how to record my own lecture videos. Therefore, I'm canceling tomorrow's AM and PM sections lectures and office hour. Please watch the DEN lecture video recorded on Monday. Sorry about the inconvenience.

  • 3/5/2020:
    • Due to a household emergency, office hour and AM and PM lectures today are canceled. Luckily, everyone can just watch the lecture recorded yesterday. I will have a makeup office hour tomorrow from 11am to noon. Sorry about the inconvenience and the short notice.

  • 2/10/2020:
    • 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 Xinwei Li <xinweil@usc.edu>, her warmup1 average was 89.35 with a standard deviation of 17.72. If you are graded by Mahikanth Nag Yalamarthi <yalamart@usc.edu>, his warmup1 average was 92.41 with a standard deviation of 19.69. If you are graded by Sai Ramtirth <ramtirth@usc.edu>, her warmup1 average was 92.11 with a standard deviation of 18.63. The overall class average for warmup1 was 91.29 with a standard deviation of 18.75.

      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 91.29+Y*18.75 (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.


  • 1/30/2020:
    • Due to car trouble, office hour and AM and PM lectures today are canceled. Sorry about the inconvenience and the short notice.

  • 1/28/2020:
    • Due to concerns about the coronavirus, office hour and AM and PM sections lectures today are canceled. Please watch the DEN section lecture video. Sorry about the inconvenience and the short notice.
    • Due to concerns about the coronavirus, everyone will get all the roll sheet signing credit this semester for free.

  • 1/21/2020:
    • Due to urgent family matters, office hour and AM and PM sections lectures today are canceled. Please watch the lecture video I recorded for the university holiday yesterday (Lecture 3). Sorry about the inconvenience and the short notice.

  • 1/18/2020:
    • Make-up lecture video has been posted in D2L to make up for the missing DEN lecture on next Monday. For DEN sections students (both local & remote), please watch this make-up video before Wednesday's class.

  • 1/16/2020:
    • Since we don't have TAs for 11am and 12pm discussion sections, tomorrow's 11am and 12pm discussion sections are canceled.

  • 1/12/2020:
    • 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!