Beruflich Dokumente
Kultur Dokumente
Spring 2007
- Processes Processes
Basic Concepts
Context Switching
Process Queues
Process Scheduling
Process Termination
Tevfik Koar
Operating System Design and Implementation Operating System Design and Implementation (Cont.)
Start by defining goals and specifications Important principle: to separate policies and
Affected by choice of hardware, type of system mechanisms
Batch, time shared, single user, multi user, distributed Policy: What will be done?
User goals and System goals Mechanism: How to do something?
User goals operating system should be convenient to use, easy Eg. to ensure CPU protection
to learn, reliable, safe, and fast
Use Timer construct (mechanism)
System goals operating system should be easy to design,
How long to set the timer (policy)
implement, and maintain, as well as flexible, reliable, error-
free, and efficient The separation of policy from mechanism is allows
No unique solution for defining the requirements of an maximum flexibility if policy decisions are to be
OS changed later
Large variety of solutions
Large variety of OS
3 4
5 6
1
UNIX
MS-DOS Layer Structure
UNIX limited by hardware functionality, the
original UNIX operating system had limited
structuring. The UNIX OS consists of two separable
parts
Systems programs
The kernel
Consists of everything below the system-call interface and
above the physical hardware
Provides the file system, CPU scheduling, memory
management, and other operating-system functions; a large
number of functions for one level
7 8
9 10
11 12
2
Modules Solaris Modular Approach
13 14
15 16
17 18
3
Virtual Machines (Cont.)
VMware Architecture
The virtual-machine concept provides complete
protection of system resources since each virtual
machine is isolated from all other virtual machines.
This isolation, however, permits no direct sharing
of resources.
A virtual-machine system is a perfect vehicle for
operating-systems research and development.
System development is done on the virtual
machine, instead of on a physical machine and so
does not disrupt normal system operation.
The virtual machine concept is difficult to
implement due to the effort required to provide an
exact duplicate to the underlying machine
19 20
Processes
21 22
4
Process Control Block (PCB) Context Switch
Information associated with each
When CPU switches to another process, the system
process
must save the state of the old process and load the
Process state saved state for the new process
Program counter Context-switch time is overhead; the system does no
CPU registers useful work while switching
CPU scheduling information Time dependent on hardware support
Memory-management
information
Accounting information
I/O status information
25 26
27 28
29 30
5
Schedulers Schedulers (Cont.)
31 32
In time-sharing systems: remove processes from Parent process create children processes, which, in
memory temporarily to reduce degree of turn create other processes, forming a tree of
multiprogramming. processes
Later, these processes are resumed Swaping Resource sharing
Parent and children share all resources
Children share subset of parents resources
Parent and child share no resources
Execution
Parent and children execute concurrently
Parent waits until children terminate
33 34
6
A tree of processes on a typical Solaris Any Questions?
sched: root process for OS
pageout: manages memory
fsflush: manages file system
init: root for user processes
inetd: Networking
Hmm..
Hmm..
dtlogin: user login screen
37 38
Read chapter 3 from Silberschatz. Operating Systems Concepts book and supplementary
material by Silberschatz, Galvin and Gagne.
39 40