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 (30203D) PM Section (30243D)
Time MW 10:00am - 11:50am  TT 9:30am - 10:50am  TT 12:30pm - 1:50pm 
Location (online)  (online)  (online) 
TA Ben Yan, E-mail: <wumoyan@usc.edu>
Office Hours: Thu 7:00pm - 9:00pm on Zoom
Zhuojin Li, E-mail: <zhuojinl@usc.edu>
Office Hours: Mon 3:00pm - 5:00pm on Zoom
Zhuojin Li, E-mail: <zhuojinl@usc.edu>
Office Hours: Mon 3:00pm - 5:00pm on Zoom
Graders
Aditya Chandupatla, E-mail: <chandupa@usc.edu>
Vinitha Raj, E-mail: <vinithar@usc.edu>
(If needed, the grader will hold office hours the week after the announcement of each assignment's grades.)
Midterm Exam 11am-11:40am, Wed, 10/7/2020 (firm) 10am-10:40am, Thu, 10/8/2020 (firm) 1pm-1:40pm, Thu, 10/8/2020 (firm)
Final Exam 9am-9:40am, Mon, 11/23/2020 (firm). 9am-9:40am, Thu, 11/19/2020 (firm). 12pm-12:40pm, Thu, 11/19/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.)
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)
  • 11/21/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 Aditya Chandupatla <chandupa@usc.edu>, his kernel3 average was 92.82 with a standard deviation of 18.01. If you are graded by Vinitha Raj <vinithar@usc.edu>, her kernel3 average was 93.22 with a standard deviation of 21.69. The overall class average for kernel3 was 93.02 with a standard deviation of 19.92.

      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 93.02+Y*19.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.


  • 11/10/2020:
    • As mentioned in at the beginning of Lecture 26 video, the following are the final exam times (date and time below are date and time at USC):

      • AM section: 9am-9:40am, Thu, 11/19/2020
      • PM section: 12pm-12:40pm, Thu, 11/19/2020
      • DEN section: 9am-9:40am, Mon, 11/23/2020
      • Asia time zone: 7pm-7:40pm, Mon, 11/23/2020

      If you are not physically in Asia, you have to take the final exam with your classmates.

      If you are physically in Asia, you can choose to either take the final exam with your classmates or take the final exam in the Asia time zone (and in this case, you need to let me know which option you choose). If you choose to take the final exam in the Asia time zone, you are implicitly agreeing to trust me to be fair to convert your exam grades to a grade that's compatible with the exams your classmates took.

    • You are required to sign and submit an Academic Integrity Honor Code Pledge (click here) where you will promise that you will work on the exam alone and you will only work on the exam during the assigned exam time.

  • 11/9/2020: The final exam will be a 40-minute long take-home exam (open book and open notes), and it will be conducted in the same manner as the midterm exam (please see the 10/5/2020 news item for the procedure).

    The final exam will cover everything from slide 34 of Lecture 9 to slide 53 of Lecture 11 PLUS from slide 43 of Lecture 13 to the last slide of Lecture 26. Also included are discussion section materials from Week 7 through Week 12.

    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 25 (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 implementation strategies
      • 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

  • 11/1/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 Aditya Chandupatla <chandupa@usc.edu>, his kernel2 average was 95.55 with a standard deviation of 6.04. If you are graded by Vinitha Raj <vinithar@usc.edu>, her kernel2 average was 99.52 with a standard deviation of 1.51. The overall class average for kernel2 was 97.55 with a standard deviation of 4.81.

      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 97.55+Y*4.81 (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/13/2020:
    • I'm canceling the live lectures and office hour this Thursday (10/15/2020) because my home has a scheduled power outage from 8am to 4pm. Please feel free to join the live DEN lecture on Wednesday (10/14/2020) if you have questions. I apologize for the inconvenience.

  • 10/12/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 Aditya Chandupatla <chandupa@usc.edu>, his kernel1 average was 93.82 with a standard deviation of 8.25. If you are graded by Vinitha Raj <vinithar@usc.edu>, her kernel1 average was 97.44 with a standard deviation of 3.14. The overall class average for kernel1 was 95.68 with a standard deviation of 6.44.

      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 95.68+Y*6.44 (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/10/2020:
    • Someone asked me about the time for the final exam in a time zone in Asia. Since the AM and PM final exams are on the same day (just like the midterm), I think the extra final exam should be on the same day as the DEN section final exam and be at 7pm as well. So, I'm tentatively setting the extra final exam date and time to be 7pm on Monday, 11/23/2020.

  • 10/5/2020: Midterm rehearsal is today at 1pm (i.e., start time is 13:00:00) USC time. Here is the instructions for the midterm rehearsal (this will also be the instructions for your midterm exam if all goes well). If anything is not clear, please feel free to ask me.

    For this web page, we will use the notation that the midterm rehearsal starts at X:00:00 and ends at X:40:00 (for the midterm rehearsal, X = 13). As usual for this class, the left side of a time interval is "closed" (i.e., including the left timestamp) and the right side of a time interval is "open" (i.e., upto but not including the right timestamp). If your exam end time is different, please make adjustments accordingly.

    • Make sure you have setup an e-mail filter to never miss an e-mail from <bill.cheng@usc.edu> (and never have it go into your spam folder).

    • To get ready, please do the following 5 minutes BEFORE X:00:00.

    • Watch your inbox. You will get an e-mail from me right before X:00:00 and you can start working on the exam as soon you get my e-mail. There will be 2 links in the e-mail. The first link is for downloading a ZIP file which contains the exam questions and an answers text file. Click on it to download the ZIP file and then open it. Save a copy of the answers text file on your desktop for easy access. The second link is for submitting your answers text file when you are done. You should click on it immediately to open a new tab in your browser and look at the submission web page. Right above the submission web form, you should see the current time on the submission server. If that time does not correspond to your desktop clock app, you need to figure out how to fix your desktop clock app to sync your desktop clock with a recommended clock server for your computer.

    • If by X:00:00, you have not received my e-mail, please send me an e-mail to as soon as possible. (But please keep in mind that e-mail can take a very very long time to get delivered.)

    • Go to your desktop and click open the answers text file and work on your exam and save your modified answers text file regularly. Feel free to make submissions if you are done early.

    • When your alarm goes off at X:39:00, you need to wrap things up and get ready to submit your exam answers text file.

    • At X:40:00, you must stop working on your answers. Save your answers text file and go to the submission web page. (Of course, if you have already made a successful submission and have saved a copy of the ticket you got and you haven't changed your answers, you are done and you can stop right here.)

    • Reload/refresh the submission web page and make sure that you are seeing the current time on the submission server right above the submission web form. If reloading the web page failed, you must follow the instructions to use Panopto to record your desktop and your exam answers and e-mail photos of your exam answers to me.

    • If reloading the web page was successful, you must fill out the submission web form and click on the Choose File button and select the answers text file that you have just filled out saved. Click on the Upload button. If you get any popup messages, please read them carefully and follow the suggestions there. If the submission server is busy, you should not be surprised because many students are making submissions simultaneously. So, all you have to do is to keep submitting your answers text file repeatedly until you can make a successful submission (i.e., you are presented with a submission ticket and the ticket looks right, you should save a copy of that ticket by saving the web page you see as a PDF file). It's your responsibility that you have submitted the correct answers text file.

      [BC: paragraph added 11/18/2020]
      If you cannot reach the submission server, but still have Internet connectivity, it is possible (although unlikely) that the server is down or unresponsive. In this case, you should go to the e-mail above and click Reply, attach your answers text file, check to make sure that the e-mail recipient is either <bill.cheng@usc.edu> or <chengw@usc.edu> and click Send to send a backup copy of your answers text file, just in case the submission sever is actually down. (Of course, for the rehearsal, you probably shouldn't click Send, or you can change the recipient e-mail address to yourself and then click Send.) Then go back and continue to make a submission using the web form.

    Since this is a rehearsal, I would strongly recommand and everyone try out the procedure to use the Panopto Recorder to record your desktop and your exam answers and take photos of your exam answers (and you can e-mail the photos to yourself as a test) and try it for a few times until you feel comfortable with the procedure just in case you may lose your Internet connection when you are submitting the real exam answers this week.

  • 9/30/2020:
    • In video 2 of Lecture 13, I mentioned that you can use Zoom or your smartphone to record your screen. Come to think of it, it may not be a great idea to record your desktop with your smartphone since there are all types of smartphone and there can be many different video formats. Zoom is not an option since it won't wok if you don't have a Internet connection. D2L has a recorder called Panopto. I have just created a web page to describe how to download it, install it, and how to use it to record your desktop in case you lose Internet connection when you are submitting your exam answers. Since this is part of D2L, everyone should have access to it and it should work for everyone. So, please download it and give it a try. If there are any issues, please let me know as soon as possible. I'm planning on having our exam instructions to require that everyone uses Panopto to record your desktop.

  • 9/29/2020:
    • I lost Internet connectivity at home this morning. So, the live AM section lecture today is canceled. Sorry about the inconvenience. please watch yesterday's live DEN lecture instead.

  • 9/28/2020:  The midterm exam will be a 40-minute long take-home exam (open book and open notes). Please review slides 26 through 42 of Lecture 13 on 9/28&29/2020 regarding your exam time and all the rules about the midterm exam. You will be required to sign and submit an Academic Integrity Honor Code Pledge where you will promise that you will work on the exam alone and you will only work on the exam during the assigned exam time.

    As I have mentioned in the 9/27/2020 news item below, I made a mistake regarding the midterm exam times in the 2nd video of Lecture 13. Please see the above table for the correct midterm exam times (text in red color). For students participating from a time zone in Asia who would prefer to choose to take a different exam (and trust me to be fair in converting their grades to be compatible with the grades for their classmates), the midterm exam time will be 7pm - 7:40pm on Wed, 10/7/2020 (USC time). Please note that as usual for this class, the left side of a time interval is "closed" (i.e., including the left timestamp) and the right side of a time interval is "open" (i.e., upto but not including the right timestamp).

    The midterm exam will cover everything from the beginning of the semester to slide 22 of Lecture 13 on 9/28&29/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 6.

    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 42 of Lecture 13 on 9/28&29/2020.

    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
      • discussion section slides
      • specs
      • FAQs
      • my posts to class Google Group
    • Kernel assignment 1
      • discussion section slides
      • 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 in the midterm exam.


  • 9/27/2020: 
    • Starting around time index 16:00 of the 2nd video of Lecture 13, the midterm exam times shown on slide 33 in the video are WRONG. The posted slide 33 of Lecture 13 have been corrected to show the correct midterm exam times. Please see the above table for the correct midterm exam times (text in red color). For students participating from a time zone in Asia who would prefer to choose to take a different exam (and trust me to be fair in converting their grades to be compatible with the grades for their classmates), the midterm exam time would be 7pm - 7:40pm on Wed, 10/7/2020 (USC time). If you have another exam at that time, please let me know (and let me know which class it is). The current time at USC is the same as the current time of the submission Bistro server. Therefore, you can click here and look right above the warmup1 submission web form to see the current time at USC.

  • 9/26/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 Aditya Chandupatla <chandupa@usc.edu>, his warmup2 average was 87.74 with a standard deviation of 24.31. If you are graded by Vinitha Raj <vinithar@usc.edu>, her warmup2 average was 80.97 with a standard deviation of 33.96. The overall class average for warmup2 was 84.39 with a standard deviation of 29.68.

      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 84.39+Y*29.68 (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.


  • 9/6/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 Aditya Chandupatla <chandupa@usc.edu>, his warmup1 average was 88.70 with a standard deviation of 20.90. If you are graded by Vinitha Raj <vinithar@usc.edu>, her warmup1 average was 88.68 with a standard deviation of 20.47. The overall class average for warmup1 was 88.69 with a standard deviation of 20.70.

      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 88.69+Y*20.70 (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/31/2020:
    • I have to cancel tomorrow's office hour (9/1/2020) because I have to be at a meeting. Sorry about the inconvenience. If you have questions about warmup2, please send me e-mail.

  • 8/25/2020:
    • I have always known that Android runs on top of the Linux operating system, but I have never "seen" that Linux system until today! You can download an Android app called Termux from the Google App Store. If you install it and run it on your Android phone, you can get a "bash" shell and it looks just like the Ubuntu Terminal program (without the fancy graphical user interface)! Try a few Linux commands (e.g., "ls -a", "ps", "pwd", "whoami", "cat .bash_history"). They all work!

  • 8/20/2020:
    • When you log into D2L and try to access a lecture video, if you get an error message saying, "You do not have access to this session", here's the solution posted on the D2L web site today.
      Encounteirng Panopto Video Error: You do not have access to view this session

      [ Posted Aug 20, 2020 10:40 AM to USC Viterbi School of Engineering ]

      Hello fall 2020 students! If you encounter this error below while attempting to stream or download a lecture video (the highlighted red box), please DO NOT select the "request access" link (because that's not the problem).

      Instead, please log out of Panopto (clicking your name, ex: the highlighted green box on the top right). Then, clear your cache, ensure cookies are permitted for Panopto/D2L, and log back in.

      If you are running any ad-blocker browser extensions, please ensure that Panopto & D2L are whitelisted.

      If the problem persists, please screenshot the error and send an email to <dentsc@usc.edu>.


  • 8/17/2020:
    • During today's live DEN section lecture, I had to admit some student manually and I didn't have time to verify if these students are registered students or even if they are USC students! Due to security concerns, I cannot do things like that in the future. Starting tomorrow, if you want to join a Zoom lecture or office hour, you must sign on to Zoom using USC SSO (i.e., just like you log into USC e-mail through the shibboleth authentication page). If you sign in that way, you will go directly to the Zoom meeting (and bypass the waiting room). If you do not sign in this way, I will not admit you into the Zoom meeting because I have no way to authenticate you during a live Zoom meeting and I cannot violate our security policy.

      Also, I changed the setup for live lectures so that students cannot join the Zoom meeting before I start the meeting. Starting with tomorrow's live lectures, I will start the Zoom meeting a couple of minutes before the scheduled start time. Therefore, you will not be able to join the meeting more than 2 minutes before the scheduled start time.


  • 8/9/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.
Some people mistakenly think that this is an introductory CS class! This class has CS prerequisites! 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 a 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/Linux development environment (vi/pico/emacs, cc/gcc, make, etc.) You are expected to know how to use Unix/Linux. If you are not familiar with Unix/Linux, 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 already know how to use Unix/Linux before and just need a refresher, please review my summary of some commonly used Unix commands and my tcsh scripting tutorial. If you knew how to use Unix/Linux before and just need a refresher, please review a summary of some commonly used Unix/Linux commands.

All programming assignments must run on 32-bit Ubuntu 16.04. The kernel programming assignments will only work on a 32-bit Ubuntu 16.04 system. Therefore, you should install a 32-bit Ubuntu 16.04 on your laptop or desktop as soon as possible and start using it right away. 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 an Intel-based laptop that runs Windows or Mac OS X.

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!