Chapter 11 Operating Systems

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Threads, SMP, and Microkernels
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Chapter 3 Process Description and Control
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
6/9/2015B.Ramamurthy1 Process Description and Control B.Ramamurthy.
Process Description and Control
Process Description and Control Module 1.0. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
File Management Systems
Process Description and Control Chapter 3. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Chapter 11 Operating Systems.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
CSCE 351: Operating System Kernels
3.5 Interprocess Communication
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
Computer Organization and Architecture
Chapter 12 File Management Systems
1 Operating Systems Ch An Overview. Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bare Bones Computer.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control A process is sometimes called a task, it is a program in execution.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: System Structures.
1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Chapter 3 Process Description and Control
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
6 Memory Management and Processor Management Management of Resources Measure of Effectiveness – On most modern computers, the operating system serves.
Chapter 7 Operating Systems. Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Chapter 3 Operating Systems © 2007 Pearson Addison-Wesley. All rights reserved.
Operating System Principles And Multitasking
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  What Operating Systems Do  Computer-System Organization  Computer-System Architecture  Operating-System Structure.
Chapter 3 Operating Systems. © 2005 Pearson Addison-Wesley. All rights reserved 3-2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
Process Control Management Prepared by: Dhason Operating Systems.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
Operating System (Reference : OS[Silberschatz] + Norton 6e book slides)
Processes and threads.
Process Management Process Concept Why only the global variables?
KERNEL ARCHITECTURE.
Shell & Kernel Concepts in Operating System
Operating Systems.
Operating Systems.
Process Description and Control
Process Description and Control
Threads Chapter 4.
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process Description and Control
Chapter 2 Operating System Overview
COMP755 Advanced Operating Systems
Chapter 3: Process Management
Presentation transcript:

Chapter 11 Operating Systems

Outline Functional overview of an operating system Process management Resource allocation CPU allocation Memory allocation Interprocess communication

Operating System Overview Operating System Management Functions Operating System Layers

Operating System Overview The operating system oversees all hardware resources and allocates them to user and applications as needed. The operating system performs many low-level tasks on behalf of users and application programs.

Operating System Overview Operating System Management Functions The operating system manages: Hardware resources Users and their programs

Operating System Overview Operating System Layers Command Layer Service Layer Kernel

Operating System Layers

Operating System Layers Command Layer – the user’s 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.

Outline Functional overview of an operating system Process management Resource allocation CPU allocation Memory allocation Interprocess communication

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.

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.

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

Process Management Threads A portion of a process that can be scheduled and executed independently. Process light Thread can execute concurrently on a single processor or simultaneously on multiple processors.

Outline Functional overview of an operating system Process management Resource allocation CPU allocation Memory allocation Interprocess communication

Resource Allocation Single Process Resource Allocation Multiple Process Resource Allocation Resource Allocation Processes Real and Virtual Resources

Resource Allocation Single Process Resource Allocation Involves only two executing programs – application and operating system. When an application program begins executing, the operating system grants it control of all unused resources.

Resource Allocation Single Process Resource Allocation Most service calls are actually indirect requests for system resources. MS-DOS is a single-tasking operating system.

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.

Resource Allocation Multiple Process Resource Allocation 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

Resource Allocation Resource Allocation Processes Keeps detailed records of available resources. Knows which resource 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.

Resource Allocation Real and Virtual Resources Real resource – a computer system’s physical devices and associated system software. Virtual resource – the resources that are apparent to a process or user.

Real and Virtual Resources Providing virtual resources that meet or exceed resources is accomplished by: Rapidly shifting resources unused by one process to other processes that need them. Substituting one type of resource for another when possible and necessary.

CPU Allocation Thread States Interrupt Processing Scheduling

CPU Allocation A thread controls the CPU for no more than a few milliseconds before it relinquishes control and the operating system gives another thread a turn. CPU sharing is called concurrent execution or interleaved execution.

CPU Allocation

CPU Allocation Thread States Ready Running Blocked

CPU Allocation

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

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.

Scheduling Preemptive Scheduling Priority-based Scheduling Real-time Scheduling

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.

Scheduling

Scheduling

Scheduling Priority-Based Scheduling Methods: First come First served Explicit priority Shortest time remaining

Scheduling Priority-Based: First come first served: The scheduler always dispatches the ready thread that has been waiting the longest.

Scheduling Priority-Based: Explicit priority: Uses a set of priority levels and assigns a level to each process or thread. The scheduling method can use priority levels in two ways: Always dispatch the highest priority ready thread Assign larger time slices to high priority threads

Scheduling Priority-Based: Shortest time remaining: Chooses the next process to be dispatched based on the expected amount of CPU time needed to complete the process.

Scheduling Real-Time Scheduling: Guarantees a minimum amount of CPU time to a thread if the thread makes an explicit request when it is created. Used when a thread must have enough resources to complete its function within a specified time.

Technology Focus Windows 2000 Scheduling

Technology Focus

Memory Allocation Single-Tasking Memory Allocation Multitasking Memory Allocation Memory Fragmentation Noncontiguous Memory Allocation Virtual Memory Management Memory Protection Memory Management Hardware

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.

Memory Allocation

Memory Allocation Single-Tasking Memory Allocation – Noncontiguous Memory Allocation To conserve physical memory, some operating system components are loaded into memory only when needed. When loaded, they usually are placed in upper memory.

Memory Allocation

Memory Allocation Multitasking Memory Allocation The goals of multitasking memory allocation are: Allow as many active processes as possible. Respond quickly to changing memory demands of processes. Prevent unauthorized changes to a process’s memory region(s). Implement memory allocation and addressing as efficiently as possible.

Memory Allocation

Memory Allocation

Memory Allocation

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.

Memory Allocation

Memory Allocation

Memory Allocation Noncontiguous Memory Allocation Uses small fixed-size partitions, usually no larger than 64K. A process can be loaded into more than one partition.

Memory Allocation

Memory Allocation Virtual Memory Management Divides a program into partitions called pages. Memory is divided into pages called a page frame. During program execution, one or more program pages are stored in a page frame, the remaining are stored on a secondary storage device.

Memory Allocation

Memory Allocation Memory Protection Refers to the protection of memory allocated to one program from unauthorized access by another program. The operating system checks each write to a memory location to ensure that the address being written is allocated to the program performing the write operation.

Memory Allocation Memory Management Hardware Modern CPUs and computer systems incorporate advanced memory allocation and address resolution functions in hardware.

Technology Focus

Technology Focus

Outline Functional overview of an operating system Process management Resource allocation CPU allocation Memory allocation Interprocess communication

Interprocess Communication Interprocess Signals Interprocess Data Communication

Interprocess Communication Interprocess Signals A signal is a message used to synchronize the actions of two processes or threads. Signals can be sent between threads of the same process, between independent processes, or between the operating system and a process or thread.

Interprocess Communication

Interprocess Communication

Interprocess Communication

Interprocess Communication Interprocess Data Communication Operating systems provide a mechanism called a pipe so there can be communication via shared memory between independent processes.

Interprocess Communication

Interprocess Communication

Summary An operating system is the most complex component of system software. The operating system allocates hardware resources to individual user processes on demand. The operating system stores information about each process in a PCB.

Summary Application software is simper to develop if programs are unaware of resource allocation functions. An active thread is always in one of three states – ready, running, or blocked.

Summary 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.

Summary Processes and threads often need to synchronize their actions or transfer data among themselves using signals and pipes.