Operating Systems - PowerPoint PPT Presentation

1 / 48
About This Presentation
Title:

Operating Systems

Description:

Describe how an operating system manages processes and threads ... Describe signals and pipes and how they coordinate threads and processes ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 49
Provided by: paulawor
Category:

less

Transcript and Presenter's Notes

Title: Operating Systems


1
Operating Systems
  • Chapter 11

2
Objectives
  • Describe the functions and layers of an operating
    system
  • List the resources allocated by the operating
    system and describe the complexities of the
    allocation process
  • Describe how an operating system manages
    processes and threads
  • Compare and contrast alternative CPU scheduling
    methods
  • Explain how the operating system manages memory
  • Describe signals and pipes and how they
    coordinate threads and processes

3
Chapter Topics
4
Operating System Overview
  • Operating System Management Functions
  • Oversees all hardware resources and allocates
    them to user and applications as needed
  • Performs many low-level tasks on behalf of users
    and application programs

5
Operating System Overview
6
Operating System Overview
  • Operating System Layers
  • Command Layer (shell) the users interface to
    the operating system
  • Service Layer contains a set of functions
    called by application programs and the command
    layer
  • Kernel manages resources and directly interacts
    with computer hardware

7
Operating System Overview
8
Operating System Overview
9
Resource Allocation
  • Resource Allocation Process
  • Keeps detailed records of available resources
  • Knows which resources are used to satisfy which
    requests
  • Schedules resources based on specific allocation
    policies to meet present and anticipated demands
  • Updates records to reflect resources commitment
    and release by processes and users

10
Resource Allocation
  • Single Process Resource Allocation (application
    program and operating system)
  • When an application program begins executing, the
    operating system grants it control of all unused
    resources
  • Most service calls are actually indirect requests
    for system resources

11
Resource Allocation
  • Multiple Process Resource Allocation
  • Multitasking operating systems are the norm for
    general-purpose computers
  • Multitasking operating systems must be able to
    handle multiple programs and users
  • A multitasking operating system manages hardware
    resources to achieve the following
  • Meet the resource needs of processes
  • Prevent processes from interfering with one
    another
  • Efficiently use hardware and other resources

12
Resource Allocation
  • Real and Virtual Resources
  • Real resource a computer systems physical
    devices and associated system software
  • Virtual resource the resources that are
    apparent to a process or user

13
Process Management
  • Process Control Data Structures
  • A process is a unit of executing software that is
    managed independently by the operating system
  • A process can request and receive hardware
    resources and operating system services

14
Process Management
  • Process Control Data Structures
  • Process Control Block (PCB) keeps track of each
    process by creating and updating a data structure
  • The PCB is created when the process is created,
    updated when the process changes and deleted when
    the process terminates.

15
Process Management
  • Data included in a PCB
  • A unique process identification number
  • The current state of the process
  • Events for which the process is waiting
  • Resources allocated exclusively to the process
  • Machine resources consumed
  • Process ownership and/or access privileges
  • Scheduling priority

16
CPU Allocation
  • Concurrent Execution (Interleaved Execution)
  • A thread is a portion of a process that can be
    scheduled and executed independently.
  • It controls the CPU for no more than a few
    milliseconds before it relinquishes control and
    the operating system gives another thread a turn

17
CPU Allocation
18
CPU Allocation
  • Ready State a thread is waiting for access to a
    CPU
  • Block State the thread is suspended while an
    interrupt is being processed
  • Running State the thread has control of the
    CPU.
  • The thread or its parent process terminates
    normally
  • An interrupt occurs

19
CPU Allocation
  • Scheduling
  • Preemptive Scheduling
  • a thread can be removed involuntarily from the
    running state
  • a running process controls the CPU by controlling
    the content of the instruction pointer
  • CPU control is lost whenever an interrupt is
    received

20
CPU Allocation
  • Interrupt Processing
  • A blocked thread is waiting for an event to occur
  • If the event is the correction of an error and it
    can be corrected, the thread remains in the
    blocked state until the error condition is
    resolved otherwise, the thread is halted

21
CPU Allocation
22
CPU Allocation
23
Technology Focus
24
CPU Allocation
  • Priority-Based
  • First-come first served
  • The scheduler always dispatches the ready thread
    that has been waiting the longest.
  • Explicit priority
  • Uses a set of priority levels and assigns a level
    to each process or thread.

25
CPU Allocation
  • Shortest Remaining Time
  • Chooses the next process to be dispatched based
    on the expected amount of CPU time needed to
    complete the process.

26
Technology Focus
27
Memory Allocation
  • Single-Tasking Memory Allocation
  • Multitasking Memory Allocation
  • Memory Fragmentation
  • Noncontiguous Memory Allocation
  • Virtual Memory Management
  • Memory Protection
  • Memory Management Hardware

28
Memory Allocation
29
Memory Allocation
  • Single-Tasking Memory Allocation
  • Contiguous Memory Allocation
  • The bulk of the operating system occupies lower
    memory addresses.
  • The application program is loaded above the
    operating system.
  • The remaining space is available for user
    programs and data.

30
Memory Allocation
31
Memory Allocation
  • Multitasking Memory Allocation
  • Allow as many active processes as possible.
  • Respond quickly to changing memory demands of
    processes.
  • Prevent unauthorized changes to a processs
    memory region(s).
  • Implement memory allocation and addressing as
    efficiently as possible.

32
Memory Allocation
33
Memory Allocation
34
Memory Allocation
35
Memory Allocation
  • Memory Fragmentation
  • As processes are created, executed, and
    terminated, memory allocation changes accordingly
  • Memory partition allocation and deallocation
    leads to an increasing number of small free
    partitions separated by allocated partitions

36
Memory Allocation
37
Memory Allocation
38
Memory Allocation
39
Memory Allocation
40
Technology Focus
41
Technology Focus
42
Interprocess Communication
43
Interprocess Communication
44
Interprocess Communication
45
Interprocess Communication
46
Interprocess Communication
47
Summary
  • The operating system is complex software that
    allocates hardware resources to individual user
    processes on demand
  • The operating system stores information about
    each process in a PCB
  • Application software is simper to develop if
    programs are unaware of resource allocation
    functions

48
Summary
  • An active thread is always in one of three states
    ready, running, or blocked
  • Memory is divided into fixed-size partitions and
    processes are allocated one or more memory
    partitions to store instructions and data
  • Modern operating systems implement a form of
    memory allocation and management called virtual
    memory management
  • Processes and threads often need to synchronize
    their actions or transfer data among themselves
    using signals and pipes
Write a Comment
User Comments (0)
About PowerShow.com