CS333 - Introduction to Operating Systems
Spring 2015


When: Mon/Wed 1400-1550
Where: Shattuck Hall 212
Instructor: Jonathan Walpole
Instructor Office Hours - by appointment
Teaching Assistants: Kendall Stewart
Naomi Dickerson
TA Office Hours - Mondays 12-1.30pm and Thursdays 12-2pm in the CS Dept. fishbowl


Description

This course will introduce the core concepts of operating systems, such as processes and threads, scheduling, synchronization, memory management, file systems, input and output device management and security. The course will consist of assigned reading, weekly lectures, a midterm and final exam, and a sequence of programming assignments. The goal of the readings and lectures is to introduce the core concepts. The goal of the programming assignments is to give students some exposure to operating system code. Students are expected to read the assigned materials prior to each class, and to participate in in-class discussions.


Prerequisites
Students should have previous familiarity with programming in a high-level object-oriented language (such as C++ or Java); assembly language programming; CPU organization, instruction sets, registers; program development in the Unix environment (edit, compile, link, load, execute, makefile, using the shell); the Unix system call interface; basic data structures (lists, trees, graphs); object-oriented concepts (class, object, method). CS 200 (Computer Systems Programming) is a prerequisite for this class.

Text Book
The course will be based primarily on lecture slides. In addition, the following reference material will be used for the project assignments:

        "The BLITZ System", by Harry Porter, approx. 200 pages.

This packet documents the BLITZ software used in the course projects. It is available freely online here.

There is also a text book associated with the course. The primary purpose of the text book is to provide students with an alternative perspective on the materials covered, should it be needed. The text book, which is also available freely online is:

        Operating Systems: Three Easy Pieces, Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau, Arpaci-Dusseau Books, May, 2014 (Version 0.80).

Available at: http://pages.cs.wisc.edu/~remzi/OSTEP/

Note: you can use the free online version, or pay $10 for a complete .pdf with glossary, links, etc. Also you may choose the hardcopy options for $25 softcover or $37 hardcover. Any of these options include all of the material needed for the course, just choose the most convenient for your needs.


Grading

Your final grade will be calculated as follows:

        project - 50%;
        midterm exam - 25%;
        final exam - 25%;


Project

The programming assignments for this class are based on the BLITZ system. BLITZ is a collection of software, written by Harry Porter, designed to streamline the process of learning about, and experimenting with, operating system kernel code. BLITZ includes a complete operating system, assembler, linker, loader and debugger, together with software to emulate an underlying CPU and various devices. The emulated CPU and devices are representative of real-world systems, but without some of the low-level complexity that complicates the process of learning about the key underlying concepts. By using BLITZ students are able to study, in detail, the low-level operating system code that interacts with the hardware, as well as design, code and test their own modifications to the operating system.

Be sure to visit the following page, created by Kendall Stewart, which contains instructions for getting started with Blitz and various other Blitz-related tools that will help you.

        CS333 Student Resources for Blitz

The due dates for each of these projects are given in the class schedule below.

        Project 1: [ Handout.pdf ] [ Directory Containing Files ]
        Project 2: [ Handout.pdf ] [ Directory Containing Files ]
        Project 3: [ Handout.pdf ] [ Directory Containing Files ]
        Project 4: [ Handout.pdf ] [ Directory Containing Files ]
        Project 5: [ Handout.pdf ] [ Directory Containing Files ]


Mailing List

A "MailMan" e-mailing list will be maintained for this class. The list, called cs333@cs.pdx.edu, is for communicating information relating to the course, and can be used by students as well as the TA and instructor. All students should subscribe to this list. Go to the following web page and follow the instructions:

https://mailhost.cecs.pdx.edu/cgi-bin/mailman/listinfo/cs333


Schedule
3-30-15 Course Overview and Introduction to Operating Systems
Course outline. Overview of course project and expectations. Introduction to hardware support for operating systems: privileged mode execution, saving and restoring CPU state, traps and interrupts, timers, memory protection. Operating system techniques for protecting user and hardware resources. Overview of the key operating system abstractions and the use of system calls to manipulate them.

Slides: [ .ppt .pdf ]
Reading: Intro: Introduction
Start Project 1 - Introduction to BLITZ (due 4-6-15)
4-1-15 The Process Concept
Complete the overview of the key operating system abstractions and the use of system calls to manipulate them. Program execution, the process concept, process-related state, the process table, saving and restoring process state, the role of the scheduler.

Slides: [ .ppt .pdf ]
Reading: Virtualization: Processes; Process API; Direct Execution
4-6-15 Threads and Concurrency
Threads, process context switch vs thread switch, true concurrency vs pseudo concurrency, operating systems as concurrent programs, concurrency through multi-threading, concurrency through interrupt handling, concurrent access to shared memory, race conditions, mutual exclusion, synchronization primitives based on atomic instructions.

