An operating system for a large-scale computer that is used by many people at once is a very complex system. It contains many millions of lines of instructions.

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

Operating Systems Manage system resources –CPU scheduling –Process management –Memory management –Input/Output device management –Storage device management.
Chapter 3 Process Description and Control
IT Systems Multiprocessor System EN230-1 Justin Champion C208 –
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
Day 25 Uniprocessor scheduling. Algorithm: Selection function Selection function – which process among ready processes to select. w – time spent in system,
A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
Chapter 3 Operating Systems. Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems 3.1 The Evolution of Operating Systems 3.2 Operating System.
CS444/CS544 Operating Systems Scheduling 1/31/2007 Prof. Searleman
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
IT Systems Operating System EN230-1 Justin Champion C208 –
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Introduction to Operating Systems What is an operating system? Examples How do many programs run at the same time, with one processor?
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.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Figure 1.1 Interaction between applications and the operating system.
Chapter 11 Operating Systems
Operating Systems CS208. What is Operating System? It is a program. It is the first piece of software to run after the system boots. It coordinates the.
Computer Organization and Architecture
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
BY: SACHIN SHRIVASTAVA Operating System By : Sachin Shrivastava 1.
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
Fall 2000M.B. Ibáñez Lecture 01 Introduction What is an Operating System? The Evolution of Operating Systems Course Outline.
Chapter 5 – CPU Scheduling (Pgs 183 – 218). CPU Scheduling  Goal: To get as much done as possible  How: By never letting the CPU sit "idle" and not.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Operating Systems. Definition An operating system is a collection of programs that manage the resources of the system, and provides a interface between.
Operating Systems Process Management.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
Scheduling Example 3 (1) Assume: FIFO Job Scheduling 100 K Main Memory Processor Sharing Process Scheduling (Cont…)
CE Operating Systems Lecture 3 Overview of OS functions and structure.
2.5 Scheduling Given a multiprogramming system. Given a multiprogramming system. Many times when more than 1 process is waiting for the CPU (in the ready.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Lecture 6 Page 1 CS 111 Online Preemptive Scheduling Again in the context of CPU scheduling A thread or process is chosen to run It runs until either it.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
UNIX Unit 1- Architecture of Unix - By Pratima.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
2.5 Scheduling. Given a multiprogramming system, there are many times when more than 1 process is waiting for the CPU (in the ready queue). Given a multiprogramming.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  What Operating Systems Do  Computer-System Organization  Computer-System Architecture  Operating-System Structure.
Computer Organization Instruction Set Architecture (ISA) Instruction Set Architecture (ISA), or simply Architecture, of a computer is the.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
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.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
Scheduling.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
Operating Systems •The kernel is a program that constitutes the central core of a computer operating system. It has complete control over everything that.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
OPERATING SYSTEMS CS3502 Fall 2017
Intro to Processes CSSE 332 Operating Systems
Real-time Software Design
Operating Systems.
Process Description and Control
Ainsley Smith Tel: Ex
Chapter 3: Processes Process Concept Process Scheduling
Necessary Background for OS
Presentation transcript:

An operating system for a large-scale computer that is used by many people at once is a very complex system. It contains many millions of lines of instructions (commands that the computer executes) written by programmers. To make operating systems easier to write, they are constructed as a series of modules (programs), each module responsible for one function. Typical modules in a larger multi-user operating system could be,

 Kernel (also known as the executive)  Process manager  Scheduler  File manager

 The core of all operating systems is called a REAL TIME EXECUTIVE (also known as the kernel). Some of the functions that it performs are  switching between programs  hardware device control and programming  memory management  process management  scheduling (deciding what programs to run)  inter-process communication  processing of exceptions and interrupts

Programs are a series of instructions to the computer. When a software programmer (a person who writes programs to run on a computer system) develops a program, it is converted into a long list of instructions that is executed by the computer system.

In operating systems we talk more of a process (part of a program that is in some stage of execution) than a program. This is because in modern operating systems, only a portion of a program is loaded at any one time. The rest of the program sits waiting on a disk unit till it is needed. This saves memory space. Processors execute computer programs. A processor is a chip in the computer that executes program instructions. Processors execute millions of instructions per second.

Some systems run only a single process at a time, other systems run multiple processes at once. Most computer systems are single processor based, and a processor can only execute one instruction at a time, so how is it possible for such a single processor system run multiple processes? The simple answer is that it doesn’t. The processor of the computer runs one process for a short period of time, then is switched to the next process and so on. As the processor executes millions of instructions per second, this gives the appearance of many processes running at once.

In a computer system that supports more than one process at once, some mechanism must be used to switch from one task to another. There are two main methods used to perform this switching.  Co-operative switching means that a task that is currently running will voluntarily give up the processor at some time, allowing other processes to run.  Preemptive switching means that a running task will be interrupted (forced to give up) and the processor given to another waiting process.

The problem with co-operative switching is one process could hang and thus deny execution of other processes, resulting in no work being done. Pre-emptive scheduling is better. It gives more response to all processes and helps prevent (or reduce the number of occurrences of) the dreaded machine lockup.

It will be noted that it takes time to save/restore the programs state and switch from one program to another (called dispatching ). This action is performed by the kernel, and must execute quickly, because we want to spend most of our time running user programs, not switching between them.

This switching between user programs is done by part of the kernel. To switch from one program to another requires,  a regular timed interrupt event (provided by a clock)  saving the interrupted programs state and data  restoring the next programs state and data  running that program till the next timed interrupt occurs.

Deciding which process should run next is called scheduling, and can be done in a wide variety of ways. Co-operative schedulers are generally very simple, as the processes are arranged in a ROUND ROBIN queue. When a running process gives itself up, it goes to the end of the queue. The process at the top of the queue is then run, and all processes in the queue move up one place. This provides a measure of fairness, but does not prevent one process from monopolizing the system (failing to give itself up).

Pre-emptive scheduling uses a real-time clock that generates interrupts at regular intervals.

First in First Out Scheduling A FIFO queue is a list of available processes awaiting execution by the processor. New processes arrive and are placed at the end of the queue. The process at the start of the queue is assigned the processor when it next becomes available, and all other processes move up one slot in the queue.

Round Robin Scheduling One of the problems with the FIFO approach is that a process may in fact take a very long time to complete, and thus holds up other waiting processes in the queue. To prevent this from happening, we employ a pre-emptive scheduler that lets each process run for a little while. When the time-slice is up, the running process is interrupted and placed at the rear of the queue. The next process at the top of the queue is then started.