This is an undergraduate course on computer operating systems. (Although this course is for graduate students only! 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!) 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.

My actual CS 402 class web site for Fall 2020 is not ready yet. Since many students are registering now, I felt that I should post some important information about CS 402 (especially about rules) so students can know what to expect and register accordingly. I tend to be a stickler to rules, so there will be no exceptions.

Someone students don't understand why I am so strict with rules. Some think that it's just a power trip for me. It's actually just the opposite! The reason for sticking to rules is that I have the responsibility of treating all students fairly! If I apply one rule to one student and don't apply the same rule to another student, I think that's totally unfair. I think fairness is very important. Without fairness, grades have no meaning. The only way I know how to be fair is to have rules that are written down clearly and stick to all the written rules. When you ask me to bend a written rule for you, please understand that you are asking me to be unfair to all other students; and therefore, I will not bend the rule for you. You see, this takes power away from me because I am bound by my own rules and you can demand that I stick to my own rules!

Short Semester

  • This semester is a short semester. It's only 13 weeks of lectures (while a typical semester is 15 weeks of lectures). If I cut the materials covered in this class, some students would feel short-changed because they would learn less compared with students who took this class in other semesters. I think this would not be acceptable to a lot of students. Therefore, I will cover exactly the same materials and do exactly the same assignments as previous semesters. To make this work, we will do everything that's done in the first 6 weeks of a regular semester in the first 4 weeks of this semester (this includes lectures and programming assignments). The rest of the semester will go at the same pace as a regular semester. Please see the bottom of this web page for important dates. This means that you have to work extra hard during the first 4 weeks of this semester. I know this is not ideal, but I think it's the best way to go for this special semester.


  • I do not sign D-clearances and I will not sign anything to put one student ahead of everyone else. Please see your adviser to get your D-clearance.



  • This class will be completely online this semester. We will be using a flipped classroom model during this semester. Lectures will be pre-recorded and will be made available before 6pm the day before the scheduled lecture time. You are expected to watch the lecture video beofre you come to the online portion of the class during the scheduled lecture time. During live lecture on Zoom, we will be discussing materials covered in the recorded video (you are also welcome to ask me questions about programming assignments during live lecture times). At the end of live lecture, I will stop recording and leave the "room" but keep the Zoom session running so that students can use the remaining time to talk to one another over Zoom (you can use that time to recruit potential teammates for group assignments).

DEN Videos

  • DEN lecture videos will be made accessiable to all of the non-DEN sections (although you may not be able to download any of these videos).


  • You must take all the exams in the section for which you are registered. Each section gets a different exam!

  • The dates and times for the final exams are deteremined by the university and there is absolutely no way to change them for you. If you know that you cannot come to the final exam for a particular section, do not register for that section because I will not change the date or time of your final exam.


  • If you are officially auditing this course (i.e., register for this course under the no-grade option), you will get the same course materials as everyone else. However, you will not be permitted to form or join a team with students who are taking this course for grades to do the kernel assignments since your level of commitment is different from students who are taking this course for grades.

  • If you want to audit this course unofficially, I will have to say no to you.


  • This class is very demanding and the last programming assignment is extremely difficult and very very time-consuming. The coverage of this class is very vast. There is really no time for me to explain every topic to the point where every student in the class understands everything perfectly because we have to move along quickly to get you ready for the programming assignments. So, please do not expect "spoon feeding" in this class and you need to be prepared to figure things out on your own. (Although everything is recorded so you can watch the videos over and over again.) Of course, you are always welcome to come talk to me about anything related to the course material. So, you are not completely on your own. You will also be expected to learn certain things completely on your own.

    This class can also be very rewarding. If you work super hard throughout the entire semester and implement all the programming assignments yourself, you will realized that you have learned so much when the course is over.

