CSCI 3411, Fall 2016: Operating Systems

Professor: Gabriel Parmer (gparmer at gwu)
Office hours: ???, SEH 4600
Research interests: Embedded systems, component-based OSes (see Composite), multi-core OSes

Class Schedule: Tuesday/Thursday 12:45-2:00pm
Lab (required attendance): Thursday 2:10-4 or 6:10-8:00pm

TA:
James Taylor (jrt at gwu), Office Hours: R 10-12, and in lab if there is time

This course covers the fundamental concepts of operating systems, focusing on resource management and abstraction. This includes OS structure, processes and thread management, communication with peripherals (I/O), synchronization, deadlocks, memory management, Virtual Machines, cloud infrastructures, and abstractions for cloud computation.

The workload for this class is heavy and programming intensive.

News:
  • First day of class TODO list:
    1. Sign up for the Piazza message board.
    2. Complete the first assignment (make a github account, use git, perhaps install Linux in a VM).
    3. Do you remember/know C?
      Spend a few minutes writing a linked list that supports:
      void add(struct linked_list *ll, void *value),
      int length(struct linked_list *ll),
      void *remove_first(struct linked_list *ll), and
      int contains(struct linked_list *ll, void *value).

      If you have any problems with this, you need to take action now. See the Essential C pdfs in the Course Material section below (esp. the practice problems).

      If you don't become comfortable with C soon, you will not do well in this class. You will profit later from having a firm grasp on C!
    4. If you aren't running Linux, consider installing VMWare player or Virtual Box on your personal machine. We will use gcc, binutils, git and other programs that are typically found in Linux. Importantly, we will be testing everything in Linux (Ubuntu 14.04), so you'll likely want to test in that.
    5. Gear up for a challenging, but satisfying semester! Get ready to demystify how computers work!
  • All subsequent news will be posted on Piazza!

Please click on any section below to see its contents.

Objectives and Structure

Objectives - In completing this class, students will...
  • understand key concepts involving system resource management, organization, and abstraction
  • understand how an OS manages and interfaces with hardware
  • understand fundamental trade-offs integral to system design
  • experience both development and experimentation in a real OS
Structure - This class is broken into two main activities: lectures and lab.
  • Lectures will discuss the main concepts in systems with reference to implementation details where beneficial. A series of homeworks (all in C) will test student's ability to apply the courses concepts in a set of projects. The midterm and final exams test student's understanding of the lecture's concepts.
  • Labs will help you jump into the xv6 kernel and learn how to write and understand code in key subsystems. You will have programming assignments related to lab lectures throughout the semester. In the second half of the class, you will have a large group project involving kernel programming.

Course Prerequisites and Student Responsibilities

Prerequisites:
  • Computer Architecture I, Software Engineering
  • Assignments for this class will be done in C, and will require kernel-level programming. Though we do not assume that you have kernel experience, if you aren't somewhat comfortable with C, you will have a very difficult time. Thus, a familiarity with C or a willingness to quickly learn and practice it is required.

    If you are not comfortable with C, at least go through Essential C and the exercises in the Course Material Section.

Responsibilities - Students must
  1. Attend all classes unless you are sick or there is an emergency in which cases you must contact the professor via email before class.
  2. Interact, ask questions, and generally participate in class discussions.
  3. Attend all labs, and do work assigned therein.
  4. Complete programming problems assigned in lab, and all written assignments individually.
  5. Work productively as a group on an extended and difficult project.

Course Material

Required Text:

  • Operating Systems Concepts, 9th edition, by Silberschatz, Galvin, and Gagne. If you have another edition, it is probably OK.
If you have trouble understanding the xv6 source code, I recommend the following resources:

You can fork the xv6 source on github. When you do, test that you can run it with make, and make qemu.

In the end, you have to get comfortable walking through the code. Using a code indexing system will make this easier. ggtags for emacs does great, but there are corresponding technologies for nearly all editors.

If you're having trouble with C, here is a list of references:

It is your responsibility to quickly get up to speed in C, so please use these resources.

Schedule

Events are in bold. Note that this schedule is subject to change.

TopicReading "xv6 book (silberschatz)"
Introduction and OS fundamentals
  • Definitions, Computer Architecture, OS History, OS Structure

Chapter 0, 1, 3 (Chapter 1,2), and this post
Processes, Inter-Process Communcation, Threads
  • Address spaces, I/O, Isolation, and Run-states
(Chapter 3, 4) and this post
CPU Scheduling and Synchronization
  • Scheduling Mechanisms, Algorithms, and Evaluation. Critical Sections and how they are provided
Chapters 5, 4 (Chapter 5, 6, 19)
Synchronization Cont. and Deadlock
  • Semaphores/Monitors, Deadlock conditions and Solutions
