Computer Science 111: Operating System Principles - Lecture 1

Prepared by Eric Mallare and Hong Shin for a lecture by Paul Eggert on January 7, 2013.

Table of Contents

  1. Class Logistics
    1. Textbook
    2. Requirements and Hours
    3. Grade Breakdown
    4. Late Policy
    5. Drop Dead Week
  2. Systems and Operating Systems
  3. Problems with Computer Systems
    1. Tradeoffs
    2. Incommensurate Scaling
    3. Emergent Properties
    4. Propagation of Effects

Class Logistics

Course Website

Textbook

Principles of Computer System Design, by Saltzer and Kaashoek.

Requirements and Hours

Prerequisites Recommended Official Hours Actual Hours
  • CS 32
  • CS 33
  • CS 35L
  • CS 131
  • CS 151B
  • CS 118
  • Lecture: 4 Hours
  • Lab: 2 Hours
  • Outside Study: 9 Hours
  • Lecture: 3.6 Hours
  • Lab: 1.8 Hours
  • Outside Study: 18 Hours

Grade Breakdown

Weight Assignment
19

Midterm

  • Open book, open note.
  • Questions connect multiple ideas.
  • Professor may not even know answer to some questions.
29

Final

  • Open book, open note.
  • Questions connect multiple ideas.
  • Professor may not even know answer to some questions.
13

Labs

  • 4 labs, 112 each.
    1. Writing a shell
    2. Kernel hacking
    3. File system hacking
    4. Something distributed
  • Recommended to work in teams of 2.
215

Minilabs

  • 2 minilabs, 115 each.
    1. Scheduling
    2. Virtual memory
  • Solo projects.
112

Design Problem

  • Extension for one of the labs.
  • Includes written report and short presentation.
115

Current Event Paper

  • 2-3 page paper on a topic of choice.
  • Select from list of current operating system issues.
  • Due last week.
120

Scribenotes

  • Condensed notes from lecture for others to read.
  • Done by a team with up to 4 members.
  • Must be done in HTML 4.01 or HTML 5.

Late Policy

Points taken off = 2N-1, where N is the number of days late. This policy applies even if a fractional part of a day was used. Of course, for N ≤ 0, zero points will be taken off.

Drop-dead date

All assignments must be submitted by 23:59:59 on Friday, March 15, 2013. No work will be accepted after this date.


Systems and Operating Systems

A Quote From The Economist

"We don't offer a ready-made program, but an entire operating system."

M. Weisband, Pirate Party (Germany)

This is an example of how the term 'operating system' is used today. Perhaps the word is in the process of vernacularization?

What is a System?

Oxford English Dictionary (Original--1928)

Greek Etymology

What is an Operating System?

Encarta (2007)

Wikipedia: ver 531774181 (2013-01-07)

Principles of Computer System Design (2009)

Notice that the focus now is the interaction betwixt the environment (e.g. users) and the system via the interface.

SystemInterface


Problems with Computer Systems

Tradeoffs

Waterbed Effect: Improving one property will negatively affect the others.

Example: Merge Sort
Pros
  • 128x speed-up
Cons
  • Comparisons run slower due to pointer dereferencing
  • Memory overhead for storing the pointers

Therefore, from this example, we see that aggressively speeding up the runtime costs us in other areas--we have the cost of dereferencing pointers and the overhead of additional memory that is required to hold the pointers.

Example: RSA Secure ID
Pros
  • Increased security from attacks
Cons
  • Increased inconvenience due to needing both for access

Thus, in this example, we see that although having an RSA Secure ID gives us an extra layer of security, we need to use it every time we want to access our account. This may become tedious if we need to log in frequently. An optimization in one place almost always degrades another aspect elsewhere.

Incommensurate Scaling

Not all properties improve and scale at the same rate.

Economies of Scale - Pin Factory

An example of economies of scale is Adam Smith's example of the pin factory. Say that there is a village. In this village, the townsfolk need pins for everyday life. One way to approach this problem is to have the villagers manually make the pins themselves every time the need arises. However, Smith proposed an better solution. He stated that a factory that specializes in making pins would be able to pump out more pins at a cheaper cost per pin. Since the cost per pin scales well with the number of customers, this is an example of economies of scale.

Diseconomies of Scale - Ethernet Switches

We notice that for a small number of ports, Ethernet switches are cheap and easy to obtain. However, we notice an opposite trend compared with Adam Smith's Pin Factory: as the number of ports increases, the price of such a switch increases dramatically. Since the price does not scale well with the number of ports, this is an example of diseconomies of scale.

Emergent Properties

Unanticipated properties due to scaling.

Napster and Torrents

UCLA got a massive boost to network speed. Professors and faculty were pleased that the students would have much speedier access to the Internet. For example, scholarly articles would be no problem to download. However, students misused this privilege and hopped onto torrents and Napster in order to illegally obtain songs, games, movies, and shows.

Computer Worms

When the internet was first made, everyone knew each other for the most part. Therefore, using the Internet for malicious intent was out of the question. However, with the exponential expansion of the internet, worms were developed and infected many unwitting machines. Of course, the machines were ill-prepared for such an event, since it was completely new and unanticipated.

Tacoma Narrows Bridge

Engineers had built many moderately sized bridges that could withstand earthquakes and other natural phenomena. The Tacoma Narrows Bridge was special because nothing of its scale was ever constructed. Thus, the builders never predicted that the wind would match the resonant frequency of the bridge. This lack of foresight cost them the bridge on November 7, 1940.

Propagation of Effects

Seemingly small and/or unrelated occurrences in one area may have large ramifications in another area via a chain of events (e.g. butterfly effect).

Ronald Reagan's Presidency

In the 1930's, a Hollywood actor got depresed and shot himself. A radio man was hired in his stead--Ronald Reagan. Some say that Reagan would not have become president if he did not gain early exposure via this movie.

These sort of things happen naturally all the time in chaotic systems.

However, note that these can also happen in engineered systems:

Japanese Encoding

Although a byte was enough to encode English, it isn't enough for Chinese, Japanese, and a slew of other languages with myriads of symbols. Therefore, Microsoft decided to use two bytes to represent Japanese characters. If the first bit is switched on, the rest of the bits will encode the actual character. However, there was a completely separate module in Windows that parsed filenames (e.g. C:\ProgramFiles\).

Unfortunately, this parser never took the multibyte encoding into account. Therefore, if we tried to copy a file to a directory, and the directory was written in a language that requires a multibyte encoding, we could get a strange error: "no directory named \usr\bin\[?]" If the bits in the second byte arranged themselves in such a way to form a '\', the filesystem would get confused and think that you are trying to copy a file to a directory that doesn't exist.

One way to fix this is to change the filename parser to recognize that its in English mode or Japanese mode.

A better way to fix this is to not use an encoding where random bytes look like ASCII characters. For example, we could use UTF-8. The downside to this is that it is less efficient because we use more bytes to encode characters.