Kernel Teams

  • Up to 4 students per team will be permitted but no more. You can form a kernel team with students registered in any section. Please understand that to be fair to all, I cannot get involved in putting teams together. You are completely on your own to form teams. If you have issues with your teammates, there is nothing the instructor can or will do. You have to choose your teammates very carefully.

    I strongly recommend that you work with your potential teammates during the beginning of the summer sessions. Once you like each other and feel that you can trust each other, you can commit to be in the same team. I would strongly urge you not to form a team with someone you have never worked with (unless you are willing to let them have a free ride and do all the work for them).

    You can also work on the kernel assignments by yourself. It's do-able if you are a good programmer who knows C well and are good at debugging. Otherwise, you need to get good at programming and debugging as quickly as possible!

Grade Normalization of Programming Assignments

  • Since it's pretty much impossible to have every grader grade identically, I will track which student is graded by which grader. When I calculate your final class grade at the end of the semester, I will "normalize" each assignment grade according to the average and standard deviation for each grader and extrapolate your grade according to the overall class average and standard deviation. For example, if the average for a particular grader is 85 and standard deviation is 10 and you got a score of 87.5 (i.e., average plus a quarter of a standard deviation), your "normalized" score will be the overall class average plus a quarter of the overall class standard deviation. This means that if you were graded by an "easy grader", your normalized score may be lower than your original score. If you were graded by a "harsh grader", your normalized score may be higher than your original score. This is not a perfect system. But I think it's a big improvement over not normalizing your scores and it's done this way so that you can have flexibility when you choose which section to enroll.

    This is only done for programming assignments since the pgoramming assignments are identical for every student, no matter which section you belong. For exams, each section gets a different exam, and therefore, grade normalization is not needed and will not be performed.

