Chapter 7
Chapter 7
Computer Organization
and Architecture
Chapter 7
Operating System
Support
1
Objectives and Functions
Convenience
Making the computer easier to use
Efficiency
Allowing better use of computer resources
2
Layers and Views of a
Computer System
3
Operating System Services
Program creation
Program execution
Access to I/O devices
Controlled access to files
System access
Error detection and response
Accounting
4
O/S as a Resource Manager
5
Types of Operating System
Interactive
Batch
Single program (Uni-programming)
Multi-programming (Multi-tasking)
6
Early Systems
7
Simple Batch Systems
8
Job Control Language
Instructions to Monitor
Usually denoted by $
e.g.
$JOB
$FTN
... Some Fortran instructions
$LOAD
$RUN
... Some data
$END
9
Desirable Hardware Features
Memory protection
To protect the Monitor
Timer
To prevent a job monopolizing the system
Privileged instructions
Only executed by Monitor
e.g. I/O
Interrupts
Allows for relinquishing and regaining control
10
Multi-programmed Batch
Systems
11
Single Program
12
Multi-Programming with
Two Programs
13
Multi-Programming with
Three Programs
14
Time Sharing Systems
15
Scheduling
Key to multi-programming
Long term
Medium term
Short term
I/O
16
Long Term Scheduling
17
Medium Term Scheduling
18
Short Term Scheduler
Dispatcher
Fine grained decisions of which job to execute
next
i.e. which job actually gets to use the processor
in the next time slot
19
Process States
20
Process Control Block
Identifier
State
Priority
Program counter
Memory pointers
Context data
I/O status
Accounting information
21
Key Elements of O/S
22
Process Scheduling
23
Memory Management
Uni-program
Memory split into two
One for Operating System (monitor)
One for currently executing program
Multi-program
“User” part is sub-divided and shared among active
processes
24
Swapping
25
What is Swapping?
27
Fixed
Partitioning
28
Variable Sized Partitions (1)
30
Effect of Dynamic Partitioning
31
Relocation
34
Virtual Memory
Demand paging
Do not require all pages of a process in memory
Bring in pages as required
Page fault
Required page is not in memory
Operating System must swap in required page
May need to swap out a page to make space
Select page to throw out based on recent history
35
Thrashing
Solutions
Good page replacement algorithms
Reduce number of processes running
Fit more memory
36
Bonus
38
Segmentation
39
Advantages of Segmentation
40
Required Reading
Stallings chapter 7
Stallings, W. Operating Systems, Internals and
Design Principles, Prentice Hall 1998
Loads of Web sites on Operating Systems
41