Chapter 10 Operating Systems Nell Dale • John Lewis.

Slides:



Advertisements
Similar presentations
Operating System CS105. Objectives Role of an operating system Manages resources – Memory – CPU – Secondary storage – I/O devices Memory CPU Hard Disk.
Advertisements

Chapter 10 Operating Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Operating Systems Chapter 6
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 3: CPU Scheduling
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
Scheduling in Batch Systems
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Chapter 5-CPU Scheduling
Computer Organization and Architecture
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 10 Operating Systems.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Maximum CPU utilization.
Chapter 10 Operating Systems *. 2 Chapter Goals Describe the main responsibilities of an operating system Define memory and process management Explain.
Chapter 6: CPU Scheduling
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
CPS120: Introduction to Computer Science Operating Systems Nell Dale John Lewis.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 10 Operating Systems.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
10-1 Software Categories Application software Software written to address specific needs—to solve problems in the real world Word processing programs,
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the responsibilities of an operating system Define memory and process management Explain how timesharing.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 4.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Memory management The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory.
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 10 Operating Systems.
Chapter 2: The Linux System Part 4
Memory Management.
Chapter 2 Memory and process management
Chapter 10 Operating Systems.
Chapter 6: CPU Scheduling
Chapter 8: Main Memory.
Process management Information maintained by OS for process management
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Main Memory Background Swapping Contiguous Allocation Paging
Chapter5: CPU Scheduling
Chapter 6: CPU Scheduling
Lecture 3: Main Memory.
Chapter 10 Operating Systems.
Mid-Term Review Good Results Always Answer Questions
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Presentation transcript:

Chapter 10 Operating Systems Nell Dale • John Lewis

Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain how timesharing creates the virtual machine illusion Explain the relationship between logical and physical addresses Compare and contrast memory management techniques

Chapter Goals (cont.) Distinguish between fixed and dynamic partitions Define and apply partition selection algorithms Explain how demand paging creates the virtual memory illusion Explain the stages and transitions of the process life cycle Explain the processing of various CPU scheduling algorithms

Software Categories Application software is written to address our specific needs—to solve problems in the real world Word processing programs, games, inventory control systems, automobile diagnostic programs, and missile guidance programs are all application software System software manages a computer system at a fundamental level It provides the tools and an environment in which application software can be created and run

Operating System An operating system manages computer resources, such as memory and input/output devices, and provides an interface through which a human can interact with the computer An operating system allows an application program to interact with these other system resources

Operating System Figure 10.1 An operating system interacts with many aspects of a computer system.

Operating System The various roles of an operating system generally revolve around the idea of “sharing nicely” An operating system manages resources, and these resources are often shared in one way or another among programs that want to use them

Resource Management Multiprogramming is the technique of keeping multiple programs in main memory at the same time; these programs compete for access to the CPU so that they can execute Memory management: keeps track of what programs are in memory and where in memory they reside

Resource Management A process can be defined as a program in execution The operating system performs process management to carefully track the progress of a process and all of its intermediate states. CPU scheduling determines which process in memory is executed by the CPU at any given point

Batch Processing A typical computer in the 1960s and ‘70s was a large machine Its processing was managed by a human operator The operator would organize various jobs from multiple users into batches

Batch Processing Figure 10.2 In early systems, human operators would organize jobs into batches

Timesharing A timesharing system allows multiple users to interact with a computer at the same time Multiprogramming allowed multiple processes to be active at once, which gave rise to the ability for programmers to interact with the computer system directly, while still sharing its resources In a timesharing system, each user has his or her own virtual machine, in which all system resources are (in effect) available for use

Memory Management Operating systems must employ techniques to: Track where and how a program resides in memory Convert logical program addresses into actual memory addresses A logical address (sometimes called a virtual or relative address) is a value that specifies a generic location, relative to the program but not to the reality of main memory A physical address is an actual address in the main memory device

Memory Management Figure 10.3 Memory is a continuous set of bits referenced by specific addresses

