review-midterm

Download Report

Transcript review-midterm

Operating Systems
Operating Systems
Midterm review:
– closed book
– multiple choice
– chapters 1 to 9
Chapter 1&2: The Basics
• kernel mode or kernel space
• user mode or user space
• system call:
– user mode program invokes kernel mode
functionality
COP 5994 - Operating Systems
2
Chapter 2: Operating System
Architectures
•
•
•
•
monolithic
layered
micro-kernel
distributed
COP 5994 - Operating Systems
3
Chapter 3: Process
end
begin
COP 5994 - Operating Systems
4
Process Control Blocks Execution context
COP 5994 - Operating Systems
5
Context Switch
COP 5994 - Operating Systems
6
Interrupt Processing
COP 5994 - Operating Systems
7
Chapter 4: Thread vs.
Process
COP 5994 - Operating Systems
8
Combining User- and Kernel-level
Threads
m-to-n thread mapping:
COP 5994 - Operating Systems
9
Chapter 5: Concurrent
execution
• System has more than one
thread/process
• either independent or in cooperation:
– mostly independent
– occasionally need to communicate or
synchronize
COP 5994 - Operating Systems
10
Mutual exclusion algorithm
• General structure of process Pi (vs. Pj)
do {
entry protocol
critical section
exit protocol
remainder section
} while (true);
COP 5994 - Operating Systems
11
Semaphore
• Software construct to enforce mutual
exclusion
• Contains a protected variable:
– accessed via wait and signal commands
P
V
• binary semaphore: 0 or one
• counting semaphore
COP 5994 - Operating Systems
12
Chapter 6: Monitor
• Programming language construct
– Contains data and procedures needed to
access shared resource
• resource accessible only within the monitor
• Supports:
– mutual exclusion
– synchronization
• Dijkstra, Brinch-Hansen, Hoare
COP 5994 - Operating Systems
13
Chapter 7: Conditions for Deadlock
• Mutual exclusion
– resource accessed by only one process at a time
• Hold-and-wait-for
– process holds resource(s) while waiting for other
resource(s)
• No-preemption
– system cannot remove resource from the process until
the process has finished using the resource
• Circular-wait
– processes are in a “circular chain” where each process
is waiting for resource(s) of next process in chain
COP 5994 - Operating Systems
14
Chapter 8: Processor
scheduling
COP 5994 - Operating Systems
15
Scheduling Criteria
•
CPU utilization
– keep the CPU as busy as possible
• Throughput
– # of processes that complete per time unit
• Turnaround time
– amount of time to execute a process
• Waiting time
– time a process has been waiting in the ready queue
• Response time
– time from request until first response is produced
COP 5994 - Operating Systems
16
Chapter 9: Memory
COP 5994 - Operating Systems
17
Evolution of memory organization
COP 5994 - Operating Systems
18
Preparation:
• Self review questions
• Chapter exercises
COP 5994 - Operating Systems
19