212 Chapter11
212 Chapter11
Operating Systems
Chapter 11
Operating Systems
Chapter Outline
Contains a set of
functions
executed by
application
programs and the
Command Layer
Manages
resources and
interacts directly
with the
The Kernel
Components
Resource Allocation
• Single-tasking and multitasking
– Application
• MS-DOS
• Virtual resources
– Resources that are apparent to a
process or user
– Meet or exceed real resources by
• Rapidly shifting resources unused
by one program to other programs
that need them
• Substituting one type of resource
for another
Process Management
A process is a unit of executing software
managed independently by OS
– Parent process
– Child process
– Sibling process
– Process family
Threads
• Portion of a process that can be scheduled
and executed independently
• Running
– Retains control of CPU until the
thread or its parent process
terminates normally or an interrupt
occurs
• Blocked
– Waiting for some event to occur
(completion of service request or
correction of an error condition)
Thread States
Movement Between States
Interrupt Processing
• CPU automatically suspends currently
executing thread, pushes current
register values onto the stack, and
transfers control to OS master
interrupt handler
• Typical methods
– Preemptive scheduling
– Priority-based scheduling
– Real-time scheduling
Preemptive Scheduling
• A thread can be removed involuntarily
from the running state
Interrupt
Processing
Processing steps
on right
occur after
I/O device completes
I/O operation.
Timer Interrupts
• Generated at regular intervals by CPU
to give scheduler an opportunity to
suspend currently executing thread
– Explicit priority
• Address resolution
Memory is divided
into fixed-sized
partitions.
Multi-
tasking
Memory
Allocati
on
Processes are
allocated memory
partitions to store
instructions and
data.
Multi-
tasking
Memory
Allocati
on
The
Operating
System
maintains
tables to
track
partition
allocations
and free
Memory Fragmentation
• As memory becomes more fragmented,
larger processes have increasing
difficulty finding enough contiguous
partitions
Resource allocation
Process management
CPU allocation
Memory allocation
Chapter Goals
• Describe the functions and layers of an
operating system
• List the resources allocated by the
operating system and describe the
complexities of the application process
• Explain how an operating system
manages processes and threads
• Compare and contrast alternative CPU
scheduling methods
• Explain how the operating system
manages memory