Chapter 1
CS 1550: Introduction to Operating Systems
- Prof. Ahmed Amer
CS 1550: Introduction to Operating Systems Prof. Ahmed Amer - - PowerPoint PPT Presentation
CS 1550: Introduction to Operating Systems Prof. Ahmed Amer amer@cs.pitt.edu http://www.cs.pitt.edu/~amer/cs1550 Chapter 1 Class outline Introduction, concepts, review & historical perspective Processes Synchronization
Chapter 1
Chapter 1
2 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Synchronization Scheduling Deadlock
Chapter 1
3 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
User interface to the operating system Anatomy of a system call
Chapter 1
4 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
A program that runs on the “raw” hardware and supports
Resource Abstraction Resource Sharing
Abstracts and standardizes the interface to the user across
Virtual machine hides the messy details which must be performed
Manages the hardware resources
Each program gets time with the resource Each program gets space on the resource
May have potentially conflicting goals:
Use hardware efficiently Give maximum performance to each user
Chapter 1
5 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
First generation: 1945 – 1955
Vacuum tubes Plug boards
Second generation: 1955 – 1965
Transistors Batch systems
Third generation: 1965 – 1980
Integrated circuits Multiprogramming
Fourth generation: 1980 – present
Large scale integration Personal computers
Next generation: ???
Systems connected by high-speed networks? Wide area resource management?
Chapter 1
6 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Enter it into the computer (might require rewiring!) Run it Record the results
Computer was idle during first and last steps Computers were very expensive!
Chapter 1
7 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Bring cards to 1401 Read cards onto input tape Put input tape on 7094 Perform the computation, writing results to output tape Put output tape on 1401, which prints output
Chapter 1
8 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
$END $RUN $LOAD
$FORTRAN $JOB, 10,6610802, ETHAN MILLER
Chapter 1
9 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Operator read cards onto disk attached to the computer Computer read jobs from disk Computer wrote job results to disk Operator directed that job results be printed from disk
Computer overlapped I/O of one job with execution of
Better utilization of the expensive CPU Still only one job active at any given time
Chapter 1
10 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Multiple jobs in memory
Protected from one another
Operating system protected
Resources (time, hardware)
Still not interactive
User submits job Computer runs it User gets results minutes
Chapter 1
11 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Initially used for batch systems Cheaper hardware terminals -> interactive use
No more “priesthood” Quick turnaround meant quick fixes for problems
Chapter 1
12 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
13 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
14 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
15 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Goal: really large memory with very low latency
Latencies are smaller at the top of the hierarchy Capacities are larger at the bottom of the hierarchy
Solution: move data between levels to create illusion of large
Chapter 1
16 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Data stored on surfaces
Up to two surfaces per platter One or more platters per disk
Data in concentric tracks
Tracks broken into sectors
256B-1KB per sector
Cylinder: corresponding
Data read and written by
Actuator moves heads Heads move in unison
Chapter 1
17 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Single base/limit pair: set for each process Two base/limit registers: one for program, one for data
Chapter 1
18 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Left: sequence as seen by hardware
Request sent to controller, then to disk Disk responds, signals disk controller which tells interrupt controller Interrupt controller notifies CPU
Right: interrupt handling (software point of view)
Chapter 1
19 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
20 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Address space (memory) the
State (registers, including
Process tree tracks these
A is the root of the tree A created three child processes:
C created two child processes: E
D created one child process: G
Chapter 1
21 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Processes have three
Text: program code Data: program data
Statically declared variables Areas allocated by malloc()
Stack
Automatic variables Procedure call information
Address space growth
Text: doesn’t grow Data: grows “up” Stack: grows “down”
Chapter 1
22 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
23 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
24 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Processes want to exchange information with each other Many ways to do this, including
Network Pipe (special file): A writes into pipe, and B reads from it
Chapter 1
25 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Access a file Create a process Others…
Program passes relevant information to OS OS performs the service if
The OS is able to do so The service is permitted for this program at this time
OS checks information passed to make sure it’s OK
Don’t want programs reading data into other programs’ memory!
Chapter 1
26 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
System call:
Program pushes arguments,
Library sets up trap, calls
OS handles system call Control returns to library Library returns to user
Chapter 1
27 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
28 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
29 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
30 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Chapter 1
31 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Allows users to run any x86-based OS on top of Linux or NT
Only virtual machine fails—rest of underlying OS is fine
Virtual machine keeps things separated
Chapter 1
32 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)
Processes (clients and OS servers) don’t share memory
Communication via message-passing Separation reduces risk of “byzantine” failures
Examples include Mach
Chapter 1
33 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt)