Click here to see a PREVIEW of important rules that was posted before the summer session 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.)
Time TuTh 9:30am - 11:30am 
Location Online 
TA #1 Ben Yan, E-mail: <wumoyan@usc.edu>
Office Hours: Wed 9:00am - 11:00am on Zoom
TA #2 Zhuojin Li, E-mail: <zhuojinl@usc.edu>
Office Hours: Tue 4:00pm - 6:00pm on Zoom
Grader (TBD)
Midterm Exam during class, 9:30am-11:30am, Tue, 7/6/2021 (firm).
Final Exam (NEW) 10am-10:40am, Tue, 8/3/2021 (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/D2L 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. You are required to be a member of this group. (This group is initially by invitation only.) Please do not send request to join this group until after the first lecture.
(in reversed chronological order)
  • 8/2/2021: I posted a message to the class Google Group on 7/13/2021 with the subject line of "Chrome browser is changing http:// to https:// automatically!". This may have serious implication when you will be using your brower to download and submit the final exam! So, if you are using the Chrome browser primarily, you may want to get another browser ready just in case you will have trouble submitting your final exam. You can try submitting a fake warmup1 (I don't download it) just to test out your browser. If Chrome is your only browser, plesae follow the steps below to set it up to disable this new Chrome feature.

    Start a new tab in your Chrome browser and enter "chrome://net-internals/#hsts" in the web address / URL area and scroll all the way to the bottom. The last entry is "Delete domain security policies". Enter "usc.edu" in the text box labeled "Domain:" and click on the Delete button to the right of it.

  • 7/28/2021: 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 6/29/2021 news item for the procedure). No matter how late you start your exam, your exam must end at the same time as everyone else. Please pay special attention to the paragraph labeled "VERY IMPORTANT".

    The final exam will cover everything from the beginning of Lecture 9 to slide 53 of the 2nd part of Lecture 10, PLUS, from the beginning of the 3rd part of Lecture 11 to the last slide of Lecture 20. Also included are discussion section materials from Week 7 through Week 10.

    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 20 (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
      • discussion section slides
      • spec
      • FAQ
      • my posts to class Google Group

  • 7/27/2021:
    • Please download, fill out, sign, and submit the Final Exam Academic Integrity Honor Code Pledge as soon as possible. Please understand that if I don't get a signed pledge from you, I will not send a final exam to you next Tuesday because I need you to promise me that you won't cheat before I can send you a final exam.

  • 7/1/2021:
    • Please download, fill out, sign, and submit the Midterm Exam Academic Integrity Honor Code Pledge as soon as possible. Please understand that if I don't get a signed pledge from you, I will not send a midterm exam to you next Tuesday (and your final exam will account for 50% of your overall grade) because I need you to promise me that you won't cheat before I can send you a midterm exam. (Please also understand that submitting in a signed pledge is not a promise that you will take the midterm exam! You can still opt out of the midterm exam later.)

  • 6/29/2021: Midterm rehearsal is [BC: updated 6/30/2021] Friday, 7/2/2021 at 10am, USC time. Here is the instructions for the midterm rehearsal (this will also be the instructions for your midterm exam). I have gone over all the information below during live Lecture 12 on 6/29/2021.

    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 = 10). 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., up to but not including the right timestamp). If your exam 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.
      • Display a clock app and a web browser as shown.
      • Start the Panopto Recorder just in case you may lose Internet connection later. Make sure Panopto is configured correctly (see the Checklist). Don't start recording your desktop yet. If you have an offline desktop recorder that can record your desktop into an MP4 file, you can use that instead of the Panopto Recorder.
      • Have your submission PIN handy because you will need it later. (Your submission PIN is the same for all programming assignments and exams.)
      • Set an alarm for X:39:00 to remind yourself that the exam is about to end soon (and make sure the time on your alarm clock is correct).

    • 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 (PDF file) and an answers text file. Click on it to download the ZIP file and then open it. (With some browsers, you will have to copy the link and paste it into a new browser tab in order for download to be successful.) Save the answers text file on your desktop for easy access (don't make a copy of it, just work on this copy so you won't end up submitting the wrong file).
      • 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. It's not a good idea to work on a copy of the answers text file because you may end up submitting the wrong answers text file and there's nothing I can do if that happens!

    • 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 should check to see if you can reach other websites. If you cannot reach other websites, then you don't have a Internet connection and you must follow the instructions to use Panopto to record your desktop and your exam answers and take photos of your answers and e-mail photos of your exam answers to me. If you can reach other websites, then you should continue to try to access the submission web page.

      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.

      If you cannot reach the submission server after many tries, 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 mentioned 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. It's best if you also follow the instructions to use Panopto to record your desktop and your exam answers and take photos of your answers and e-mail photos of your exam answers to me. (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 and maybe you will be able to connection to the submission server this time around.

      The current bullet is summarized in the flowchart below.

    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 exam answers during the real exam. Also, try out different scenarios such as disabling wifi on your laptop to simulate the loss of Internet connectivity so you know what to expect.

    Please understand that if you submit late (i.e., any time at or after X:43:00), I have to follow the rules I mentioned in class and deduct 5% for every late minute. For example:

    • If your submission timestamp is ≥ X:43:00 and ≤ X:43:59, 5% will be deducted.
    • If your submission timestamp is ≥ X:44:00 and ≤ X:44:59, 10% will be deducted.
    • If your submission timestamp is ≥ X:45:00 and ≤ X:45:59, 15% will be deducted.
    • If your submission timestamp is ≥ X:46:00 and ≤ X:46:59, 20% will be deducted.
    • ...

    I cannot make an exception. If you are not familiar with all the rules, please watch the recorded live Lecture 12 video.

    VERY IMPORTANT: Please understand that I cannot accept "my machine crashed when I was making a submission" as an excuse for late submission. If you know that your machine is prone to crashing or random rebooting (only you would know that), you should do a complete shutdown of your machine and reboot your machine into a clean state before the start of the exam and don't run anything on your machine other than what's required to take the exam. (It's a good idea to do that even if your machine is not prone to random crashes or reboots.)  And most importantly, when you have finished your first pass through the exam, make a submission right away! Then every time you make a change in your answers, make another submission. Remember, you can make as many submissions as you'd like and by default, we will grade your last submission. If you are still working on your first pass at X:40:00, you must stop working on your exam and make a submission immediately! After you have made an on-time submission, you can continue to work on your exam and if you make changes, make another submission. This way, you can avoid late penalty because you would always have a submission that was on time. If you are not familiar with the procedure of making an exam submission, you should practice by going through the midterm exam rehearsal procedure as many times as you'd like. If you have lost the midterm rehearsal link, please send me e-mail.

    If anything is not clear, please feel free to ask me.


  • 6/24/2021:  The midterm exam will be a 40-minute long take-home exam (open book and open notes) at 10am-10:40am, on Tue, 7/6/2021 (USC time). As I have mentioned in today's live lecture, if you are participating from a time zone in Asia, you can choose to take an alternate midterm at 7pm-7:40pm on the same day (USC time). What's important now is to make sure that your "local address" information in the OASIS system correctly reflects where you are physically. So, please do that as soon as possible. Next Tuesday, I will send e-mails to students who are participating from a time zone in Asia to ask you to tell me which midterm exam you would prefer to take. If your "local address" information in OASIS is incorrect and it ends up that you are not offered to take the alternate midterm exam, you will have to take the regular midterm exam at 10am-10:40am. Finally, you can opt out of the midterm exam and have your final exam account for 50% of your overall grade. If you choose that option, you just need to send me an e-mail to let me know and make sure you get a confirmation e-mail from me.

    The midterm exam will cover everything from the beginning of the semester to slide 21 of Part 2 of Lecture 11 on 6/24/2021, MINUS Chapter 5 (i.e., all material in Ch 5 is excluded from the midterm, meaning all the slides in Lecture 9, all the slides in Part 1 of Lecture 10, and slides 40 through 53 of Part 2 of Lecture 10). Also included in the midterm coverage 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.

    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.


  • 6/14/2021:
    • Zhuojin Li's office hour tomorrow (Tue, 6/15, 4-6pm) is moved earlier to 11:30am-1:30pm. Sorry about the inconvenience and short notice.

  • 6/9/2021:
    • My office hour tomorrow is moved to 7:00-8:00pm. Sorry about the inconvenience and short notice.

  • 5/31/2021:
    • My office hour tomorrow is moved to 3:30-4:30pm. I will also add an office hour this week on Wed, 6/2/20201, 1:00-2:00pm. Sorry about the inconvenience and short notice.

  • 5/24/2021:
    • Please participate in the D2L survey regarding final grading breakdown. Choose either to (1) keep Projects at 40% and Exams at 60%, or to (2) change to Projects at 50% and Exams at 50%. This survey will close on Thursday, 5/27/2021.

  • 5/18/2021:
    • 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 summer session 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 first lecture.
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. Unfortunately, looks like this book has just disappeared from the web. 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.

All programming assignments must run on a 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, this class would work best with an Intel-based laptop that runs Windows or Mac OS X.

If the only computer you have access to is the new Mac running on a non-Intel/AMD CPU, then it may not be possible to install VirtualBox into your machine. If that's the case, please read here.

If a student registered late for this class or could not be present at the beginning of the summer session, 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!