Single Contiguous Memory Management There are only two programs in memory The operating system The application program This approach is called single contiguous memory management Figure 10.4 Main memory divided into two sections

Single Contiguous Memory Management A logical address is simply an integer value relative to the starting point of the program To produce a physical address, we add a logical address to the starting address of the program in physical main memory

Single Contiguous Memory Management Figure 10.5 binding a logical address to a physical one

Partition Memory Management When using fixed partitions, main memory is divided into a particular number of partitions When using dynamic partitions, the partitions are created to fit the need of the programs

Partition Memory Management At any point in time memory is divided into a set of partitions, some empty and some allocated to programs Base register: a register that holds the beginning address of the current partition Bounds register: a register that holds the length of the current partition Figure 10.6 Address resolution in partition memory management

Partition Selection First fit Best fit Worst fit Program is allocated to the first partition big enough to hold it Best fit Program is allocated to the smallest partition big enough to hold it Worst fit Program is allocated to the largest partition big enough to hold it

Paged Memory Management Paged memory technique: main memory is divided into small fixed-size blocks of storage called frames. A process is divided into pages that (for the sake of our discussion) we assume are the same size as a frame The operating system maintains a separate page-map table (PMT) for each process in memory

Paged Memory Management To produce a physical address, you first look up the page in the PMT to find the frame number in which it is stored Then multiply the frame number by the frame size and add the offset to get the physical address Figure 10.7 A paged memory management approach

Paged Memory Management An important extension is demand paging not all parts of a program actually have to be in memory at the same time In demand paging, the pages are brought into memory on demand The act of bringing in a page from secondary memory, which often causes another page to be written back to secondary memory, is called a page swap

Paged Memory Management The demand paging approach gives rise to the idea of virtual memory, the illusion that there are no restrictions on the size of a program Too much page swapping, however, is called thrashing and can seriously degrade system performance.

Process Management The Process States Figure 10.8 The process life cycle

The Process Control Block The operating system must manage a large amount of data for each active process Usually that data is stored in a data structure called a process control block (PCB) Each state is represented by a list of PCBs, one for each process in that state

The Process Control Block Keep in mind that there is only one CPU and therefore only one set of CPU registers These registers contain the values for the currently executing process Each time a process is moved to the running state: Register values for the currently running process are stored into its PCB Register values of the new running state are loaded into the CPU This exchange of information is called a context switch

CPU Scheduling The act of determining which process in the ready state should be moved to the running state That is, decide which process should be given over to the CPU

CPU Scheduling Nonpreemptive scheduling: occurs when the currently executing process gives up the CPU voluntarily Preemptive scheduling: occurs when the operating system decides to favor another process, preempting the currently executing process Turnaround time for a process: amount of time between the time a process arrives in the ready state to the time it exits the running state for the last time

First-Come, First-Served Processes are moved to the CPU in the order in which they arrive in the running state FCFS scheduling is nonpreemptive

First-Come, First-Served Page 336

Shortest Job Next Looks at all processes in the ready state and dispatches the one with the smallest service time It is also generally implemented as a nonpreemptive algorithm Page 337

Round Robin Distributes the processing time equitably among all ready processes The algorithm establishes a particular time slice (or time quantum), which is the amount of time each process receives before being preempted and returned to the ready state to allow another process its turn Round-robin algorithm is preemptive

Round Robin Suppose the time slice was 50 Page 339

Ethical Issues: Privacy Invasion Technological advancements have raised issues relating to our right to privacy Information can be tracked, entered into a database, and used by various organizations, often without your knowledge or consent Privacy includes a right to anonymity as well as a right to hold personal information confidential and a right to solitude

Ethical Issues: Privacy Invasion Example Now present in the vehicles of many truck companies and rental car businesses These devices function as high-tech Global Positioning Systems (GPS) Company representatives can contact drivers over a speaker phone when they steer off a predetermined course The tracking technology can also monitor a vehicle’s speed