(Chapter 6, 7)
Midterm N/A
Memory Management
  • Allocation Algorithms
(Chapter 8)
Memory Management and Protection
  • Segmentation, Paging, TLBs, Address Translation, Demand Paging
Chapter 2 (Chapter 9)
File-Systems and Storage I/O
  • File-System API, Rotating Storage, File-System Layout, Block Device Scheduling
Chapter 6 (Chapter 10, 11, 12, 13)
Virtual Memory
  • Page Replacement Algorithms, Thrashing
(Chapter 9)
Course Reflection N/A
Final Exam N/A

Lectures

Note that these will be posted on Piazza, and questions can be asked there.
  • Class Introduction, OS definition and history [pdf]
  • System structure and protection [pdf]
  • System structure and processes [pdf]
  • IPC and threads [pdf]
  • Synchronization [pdf]
  • Deadlocks [pdf]
  • Scheduling [pdf]
  • Real-Time Scheduling [pdf]
  • Memory Management [pdf]
  • Memory Management II [pdf]
  • File Systems APIs and Abstractions [pdf]
  • File Systems Design and Implementation [pdf]

Grading

Grades will be assigned with the following proportions:

Homeworks and Quizes: 50%
Midterm: 20%
Final: 20%
Class and Lab Participation: 10%

Homeworks include smaller programming assignment, written responses, and a long final programming project.

Participation will be graded not only on attendance (50%), but also on interactivity and involvement (50%).

If needs be, there will be short quizzes at the beginning of classes.

Late Policy:

  • 66% credit: up to 24 hours late
  • 33% credit: up to 48 hours late
  • 0% credit: later than that
Because homeworks are every week, or every other week, it is too harmful to get behind on them. Thus the late policy is quite strict to discourage procrastination.

Academic Honesty

Just as you can do a google search for code online, it is trivial for us to do the same. We have caught numerous people cheating in the past in this way. If you feel pressured about an assignment, please come see me instead of cheating.

You are not allowed to collaborate on the homeworks and the lab assignments. The group projects require collaboration amidst each group, but no collaboration between teams is permitted. Please refer to the academic integrity policy linked from the course web page. This policy will be strictly enforced. If you're having significant trouble with an assignment, please contact me.
If you have not signed the academic integrity statement for homework 0, you will not receive a passing grade for the class.

Additional Material

If you're interested in Composite, the OS we are developing here at GW, don't hesitate to contact me.

In addition to the contents of the class, what follows is a list of resources that will allow you to go beyond what you've learned. This material is not mandatory for the class and is meant to give you a springboard if you wish to pursue the ideas further. Many of these are blog posts or articles for easy reading. However, because of the informal format, please take the contents with a grain of salt. I can point you to more thorough content if you want it. If you find an website/article/tool that you think is worthy of being in this list, let me know.

If you're interested in delving into Linux kernel programming, see:
  • Linux Kernel Development by Robert Love
  • Professional Linux Kernel Architecture by Wolfgang Mauerer (free pdf should be available)
For kernel development, we will be using VMWare.

Websites geared toward systems topics (or that have subsections on systems):

  • Linux Weekly News: Free content is that which is at least a week old (see the Archives).
  • Two brilliant classes on microkernel construction.
  • Arstechnica: geek news, often with a high-level overview of systems/architectural topics.
  • OKLabs videos. A microkernel company. Specifically, see the series titled, "Advanced OS with Gernot Heiser".
  • OSDev Wiki: the resource on practical OS construction and hardware manipulation.
  • Agner's blog: What's happening in those processors of ours? See more architecture discussions at real world tech.
  • From low-level embedded system hacking, to robotics, to hacking! Hackaday!

Blogs and articles (remember that these are not authoritative sources!):

Really. cool. tools:

  • DynamoRIO: Because it rocks to modify a program as it's executing.
  • SQLite: a small, well written, data-base. Use it, read it, and be merry.
  • Lua: a tiny language with a runtime of about 10K LOC. If you want to know what a language does under the wraps, here's a good place to find out (just ignore some of the syntax oddities).
  • Valgrind: Ever wonder what your program's been doing in its spare time? This will tell you. Required for debugging large C/C++ programs.
  • LLVM: A beautiful compiler backend. If you want to write a language, this will make your life so much easier.
  • FUSE: Want to write a file-system, but aren't sure about all of that kernel programming? And what if you need to use high-level libraries? No problem; do it is user-space!
  • Daikon: Because who doesn't want to use machine learning to infer their own program's behavior?
  • More powerful link-time optimization!
  • A great C library for simple machine learning operations such as classification.