Professor: Paul Eggert
Course web site is here. This includes information on TAs and office hours.
Please ask about assignment questions on Piazza. (Sign up as a student under CS 111: Operating Systems Principles [Spring 2014].)
Textbook: Principles of Computer System Design by Saltzer and Kaashoek.
This is the MIT book; we only cover parts of it. It is written from
the viewpoint of operating systems being an application of systems in general, rather than a separate part of computer science.
For next class: Read through the beginning of chapter 1, to 2.3.
Official Numbers (registrar) | Actual Numbers (reality) | |
Lecture | 4 | 3.7 |
Lab (discussion) | 2 | 1.7 |
Outside Study | 9 | 20 |
Item | Count | Fraction of Grade (each) | Notes |
---|---|---|---|
Midterm | 1 | 1/9 | 100 minutes (in class). Open-book/-note, but no electronics. |
Final | 1 | 2/9 | 180 minutes. Open-book/-note, but no electronics. |
Labs | 4 | 1/12 (1/3 total) | Teams of 1 or 2. Teams can be different each time. |
Mini-labs | 2 | 1/15 (2/15 total) | To be done solo. 'WeensyOS' on syllabus. |
Design problem | 1 | 1/15 (2/15 total) | Can be done in teams of 2. Pick 1 of 4 labs to extend. Include a report. |
Scribe notes | 1 | 1/20 | Can be done in teams of 4. Due on CourseWeb one week after the corresponding lecture. |
Research paper | 1 | 1/15 | 2-3 pages summarizing recent work done in an open area of operating systems; topics will be suggested later. |
Background: N virtual servers run atop a real server with a file system. One directory exists for each virtual server in root. Users of one virtual server can only see the contents of that virtual server’s directory.
Virtual servers are backed up from the server (which has root access) using the command:
tar -cf of /dev/rmt
(tape storage device). This walks through the entire tree, finds all files, and stores the files sequentially to tape.
Virtual servers (e.g., virtual server 5) can be restored by technicians using the command: tar –xf /dev/rmt/vm5
. This should only grab files found in sub-tree vm27.
ln -s ../vm6/etc/passwd myfile
. This doesn't work because if you try to cat /myfile
, the system resolves to no such file.cd /
echo foo > myfile
rm myfile
ln –s /vm6/etc/passwd
Background: The DNS (Domain Name System) maps URL addresses to IP addresses. Root servers located around the globe resolve URL requests down a certain number of levels. Root servers know about .edu and ucla.edu, but may not know about cs.ucla.edu, so they would ask a subsidiary server (e.g., dns.ucla.edu) to resolve cs.ucla.edu.
The problem with this system was that it took too long to resolve URL requests. The browser would appear hung up during the time it took to resolve a URL request. To speed up the URL resolution process, DNS servers were given a cache to store recently resolved addresses.
Here, only one URL can be hijacked at a time. However, in 2008, Dan Kaminsky discovered how to make the attack more plausible by hijacking an entire domain instead of individual IP addresses. There is not yet a complete fix for this vulnerability.
By studying operating systems, you can avoid such flaws in your software.
"We don't offer a ready-made programme, but an entire operating system."
--Marina Weisband, Political Director, Pirate Party Germany (in translation in The Economist)
The term 'operating system' is being used by younger politicians, but what is an operating system? Let’s begin our search for a definition by starting with 'system'.
system, Oxford English Dictionary (original, 1928):
I. an organised or connected group of objects.
II. a set of principles, etc.; a scheme, a method.
Etymology: Greek for for 'organized whole', 'government', 'constitution', 'body of people or animals', 'musical interval', 'group of connected verses in a poem'.
There seems to be no clear definition of 'system', but there is a common theme of a group and connectedness.
operating system, American Heritage Dictionary (4th ed., 2000):
software designed to control the hardware of a specific data processing system in order to allow users and application programs to make use of it.
Among other shortcomings of this definition, the word 'specific' suggests very obsolete technologies, before cross-machine software.
From Encarta: master control program of a computer.
'Who's in charge?'
From Wikipedia (602065231, 05:09, 31 March 2014):
A collection of software that manages computer hardware, resources and provides common services for computer programs.
The best definition of 'operating system' seems to be from Wikipedia. The operating system has taken a step away from controlling and towards managing.
Textbook's definition: A system is a set of interconnected components that has a specified behavior observed at the interface within its environment.
Trade-offs. After you achieve a goal in one part of your system, other aspects of your system will become at least slightly worse.
Example: Sorting a somewhat large array.
We want to sort a 1-GB array of 2^20 entries that are 1KiB each.
We could do a quicksort:
qsort(a, I<<20, I<<10, cmp)
. This is O(N log N).
However, it would be faster to quicksort an index array of 4-byte integers holding pointers to each element in the array:
qsort(i, I<<20, sizeof(int), cmp')
This way, the copying overhead is reducted by a factor of 256. However, there are a number of drawbacks:
Not everything scales at the same rate.
Economies of scale: Adam Smith
used the example of a pin factory to show the advantages of division/specialization: A town can produce
many more pins if a few people form a pin factory to handle the entire supply of pins, as opposed to if
everyone makes their own pins as needed.
Waterbed effect disadvantage: There will be some waste/overproduction.
There are also diseconomies of scale: For example, a 100Base-T switch.
100Base-T networks use a star topology. This sort of network layout is cheap for n<=8, but no more nodes.
Really big (>1000) switches of this sort are not produced, because the central part of the switch does not scale well.
As another example, O(N^2) algorithms also do not scale well.
Example: A change in a module of a system affects other parts, which may lead to a crash. This happens all the time in chaotic systems (including things like earthquakes), and we’ll deal with this in the next lecture. An important requirement of most system designs is to limit the impact of failures.