

Operating Systems 
CSCI 402, Summer 2018, All Sections

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.


General Information


Instructor 
Bill Cheng
(click to see office hours)
Email:
<bill.cheng@usc.edu>. (Please do not send HTMLonly emails.
They will not be read.)

 DEN Section (29915D+29917D)
 PM Section (30038D)

Time 
TT 9:30am  11:25am 
TT 12:45pm  2:40pm 
Location 
OHE 132 
KAP 144 
TAs 
Ben Yan,
Email:
<wumoyan@usc.edu>
Office Hours: Mon/Fri 9:00am  10:00am and Wed 8:00am  9:50am in SAL 200

Graders 
Paras Goyal, Email: <parasgoy@usc.edu>
 Weijie Lin, Email: <weijieli@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, Thu, 7/5/2017 (firm)
in SGM 124
(SGM is located in section 4B of the
campus map)

during class time, Thu, 7/5/2017 (firm)

Final Exam 
9:30am11:25am, Tue, 7/31/2017 (firm), in SGM 124,
(SGM is located in section 4B of the campus map).

12:45pm2:40pm, Tue, 7/31/2017 (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.

Newsgroup 
: 
Google Group for discussing
course materials and programming assignments. You are required to be
a member of this group. (This group is by invitation only.)
Please do not send request to join this group until after the first lecture.



News

(in reversed chronological order)
 7/31/2018:
 Below is the grade normalization information for kernel3.
Please note that this only applies to the graderdependent part of your grade.
If you are graded by Paras Goyal <parasgoy@usc.edu>,
his kernel3 average was 79.15 with a standard deviation of 29.07.
If you are graded by Weijie Lin <weijieli@usc.edu>,
his kernel3 average was 80.85 with a standard deviation of 24.70.
The overall class average for kernel3 was 80.03 with a standard deviation of 26.90.
To figure out your normalized score for kernel3, here's what you can do.
If your graderdependent part of your grade is X and your grader's average is A with a standard deviation of D,
then Y=(XA)/D is the number of standard deviations away your score is from your grader's average.
Therefore, your normalized graderdependent part of your grade would be
80.03+Y*26.90 (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 bellshaped curve,
when your score is normalized, linear interpolation is used. It's clearly not perfect since
the actual curve will never be bellshaped and linear interpolation is not the same as bellshapedcurve 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.
 7/26/2018:
The final exam will be closed book, closed notes, and closed everything (and no "cheat sheet").
Also, no calculators, cell phones, or any electronic gadgets are allowed.
Please bring a photo ID. Your ID will be collected at the beginning
of the exam and will be returned to you when you turn in your exam.
No matter how late you show up for the exam, your exam must end at the same time as your classmates.
There will be assigned seating.
The final exam will cover everything from slide 71 of
Lecture 9 to slide 24 of
Lecture 11
PLUS everything from slide 34 of
Lecture 12 to the last slide of
Lecture 21.
Also included are discussion section slides 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 one described in Lecture 21
(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
 Ch 4  OperatingSystem Design
 devices
 virtual machines, microkernels
 Ch 5  Processor Management
 threads implementations
 interrupts
 scheduling
 Ch 6  File Systems
 the basics of file systems
 performance improvements
 crash resiliency
 directories and naming
 RAID, flash memory, case studies
 Ch 7  Memory Management
 Kernel assignments 2 & 3
 spec
 FAQ
 my posts to class Google Group
 7/16/2018:
 Below is the grade normalization information for kernel2.
Please note that this only applies to the graderdependent part of your grade.
If you are graded by Paras Goyal <parasgoy@usc.edu>,
his kernel2 average was 92.86 with a standard deviation of 5.84.
If you are graded by Weijie Lin <weijieli@usc.edu>,
his kernel2 average was 91.37 with a standard deviation of 6.34.
The overall class average for kernel2 was 92.13 with a standard deviation of 6.14.
To figure out your normalized score for kernel2, here's what you can do.
If your graderdependent part of your grade is X and your grader's average is A with a standard deviation of D,
then Y=(XA)/D is the number of standard deviations away your score is from your grader's average.
Therefore, your normalized graderdependent part of your grade would be
92.13+Y*6.14 (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 bellshaped curve,
when your score is normalized, linear interpolation is used. It's clearly not perfect since
the actual curve will never be bellshaped and linear interpolation is not the same as bellshapedcurve 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.
 7/13/2018:
 Below is the grade normalization information for kernel1.
Please note that this only applies to the graderdependent part of your grade.
If you are graded by Paras Goyal <parasgoy@usc.edu>,
his kernel1 average was 89.54 with a standard deviation of 8.12.
If you are graded by Weijie Lin <weijieli@usc.edu>,
his kernel1 average was 89.11 with a standard deviation of 7.08.
The overall class average for kernel1 was 89.31 with a standard deviation of 7.59.
To figure out your normalized score for kernel1, here's what you can do.
If your graderdependent part of your grade is X and your grader's average is A with a standard deviation of D,
then Y=(XA)/D is the number of standard deviations away your score is from your grader's average.
Therefore, your normalized graderdependent part of your grade would be
89.31+Y*7.59 (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 bellshaped curve,
when your score is normalized, linear interpolation is used. It's clearly not perfect since
the actual curve will never be bellshaped and linear interpolation is not the same as bellshapedcurve 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.
 6/28/2018:
 Below is the grade normalization information for warmup2.
Please note that this only applies to the graderdependent part of your grade.
If you are graded by Paras Goyal <parasgoy@usc.edu>,
his warmup2 average was 77.94 with a standard deviation of 37.24.
If you are graded by Weijie Lin <weijieli@usc.edu>,
his warmup2 average was 70.58 with a standard deviation of 27.67.
The overall class average for warmup2 was 74.31 with a standard deviation of 33.08.
To figure out your normalized score for warmup2, here's what you can do.
If your graderdependent part of your grade is X and your grader's average is A with a standard deviation of D,
then Y=(XA)/D is the number of standard deviations away your score is from your grader's average.
Therefore, your normalized graderdependent part of your grade would be
74.31+Y*33.08 (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 bellshaped curve,
when your score is normalized, linear interpolation is used. It's clearly not perfect since
the actual curve will never be bellshaped and linear interpolation is not the same as bellshapedcurve 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.
 6/26/2018:
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. There will be assigned seating.
The midterm exam will cover everything from the beginning of the
semester to slide 32 of Lecture 12 on 6/26/2018,
MINUS Chapter 5 (i.e., material in Ch 5 is excluded from the midterm).
Regarding what types of questions will be on the midterm, please see
the Exams section of the course description web page
and slides 34 through 42 of Lecture 12 on 6/27/2018.
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, synchronization
 thread safety, deviations
 Ch 3  Basic Concepts
 context switching, I/O
 dynamic storage allocation
 static linking and loading
 booting
 Ch 4  OperatingSystem 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 weenixspecific questions.
 6/7/2018:
 Below is the grade normalization information for warmup1.
Please note that this only applies to the graderdependent part of your grade.
If you are graded by Paras Goyal <parasgoy@usc.edu>,
his warmup1 average was 81.41 with a standard deviation of 28.79.
If you are graded by Weijie Lin <weijieli@usc.edu>,
his warmup1 average was 82.43 with a standard deviation of 29.03.
The overall class average for warmup1 was 81.92 with a standard deviation of 28.91.
To figure out your normalized score for warmup1, here's what you can do.
If your graderdependent part of your grade is X and your grader's average is A with a standard deviation of D,
then Y=(XA)/D is the number of standard deviations away your score is from your grader's average.
Therefore, your normalized graderdependent part of your grade would be
81.92+Y*28.91 (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 bellshaped curve,
when your score is normalized, linear interpolation is used. It's clearly not perfect since
the actual curve will never be bellshaped and linear interpolation is not the same as bellshapedcurve 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/13/2018:
 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 email address.)
 Please do not send request to join the
class Google Group until after the first lecture.


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 the CPU does).


Important Information about Programming Assignments

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 nullterminated 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.
If you forgot how to use Unix, please summary of some commonly used Unix commands.
The kernel programming assignments must run on a 32bit Ubuntu 14.04 (Ubuntu 12.04
is also acceptable if you have a slow machine).
Therefore, you should install a 32bit
Ubuntu 14.04 (or Ubuntu 12.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.
Please note that the preferred version of Ubuntu is
Ubuntu 14.04 (unless you have a laptop with only 2GB of memory
or a slow CPU, then you should install Ubuntu 12.04)
These days, I have been using VagrantBox (i.e., Vagrant with Virtualbox)
to install and run Ubuntu 14.04. I think it has a better integration with Windows 10 than
other systems. If you are running Windows and you are comfortable with commandline interface to Linux/Unix systems
(since Vagrant does not have a "desktop UI"), I would recommend installing Vagrant on your laptop/desktop.
If a student registered late for this class or could not be present
at the beginning of the summer session,
he/she is still required to turn all projects and homeworks
on time or he/she will receive a score of 0 for these assignments.
No exceptions!


