CS111 : Operating System (Fall 2013)

Lecture 1 Scribe Notes

Written by: Phi Dang


1. Class Information

A. Prerequesites for CS111

Required
Optional (but helpful)

B. Actual hours per week (compared to Registrar)

C. Textbooks

Principles of Computer System Design (2009) - Saltzer and Kaashoet

D. Grading

1 Midterm (1/9 grade : ~11%)
1 Final (2/9 grade : ~22%)
4 Labs (1/3 grade : ~33%)
2 Minilabs (2/15 grade : ~13%)
1 Design Problem (1/12 grade : ~8%)
1 Scribe Note (1/20 grade : ~5%)
1 Short Paper (1/15 grade : ~6.5%)
------ Grading Policy ------

2. Introduction to Operating Systems

A. What is a system?

Attempts at defining 'system'

1. Organized whole, gov, constitution

2. A set of principles. etc: a scheme, a method.

Oxford English Dictionary (OED) - (1928)

This definition, though given decades before computers were invented, seems to capture the general idea of a computer system.

1. An organized or connected group of objects.

2. Musical interval, group of connected verses.

Greek

The Greeks' definition was even closer, because a government, which is a complicated system, can be used as an analogy for a computer system.

B. What is an Operating System?

Attempts at defining 'operating system'

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.

American Heritage, 4th edition

This definition is terrible and mostly incorrect. First, it contains a redundant phrase: "users and application programs to make use of it", because it does not add any useful information. Second, it accurately states that the operating system can only control a specific system, and most probably fail on all others.

Master control program in a computer

Encarta 2007

This definition is too generic, and does not provide any useful information.

A collection of software that manages computer hardware resources and provides common services for computer programs.

Wikipedia 574029146 (2013-09-22)

This definition seems to capture the meaning of an operating system as it stresses on managing resources, which is an important task for an operating system.

Book's definition

A system is a set of interconnected components that has a specified behavior observed at the interface with its environment.

Principles of computer system design (2009) - Saltzer and Kaashoet

C. What is System Design?

System design is about organizing components into parts so we can savely ignore details of other parts of the system. But currently, we are building systems that are way more complicated than they should be.

D. Problems with computer systems

Incommensurate scaling

Not everything scales at the same rate

Diseconomies of scale

For example: Star network (fully connected graph). Each newly added node requires an increasing number of edges to connect to the remaining stars.

Economies of scale

This leads to cheaper cost of production for higher quantity. For example: Pin factory. Instead of each person making his/her own pin when he/she needs one, a pin factory can be built to mass-produce pins at a much faster rate, e.g., throuh the use of assembly lines.

Emergent properties arise from scaling

You dont know that the problem exists until its too late. For example: Tacoma Narrows bridge. It scaled everything: longer and larger than its competitors' bridge. Hence, a new unexpected problem arose: the resonant frequency of winds.

Propagation of effects

Small internal details can leak out and cause great effects. For example, a hummingbird in California claps its wing can cause hurricane in Taiwan.

A computer system can be considered as a chaotic system, a system in which a small cause somewhere causes huge effects somewhere else.

A real-life example would be Microsoft's solution to Japanese characters. Because Japanese has more than 1000 characters, which need to be expressed as bytes. Hence, Microsoft invented a solution called 'Shift-JIS', an algorithm that allows encoding Japanese characters into multibyte characters. This is how it works:

1st byte: indicates its Shift-JIS

The rest: the character encoding

However, this generates a problem for the scenario below:

$ echo hello > 'japanese-character'.c

$ No such file or directory (because it mistakenly inteprets the file name as '/', which is a folder)

Microsoft decided to resolve this issue by allowing the propagation to exist, and simply fixing this special case. The UNIX's team, however, decided to abandon Shift-JIS and worked on a new algorithm. UNIX's solution, though more costly, is a better way to handle the problem because it is more scalable.

------ Conclusion ------

All these problems stem from one single issue: "Complexity". But where does complexity come from? The main source of complexity is that we are constantly building new systems from previous work. For example, the first computer, the UNIVAC I, contained lots and lots of errors. Hence, the UNIVAC II was designed using the UNIVAC I, except with tons of error corrections.