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)
Time MW 9:30am - 10:50am  TT 9:30am - 10:50am 
Location OHE 100D  SGM 123 
TA Ben Yan, E-mail: <wumoyan@usc.edu>
Office Hours: Wed 7:00pm - 9:00pm on Zoom
Zhuojin Li, E-mail: <zhuojinl@usc.edu>
Office Hours: Mon 3:00pm - 5:00pm on Zoom
Shared TA Shashank Saurabh, E-mail: <ssaurabh@usc.edu>, Office Hours: Fri 3:00pm - 5:00pm on Zoom
Graders
Vinitha Raj, E-mail: <vinithar@usc.edu>
Meggha Suresh, E-mail: <megghasu@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, 3/24/2021 (firm) during class time, Thu, 3/25/2021 (firm)
Final Exam 8am-10am, Fri, 5/7/2021 (firm). 8am-10am, Tue, 5/11/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 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)
  • 4/4/2021:
    • For students who have opt'ed out of the midterm exam, below are the midterm exam questions. I will not give answers to exams. But please feel free to have discussions about the exams in the class Google Group with other students. Neither I nor the TAs will discuss answers to exam questions. Please remember that the final exam coverage will not overlap the midterm exam coverage. If you are concerned that you will be asked the same question in the final exam and that's why you need to know the answers to the exam questions, you really don't need to worry about that.

  • 3/31/2021:
    • 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 Vinitha Raj <vinithar@usc.edu>, her kernel1 average was 96.09 with a standard deviation of 12.06. If you are graded by Meggha Suresh <megghasu@usc.edu>, her kernel1 average was 96.81 with a standard deviation of 16.07. If you are graded by Shashank Saurabh <ssaurabh@usc.edu>, his kernel1 average was 95.98 with a standard deviation of 6.00. The overall class average for kernel1 was 96.34 with a standard deviation of 12.84.

      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 96.34+Y*12.84 (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/29/2021:
    • 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 Vinitha Raj <vinithar@usc.edu>, her warmup2 average was 83.42 with a standard deviation of 27.33. If you are graded by Meggha Suresh <megghasu@usc.edu>, her warmup2 average was 90.80 with a standard deviation of 21.06. If you are graded by Shashank Saurabh <ssaurabh@usc.edu>, his warmup2 average was 88.98 with a standard deviation of 27.42. The overall class average for warmup2 was 87.45 with a standard deviation of 25.21.

      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 87.45+Y*25.21 (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/28/2021:
    • I have an appointment early during the day this coming Tuesday (3/30/2021) and I had to cancel the "live" lecture. Please watch the Monday "live" lecture instead. Sorry about the inconvenience.

  • 3/18/2021: Midterm rehearsal is Monday, 3/22/2021 at 4pm (i.e., start time is 16:00:00) USC time. Here is the instructions for the midterm rehearsal (this will also be the instructions for your midterm exam). 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 = 16). 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 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 (PDF file) and an answers text file. Click on it to download the ZIP file and then open it. (With some browsers, will you have to copy and link and paste it into a new browser tab to download.) Save a copy of the answers text file on your desktop for easy access (don't make a copy of it, just work on this copy). 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 about it!

    • 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 take photos of your 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.

      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.

    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.

    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. I cannot make an exception. If you are not familiar with all the rules, please watch the recorded live Lecture 17 and Lecture 18 videos.


  • 3/15/2021:  The midterm exam will be a 40-minute long take-home exam (open book and open notes). During live lecture this today, I have mentioned a couple of very important things. (1) If you are participating from a time zone in Asia, you need to choose whether to take the exam with your classmates or take the alternative exam at 7pm - 7:40pm on Wed, 3/24/2021 (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). I will send an e-mail to every student soon to confirm where you are participating from and you need to get back to me as soon as possible if the information in the class roster is incorrect. (2) 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. If I don't get a signed pledge from you, I will not send you a midterm and your final exam will accout for 60% of your overall semester grade.

    The midterm exam will cover everything from the beginning of the semester to slide 19 of Lecture 17 on 3/15,16/2021, MINUS Chapter 5 (i.e., material in Ch 5 is excluded from the midterm, this means slides 30 through 60 of Lecture 13, all slides in Lecture 14, and slides 4 through 53 of Lecture 15). Also included are discussion section slides from Week 1 through Week 7.

    Regarding what types of questions will be on the midterm, please see the Exams section of the course description web page and slides 3 through 16 of the live Lecture 17 (house-keeping and midterm information) slides.

    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.


  • 3/1/2021:
    • 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 Vinitha Raj <vinithar@usc.edu>, her warmup1 average was 96.47 with a standard deviation of 10.38. If you are graded by Meggha Suresh <megghasu@usc.edu>, her warmup1 average was 93.44 with a standard deviation of 16.32. If you are graded by Shashank Saurabh <ssaurabh@usc.edu>, his warmup1 average was 91.37 with a standard deviation of 18.53. The overall class average for warmup1 was 94.31 with a standard deviation of 14.79.

      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 94.31+Y*14.79 (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.


  • 2/4/2021:
    • I have a plumber coming to my house this afternoon and I may not be available. I think it's best that I move my office hour to tomorrow (Friday) at 2pm. If you need to talk to me today, please make an appointment for some time tonight. Sorry about the inconvenience.

  • 1/15/2021:
    • Someone was asking about Slack today during the information session. We use class Google Group for everything. We will not use Slack!

  • 1/1/2021:
    • Watch this area for important announcements.

    • Due to security concerns, we cannot post Zoom meeting IDs in public area of the class website. You should watch the first lecture video to get all the Zoom meeting IDs.

    • 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. 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. 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 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 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!