Slides: [ .ppt .pdf ]
Reading: Concurrency: Concurrency and Threads; Thread API
Project 1 due at start of class.
Start Project 2: Threads & Synchronization (due 4-22-15)
4-8-15 Synchronization Primitives
Atomic instructions, locks, spinlocks, mutex semaphores, counting semaphores, and their use in solutions to Producer Consumer synchronization.

Slides: [ .ppt .pdf ]
Reading: Concurrency: Locks; Locked Data Structures
4-13-15 Classic Synchronization Problems
Classic synchronization problems: Producer Consumer, Dining Philosophers, Readers and Writers, Sleeping Barber.

Slides: [ .ppt .pdf ]
Reading: Concurrency: Locks; Locked Data Structures
4-15-15 Monitors and Message Passing
Monitors, condition variables, message passing, and their use in solutions to classic synchronization problems: Producer Consumer, Dining Philosophers, Readers and Writers, Sleeping Barber.

Slides: [ .ppt .pdf ]
Reading: Concurrency: Condition Variables; Semaphores; Concurrency Bugs
4-20-15 Deadlock
Deadlock, livelock, deadlock detection, avoidance, and prevention.

Slides: [ .ppt .pdf ]
Reading: Concurrency: Concurrency Bugs
4-22-15 Scheduling
Separation of policy from mechanism, scheduling mechanisms, preemptive vs non-preemptive scheduling, example scheduling policies, FIFO, round-robin, shortest job first, priority scheduling, Unix-style feedback scheduling, proportional share scheduling, lottery scheduling.

Slides: [ .ppt .pdf ]
Reading: Virtualization: CPU Scheduling; Multi-level Feedback; Lottery Scheduling; Multi-CPU Scheduling
Project 2 due at start of class.
Start Project 3: Synchronization Problems (due 5-6-15)
4-27-15 Memory Management
Memory addresses and binding, static and dynamic addresses translation, address translation using base and limit registers, memory management algorithms using linked lists and bitmaps, external and internal fragmentation, paged virtual memory.

Slides: [ .ppt .pdf ]
Reading: Virtualization: Address Spaces; Memory API; Address Translation; Segmentation; Free Space Management; Intro to Paging;
4-29-15 Midterm Exam
In class, closed-book exam based on material covered so far.

5-4-15 Virtual Memory 1
Physical address spaces, virtual address spaces, page table design, single-level and multi-level page tables, hardware support for dynamic address translation using a TLB, hardware and software managed TLB refill.

Slides: [ .ppt .pdf ]
Reading: Virtualization: Address Spaces; Memory API; Address Translation; Segmentation; Free Space Management; Intro to Paging; Translation Lookaside Buffers
5-6-15 Virtual Memory 2
Inverted page tables, the memory hierarchy, TLB miss faults, segmentation faults, protection faults, page faults, hardware support for memory protection, segmentation.

Slides: [ .ppt .pdf ]
Reading: Virtualization: Address Spaces; Memory API; Address Translation; Segmentation; Free Space Management; Intro to Paging; Translation Lookaside Buffers; Advanced Page Tables
Project 3 due at start of class.
Start Project 4: Kernel Resource Managers (due 5-20-15)
5-11-15 Virtual Memory 3
Implementation issues, page sharing, copy-on-write, page fault handling, segmentation, segmentation with paging.

Slides: [ .ppt .pdf ]
Reading: Virtualization: Address Spaces; Memory API; Address Translation; Segmentation; Free Space Management; Intro to Paging; Translation Lookaside Buffers
5-13-15 Paging Algorithms
Demand paging, swapping, placement and replacement algorithms, memory hierarchy revisited, overview of cache architecture, performance modeling for memory management systems.

Slides: [ .ppt .pdf ]
Reading: Virtualization: Swapping Mechanisms; Swapping Policies
5-18-15 Input/Output
Devices, memory mapped devices, DMA, device drivers, interrupt handling, scheduled vs non-scheduled I/O processing, block vs character devices.

Slides: [ .ppt .pdf ]
Reading: Persistence: I/O Devices
5-20-15 Secondary Storage Management
Disks, sectors, tracks, blocks, disk head scheduling algorithms, the file abstraction, directories, links.

Slides: [ .ppt .pdf ]
Reading: Persistence: Hard Disk Drives; RAID
Project 4 due at start of class.
Start Project 5: User Level Processes (due 6-3-15)
5-27-15 File Systems 1
File system architecture, file system data structures and system calls.

Slides: [ .ppt .pdf ]
Reading: Persistence: Files and Directories; File System Implementation;
6-1-15 File Systems 2
File system architecture and design criteria.

Slides: [ .ppt .pdf ]
Reading: Persistence: Fast File System; FSCK and Journaling; Log Structured File System
6-3-15 Security
Protection domains and mechanisms, access control lists, capabilities, user authentication, encryption, common internal and external attacks.

Slides: [ .ppt .pdf ]
Reading: Persistence: Data Integrity and Protection

Project 5 due at start of class.
6-?-15
Final Exam



Back to Jonathan Walpole's home page