Week 1 Flashcards
What does an OS do?
Virtualize resources, so every process can have the illusion of a dedicated machine.
Mange I/O so multiple processes can access devices (disk, network card, etc.). concurrently without interfering
Make the above easy - define simple unambiguous interfaces (syscalls).
What were computers like in the early 1950s?
Were used for scientific computing and processing large datasets
Batch mode: submit a large computation,
wait for result, submit another one
Basically a very powerful calculator used by one operator at a time - no need for OS
What did early machines have (1950s) that is now consider part of any OS.
Libraries of functions. The reason was convenience.
Still no virtualization (one program at a time). No mediation (any program could still do whatever they wanted).
What were computers like in the 1960s?
There was separation. There was an idea to give the CPU two execution modes:
An unprivileged mode and a privileged mode.
How do we implement separation? How do we switch between the two modes?
The CPU defines some type of trap. An instruction to switch into OS code and back.
The app can pass execution and parameters to the OS, but cannot define the code that the OS is going to execute.
In separation there is the concept of the ring of fire. What are rings 0-3 used for?
Ring 0 (Most privileged) - Kernel
Ring 1 - Device Drivers
Ring 2 - Device Drivers
Ring 3 (Least privileged) - Applications
True or false. The OS will allow multiple processes to write to the disk without coordination.
This is false.
What was programming like in the 1970s?
Many processing tasks were still I/O bound
There was the introduction of multiprogramming which meant that you could let multiple processes run at the same time and switch between them when appropriate.
How do we enable multiprogramming?
There are several things but the most important thing is memory protection.
The solution to this is virtual memory.
What did UNIX provide as an OS?
UNIX was the first widely available OS which implemented storage (file system), time sharing (splitting CPU time), etc.
What were computers like in the 1980s?
Companies like IBM and Apple started selling PCs.
PCs shipped with very simple OS’es which lacked proper protection and multiprogramming capabilities.
Example: MS DOS had no memory protection.
What are computers like 1990s to today?
OSes improved from the 90s.
They now had true memory protection capabilities.
True multiprocessing/threading (the OS controls how processes share the CPU).
Robust, performant file systems.
What is CPU virtualization?
This is when we “slice” a CPU
An OS needs to be able to run a program, and stop a program. It should decide which program should run at any given time.
Means that we divide CPU time across programs fairly.
What is memory virtualization.
When we give every process the same virtual address space.
In other words each process gets the illusion of having memory to itself.
Mapping between virtual and physical pages can change.
Mapping is not necessarily 1:1. Resources are used by multiple processes.
How is concurrency different from sharing CPU?
CPU virtualization just means that multiple processes can share the CPU.
However in concurrency, different parts of your program cooperate to complete a task.