CS 111 Operating System Principles (Winter 2013)

Dr. Paul Eggert • Lecture 1 • January 7, 2013

Anthony Su • Stanley Xu • Allen Zhang


Table Of Contents

1. Course Information


Prerequisites

Course Load

Theoretical Hours Actual Hours
Lecture 4 3.6
Lab/Discussion 2 1.8
Outside Study 9 18+

Course Organization

17 lectures due to 2 holidays

Grading:

Assignment Fraction of Score Additional Notes
1 Midterm 1/9 February 11th; 100 minutes; Open book/notes
1 Final 2/9 Wednesday, March 20th, 2013 ; 8:00 AM - 11:00 AM; 180 minutes; Open book/notes
4 labs (can be completed in pairs • okay to have a different partner for different labs • 1 partner submits with both names) 1/12 each 1. Write a Shell 2. Kernel Hacking 3. File Systems Hacking 4. Distibuted
2 Minilabs (completed individually) 1/15 each 1. Scheduling 2. Virtual Memory
1 Design Problem 1/12 Written Report (Due 1 week after lab) & Presentation (Due 2 weeks after lab)
1 2-to-3 page paper on current OS issues 1/12 Assignment will be completed last week.
Scribe Notes 1/20 Due 1 week after lecture (except 1 week before midterm where there is a 5-day deadline)Teams up to 4
Lateness Policy: 2N-1% off assignment where N is number of days late For example: 1%, 2%, 4%, 8%, 16%, 32%, 64%, ∞ off for 1, 2, 3, 4, 5, 6, 7, 8+ days respectively
Drop dead Deadline(for all assignments) No assignments can be submitted after Friday, last day of instruction 23:59:59
*Complete Schedule

Textbook

Principles of Computer System Design (2009) Jerome H. Saltzer and M. Franz Kaashoek

Relevant article from The Economist

In a recent article on the new politics of the internet:
We don't offer a ready-made program, but an entire operating system. — Marina Weisbad Pirate Party (Germany)
We see operating systems taking on different meanings as it becomes a more popular term in today's cultures. What do operating systems mean to us?

2. What's a System?


Oxford English Dictionary (original 1928 version) defines a system as:

  1. An organized or connected group of objects.
  2. A set of principles, etc.; a scheme, method
    Origin: from Greek systema σύστημα meaning organized whole, government, constitution, flock of birds, musical interval, verses in a poem
    Its roots mean "set up with".

3. What's an Operating System?


4. Problems with Computer Systems


There are 4 major problems with computer systems:

  1. Tradeoffs (Section 1.1.1.4 page 6)
  2. Incommensurate Scaling (Section 1.1.1.3 page 5)
  3. Emergent Properties (Section 1.1.1.1 page 4)
  4. Propagation of Effects (Section 1.1.1.2 page 4)
  1. Tradeoffs

    When optimizing for certain features, you run into what is known as the waterbed effect.

    waterbed

    Pushing down on one end causes the other end to pop up.

    Example 1: Sorting

    Let's say we have the following:

    With a little math, this turns out to be roughly 220 records.
    Imagine we are trying to sort this data using an algorithm like mergesort, which runs in O(nlogn) time.

    Problem: With 220 records, this is going to take an eternity to copy the data and whatnot! Instead, the client wants a solution that is 100x faster.

    Solution: Instead of copying data, use pointers.
    As a result, instead of copying an entire 512 byte record, we only have to copy 4 bytes for the pointer!
    512/4 = ~128x speedup!

    Downsides:

    Example 2: RSA Secure ID

    RSA

    The RSA Secure ID is a token that adds another method of authentication for a user to a network resource. It is intended to add an extra layer of security to password authentication. However, the adoption of the RSA Secure ID has been recieved with mixed feelings.

    Pros: Increased security by having another form of authentication.
    Cons: The trouble of carrying the ID around, price, etc.

  2. Incommensurate Scaling

    What does it mean? Not everything (normally quantitative attributes) scales at the same rate. So a solution that works for you now may nottwork when it is scaled up or down.

    Example 1: The Human Body

    Why are we only 2 meters tall, and not 20 meters?
    The issue is that as sometting grows larger, surface area increases at a rate of n2, while volume increases at a rate of n3.
    Thus, our bone strength, which is a function of cross sectional area (n2), grows much slower than our weight (n3), making 20 meter tall humans infeasible.
    The solution is to become like Wolverine, and develop adamantium-based bone structure.

    wealth of nations cover

    Example 2: Economies of Scale • A Wealth of Nations by Adam Smith

    A large pin factory producing for everyone is better than everyone producing their own pins. When scaling up, producing additional units becomes cheaper.
    On the other hand, creating a 512-port ethernet switch is much more expensive than an 8-port switch. This is known as diseconomies of scale, where scaling up any higher is actually more expensive.

  3. Emergent Properties

    Properties (normally qualitative), usually unanticipated, that arise once all parts of a system have been assembled together.

    Napster logo

    Example 1: Internet on Campus

    Internet around campus was meant to be used for learning activities, but instead was used for:

    Tacoma Narrows Bridge collapsing

    Example 2: Tacoma Narrows Bridge

    No one expected the wind to match the resonant frequencies of the bridge.
    Since such catastrophe never accounted for in models, this event was never considered.
    Only after the bridge was assembled (and later destroyed) did architects realize this was a property which emerged from scaling up the model bridges.

  4. Propagation of Effects (PoE)

    Something that happens now will affect something else in the future.

    reagan

    Example 1: Reagan Becomes President

    Back in the days before Reagan's presidency, he had acted in a movie, and became well known. He obtained the role because the previous actor had committed suicide. Through propagation of effects, Reagan indirectly became president because of a suicide.

    Example 2: PoE in Engineering

    Consider the location
    \usr\bin\foo
    Now consider
    \usr\bin\涼宮ハルヒ.
    If we were the computer, and we did not know the encoding of this text, what could possibly happen is that the Japanese characters can contain the exact bits which match that of a backslash.
    Thus, the computer would see the following:
    \usr\bin\?\???
    As a result, the computer would output an error saying the folder does not exist.

    Solution: Originally the problem was solved by taking into account the type of encoding. Now non-ascii characters are encoded using UTF-8.

    Propagation of effects occur all the time in chaotic systems, but it can also happen in an engineered system. Because propagation can also occur in a controlled environment, it is important to design the system effectively to localize damages that may otherwise propagate throughout.