Beruflich Dokumente
Kultur Dokumente
Dave Bremer
Otago Polytechnic, N.Z.
©2008, Prentice Hall
Requirements of an
Concepts
Operating System
• Fundamental Task: Process Management • From earlier chapters we saw:
– Computer platforms consists of a collection of
• The Operating System must hardware resources
– Interleave the execution of multiple processes
– Allocate resources to processes, and protect – Computer applications are developed to
the resources of each process from other perform some task
processes,
– It is inefficient for applications to be written
– Enable processes to share and exchange directly for a given hardware platform
information,
– Enable synchronization among processes.
The OS Manages
Concepts cont…
Execution of Applications
– OS provides an interface for applications to • Resources are made available to multiple
use
applications
– OS provides a representation of resources • The processor is switched among multiple
that can be requested and accessed by application
application
• The processor and I/O devices can be
used efficiently
Timeout
I/O
Change of
When to switch processes
A process switch may occur any time that the OS has gained control from the
Process State …
currently running process. Possible events giving OS control are: • The steps in a process switch are:
1. Save context of processor including program
Mechanism Cause Use counter and other registers
Interrupt External to the execution of Reaction to an asynchronous 2. Update the process control block of the
the current instruction external event
process that is currently in the Running state
Trap Associated with the execution Handling of an error or an 3. Move process control block to appropriate
of the current instruction exception condition queue – ready; blocked; ready/suspend
Supervisor call Explicit request Call to an operating system
function
Execution of the
Non-process Kernel
Operating System
• Execute kernel outside of any process
• The concept of process is considered to
apply only to user programs
– Operating system code is executed as a
separate entity that operates in privileged mode
Execution Within Process-based
User Processes Operating System
• Execution Within User • Process-based operating system
Processes – Implement the OS as a collection of system
– Operating system software within process
context of a user process
– No need for Process Switch to
run OS routine
Countermeasures: Countermeasures:
Access Control Firewalls
• A policy governing access to resources • Traditionally, a firewall is a dedicated
• A security administrator maintains an computer that:
authorization database – interfaces with computers outside a network
– The access control function consults this to – has special security precautions built into it to
determine whether to grant access. protect sensitive files on computers within the
network.
• An auditing function monitors and keeps a
record of user accesses to system
resources.
Roadmap Unix SVR4
System V Release 4
– How are processes represented and • Uses the model of fig3.15b where most of
controlled by the OS. the OS executes in the user process
– Process states which characterize the • System Processes - Kernel mode only
behaviour of processes.
• User Processes
– Data structures used to manage processes.
– User mode to execute user programs and
– Ways in which the OS uses these data utilities
structures to control process execution.
– Kernel mode to execute instructions that belong
– Discuss process management in UNIX SVR4. to the kernel.
Process Creation
After Creation
cont…
4. Increment the counters for any files owned • After creating the process the Kernel can
by the parent, to reflect that an additional do one of the following, as part of the
process now also owns those files. dispatcher routine:
5. Assign the child process to the Ready to
– Stay in the parent process.
Run state.
– Transfer control to the child process
6. Returns the ID number of the child to the
parent process, and a 0 value to the child – Transfer control to another process.
process.