CS 111 Lecture 1 Scribe Notes (Spring 2013)
prepared by Barry Beckemeyer and Fred Westenberg
for a lecture by Professor Paul Eggert on
April 2, 2013
* For next time - read chapters 1-2.3
Table of Contents
- Course Logistics
- Professor and TA
- Website and Textbook
- Prerequisites
- Work Load
- Assignments and grading
- What is an operating system?
-
- What is a system?
- What is an operating system?
- What do we want from an operating system?
- Problems when building operating systems
- Trade-offs
- Incommensurate scaling
- Emergent properties
- Propagation of effects
Course Logistics
Professor and TA
Professor: Paul Eggert - eggert@cs.ucla.edu
Office Hours: Monday 14:00-15:00 and Thursday 13:30-14:30
in Boelter 4532J.
Teaching Assistant: Weiguang Si - forswg@cs.ucla.edu
Office Hours: TBD in Boelter 2432
Website and Textbook
Website: http://cs.ucla.edu/classes/winter13/cs111/
Textbook: Jerome H. Saltzer and M. Frans Kaashoek,
Principles of Computer System Design: An Introduction,
Morgan Kaufmann (2009). ISBN 978-01-2374957-4(printed).
Prerequisites
Required | |
Recommended |
CS 31 - Intro to Programming | |
CS 131 - Programming Languages |
CS 32 - C++ Programming and Algorithms | |
CS 118 - Networking Fundamentals |
CS 35L - Unix Laboratory | |
CS M151B - Computer Systems Architecture |
Note: This course is a required prereq for CS 118 and
a recommended prereq for CS M151B.
Work load
Proposed hours/week | |
Actual hours/week |
Lecture: 4 hrs/wk | |
~ 3.6 hrs/wk |
Lab: 2 hrs/wk | |
~ 1.7 hrs/wk |
Outside Study: 9 hrs/wk | |
~ 20 hrs/wk (Mostly programming) |
Assignments and grading
Weight | Assignment |
1/9 |
Midterm
- Open book, open note
- 1.8 hours
|
2/9 |
Final
- Open book, open note
- 3 hours - Monday, June 10, 2013 at 3:00 PM
|
1/3 |
Labs
- 4 labs, 1/12 each
- Shell
- File System
- Driver
- Something distributed
- Recommended to work in teams of 2
|
2/15 |
Mini-labs
- 2 minilabs, 1/15 each
- Scheduling
- Virtual Memory
- "Toy Projects" - Individual work
|
1/12 |
Design Problem
- Extension of one lab, due 1 week after lab
with presentation and slides due 1 week after that
- Teams of 2, presentation and written report
|
1/15 |
Research Paper
- 2-3 page paper on OS issue of choice
- Due at end of 10th week
|
1/20 |
Scribe Notes
- Notes from one lecture for classmates
- Worked on in teams up to 4 members
- Done in HTML 4.0.1 or HTML 5.
- Due one week after lecture**
|
**: Exceptions for Scribe Notes: The lecture one week before the midterm is due two days before the midterm, and lectures during last week are due friday of last week.
All assignments are due at 23:59:59 on date specified by
course website. The grading policy is as follows.
Points taken off = 2N-1, where N is the number of days late.
Important: Drop-dead date is Friday of 10th week. ALL assignments are due at this time. No credit will be received on assignments submitted after this.
What is an operating system?
"We don't offer a ready-made program, but an entire operating system"
-Marina Weisband on the German Pirate Party
What is a system?
Oxford English Dictionary(1928):
- an organized or connected group of objects
- a set of principles etc., a scheme, method
- from Greek: an organized whole, government, constitution, a body of people or animals
Textbook(Principles of Computer System Design: An Introduction, 2009):
- A system is a set of interconnected components that has a specified behavior observed at the interface with its environment
What is an operating system?
American Heritage Dictionary 4th edition(2000):
- software designed to control the behavior of a specific data processing system in order to allow users and application programs to make use of it
Comments on this definition:
- Control isn't really the right word, the hardware is still in control, the OS is more of a manager of the hardware
- An OS shouldn't be limited to a single type of "data processing system," or computer, it should be portable across many machines
Encarta(2007):
- master control program in a computer
Comments on this definition:
- Encarta is Bill Gates', or more specifically Microsoft's, dictionary. The definition is much simpler than the American Heritage definition, but still has that pesky control word in it.
Wikipedia(version 548325344- 2013-4-2):
- a collection of software that manages computer hardware resources and provides common services for computer programs
Comments on this definition:
- This definition is the best of the ones we've looked at
- OS doesn't control the hardware but manages it
What do we want from an operating system?
- Protection - against total failures, security attacks
- Robustness - against unusual, but not necessarily invalid, requests
- Consistency/Simplicity
- Performance - CPU, power, RAM, network
- Flexibility - for programmers
- Functionality - everything works
Problems when building operating systems
Trade-offs: The Water Bed Effect
Merge-Sort: Time-Space Tradeoff
Consider a large array of 107 items to be sorted, each 100 bytes large. If we use Merge-Sort, an optimization could be to sort 4-byte pointers instead of 100-byte items.
Solution: Sort array of pointers to data |
Pros |
-
+ Speed (Sort pointers, 25x speedup)
|
Cons |
-
- Space (Need 4% more memory to store pointers)
|
Authentication: Convenience-Security Tradeoff
Two standard types of authentication are passwords and hardware tokens (such as a car key). Using a combination of these can optimize security.
Solution: Require both password and hardware key |
Pros |
-
+ Security (Attackers need both key and password)
|
Cons |
-
- Convenience (Must always have key and know password)
|
Incommensurate scaling
Not everything scales at the same rate.
- Economies of scale - Pin Factory
Mass producing an item (such as pins) can cause the per unit cost to go down as the total production goes up. The downside of this is waste (too many pins).
Diseconomies of scale - Ethernet Switches
The per unit cost can sometimes scale up as the total production goes up. Consider a 4-way router and a 500-way router. The 4-way router is cheap and easy to make. A 500-way router is very complex and requires on the order of (n2) communications, making it very expensive. This may also result in breakage when too many ports are stuffed into a router.
Emergent properties
There can be unanticipated properties that emerge from scaling.
- Tacoma Narrows Bridge
We had been building bridges for centuries, but we had never built a bridge big enough for the resonant frequency to be matchable by the wind. This caused the entire bridge to collapse because the engineers did not account for side-effects of increasing bridge size.
- Campus Dorms on High Speed Internet
No one predicted that once high speed internet was put into the UCLA dorms, 90% of the internet traffic would be pirated material.
Propagation of effects
Natural property of chaotic systems; a small effect can snowball into a huge problem
Japanese Characters
There are so many Japanese characters that they cannot be represented in only one byte in the way the english characters can. So Microsoft chose to represent them using two bytes, and mark the Japanese characters by starting with a 1 bit, and the standard characters with a 0 bit. This system worked in most situations, but failed in a very specific situation involving the command line.
The problem involved a japanese-designated byte encoding to a forward slash, causing the word to be interpreted as a directory. A solution for this could be to not interpret every slash as a real slash in japanese environments.