Chapter 8: Operating System Support

Download Report

Transcript Chapter 8: Operating System Support

Chapter 8: Operating System
Support
CS 147 Fall 2010
Lester Tam
What is an OS (Operating System)?



Program that manages the computer’s
resources
Provides services for programmers
Schedules the execution of other programs
Types of OS

Interactive or batch?
–
–

Interactive: Direct communication
Batch: Queued programs
Multiprogramming or uniprogramming?
–
–
Multiprogramming: Keep the OS as busy as
possible
Uniprogramming: One at a time
Scheduling

Four types of scheduling
–
–
–
–
Long-term scheduling
Medium-term scheduling
Short-term scheduling
I/O scheduling
Five State Model Process

Used by the short-term scheduler
–
–
–
–
–
New
Ready
Running
Waiting
Halted
Process Control Block

Information kept by OS on every process
–
–
–
–
–
–
–
–
Identifier
State
Priority
Program counter
Memory pointers
Context data
I/O status information
Accounting information
Memory Management

Swapping
–

Processes are swapped into Intermediate queue
Partitioning
–
–
Fixed-sized partitions
Variable-size partitions
Compaction


Even with dynamic partitioning, memory will
become fragmented
The OS will need to “defrag” the memory
occasionally
–
–
Time consuming
Process may shift in main memory
Paging



Suppose memory is divided into small equal
fixed-size chunks (frames)
Same for processes (pages)
Wasted space in memory a fraction of
variable partitioning
Virtual Memory




Demand paging – brought in when needed
(on demand)
At any time, only a few pages are loaded
Time saved by not having to swap
However, can lead to thrashing
–
Lead to development of complex algorithms to try
to prevent it.
Questions?