Late Registration

  • Even though you are on the wait list and there is no guarantee that you will get in, if you intend to take this class, you are expected to attend every lecture and submit all assignments on time (i.e., same deadlines as students who are already registered). So, even if you get in on the last day that you are allowed to register for classes, you will be expected to turn in all programming assignments by their submission deadelines, even if some deadlines have past, just like everyone else (see below for deadlines to all assignments).


  • The prerequisites for this class are (1) CSCI 201L or CSCI 455x, and (2) EE 357 or EE 352L. But prerequisites are only enforced for undergraduate students. For grad students, they are turned into "recommended preparation". The way to interprep these recommended preparation is that you should know how to program in C++ and you should know what's inside a processor/CPU and how it works (i.e., how a CPU executes machine instructions).

    Some people mistakenly think that this is an introductory class! With the above prerequisites, how can this be an intro class?!

  • The programming assignments of this class will be very demanding (kernel 3 will be extremely difficult and very very time-consuming). 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 C-strings (i.e., null-terminated array of characters) using functions such as strchr, strrchr, strlen, strcmp, strncpy, etc. You also need to know how to perform console and file I/O in C using functions such as read/write, printf/snprintf, fread/fwrite, fgets/getline, etc. 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 might also want to check out a free online course on C from CodesDope. (I haven't checked out the contents there. Please feel free to send me feedback.) One thing I would ask you to avoid is to practice C on a non-Linux system! You should install 32-bit Ubuntu 16.04 on your laptop or desktop and practice C on it.

    If you are not good with programming in C and you want to get prepared for this class, you can start by implementing some basic data structures and algorithms. For example, read a file of integers, sort them in a linked list, and sort the linked list using selection sort, bubble sort, insertion sort, merge sort, and quick sort is a good place to start. To practice file I/O and string manipulation, you can change the file of integers to lines of text and parse the lines into fields (e.g., separated by semi-colons or tabs) then sort the lines based on a particular field and print the sorted records. You must understand what a memory address is and what it means to store the address of a data structure into a pointer (e.g., in forming a linked list). You then need to be able to follow pointers to traverse a linked list. Please take a look at my review on pointers and make sure you understand everything there (you can send me e-mail if you have questions). Finally, you need to learn to use gdb to examine memory locations and debug your program.

    If you have taken CSCI 455x but feel that you need some background in data structures and algorthms, I would recommend that you take an online class such as this Data Structures class at (I think you have to pay to get the programming assignments, but you can audit the class for free; also, I have never taken this class, but the syllabus sounds right).

  • You must know how to use Unix/Linux. If you are not familiar with Unix/Linux, you must learn it on your own. We will not teach you how to use Unix/Linux in this class. If you are not familiar with Unix/Linux, I strongly urge you to read Unix for the Beginning Mage before the course starts. You can also visit UNIX Tutorial for Beginners or Learn tcsh in Y Minutes. You should also get familiar with the Unix/Linux development environment (vi/pico/emacs, cc/gcc, make, etc.)

    If you don't have access to a Unix/Linux machine, you can install your own. Our kernel programming assignments must run on Ubuntu 16.04 (if your machine is slow or has less than 4GB memory, Ubuntu 12.04 is also acceptable). Therefore, you might as well install 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.

    You should learn how to use the Terminal program to compile, run, and debug programs. It's probably a good idea to also learn how to use a text editor (such as vi, emacs, or pico) to create and edit C program source code.


  • This is a hard class! Don't fall behind! You should try to understand a lecture material by the end of the day the lecture was given. If there is anything you don't understand about the lecture, please send your question to me. In Lecture 1, I will make a promise to you that I will reply to every private e-mail messages within 24 hours of your e-mail! This is my commitment to you.
  • I should also explain that the textbook is designed to give you details a little bit at a time. Therefore, some concepts are introduced at a very high level at the beginning of the semesters. Then more and more details will be revealed later. By the end of the semester, you should know how everything is implemented. It can be frustrating that you won't know exactly how things are done when your learn a particular concept. You can read ahead if you have to know all the details, but that can be very time-consuming.
  • The class is designed so that the programming assignments go with schedule of lectures. If you don't keep up, you may have a very difficult time implementing the programming assignments. So, don't fall behind!
  • If you are having a difficult time with C programming, you need to figure out which concept in C is confusing you and ask me to clarify the concept. If you don't know how to program at all, then I don't know how to help you. As I have mentioned above, there are prerequisites for this class and you need to have the minimum background to take this class.
  • Ask me questions! I am here to help you with this class. I cannot help you if you don't ask me questions! If I don't get questions from you, I would have to assume that you understand everything.

Important Dates

          August 2020
          Su Mo Tu We Th Fr Sa
    Wk  1 16 17 18 19 20 21 22  first day of classes: 8/17
    Wk  2 23 24 25 26 27 28 29  warmup1 due: 8/28
    Wk  3 30 31
             September 2020
          Su Mo Tu We Th Fr Sa
    Wk  3        1  2  3  4  5
    Wk  4  6  7  8  9 10 11 12  Labor day: 9/7, warmup2 due: 9/11
    Wk  5 13 14 15 16 17 18 19
    Wk  6 20 21 22 23 24 25 26
    Wk  7 27 28 29 30
              October 2020
          Su Mo Tu We Th Fr Sa
    Wk  7              1  2  3  kernel1 due: 10/2
    Wk  8  4  5  6  7  8  9 10  DEN section midterm: 10/7, AP & PM section midterm: 10/8
    Wk  9 11 12 13 14 15 16 17
    Wk 10 18 19 20 21 22 23 24  kernel2 due: 10/23
    Wk 11 25 26 27 28 29 30 31
             November 2020
          Su Mo Tu We Th Fr Sa
    Wk 12  1  2  3  4  5  6  7
    Wk 13  8  9 10 11 12 13 14  last day of classes: 11/13, kernel3 due: 11/13
          15 16 17 18 19 20 21  AM section final: 11/19, 8am-10am; PM section final: 11/19, 11am-1pm
          22 23 24 25 26 27 28  DEN section final: 11/23, 8am-10am
Please note that:
  • The "local DEN section" (section 29945D) and "remote DEN section" (section 29946D) have the same lecture times (MW starting at 10am), and therefore, they are considered to be the same section and referred to as the "DEN section".
  • "AM section" refers to section 30203D with lecture time on TuTh starting at 9:30am.
  • "PM section" refers to section 30243D with lecture time on TuTh starting at 12:30pm.
If you have questions, please e-mail the instructor at <>.