WORKING OF SCHEDULER IN OS

Slides:



Advertisements
Similar presentations
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.
Advertisements

Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
Introduction to Kernel
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.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
OS Spring’03 Introduction Operating Systems Spring 2003.
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.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Processes and Resources
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
OS Spring’04 Introduction Operating Systems Spring 2004.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Process. Process Concept Process – a program in execution Textbook uses the terms job and process almost interchangeably A process includes: – program.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Chapter 4 Processes. Process: what is it? A program in execution A program in execution usually usually Can also have suspended or waiting processes Can.
The Structure of Processes (Chap 6 in the book “The Design of the UNIX Operating System”)
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
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.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
What is a Process ? A program in execution.
Processes 2 Introduction to Operating Systems: Module 4.
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Introduction to Operating Systems Concepts
System Calls, Interrupts and Exceptions
Introduction to Kernel
Processes and threads.
Process concept.
Operating Systems CMPSC 473
OPERATING SYSTEMS CS3502 Fall 2017
Protection of System Resources
CS 3305 System Calls Lecture 7.
Operating Systems: A Modern Perspective, Chapter 6
Processes A process is a running program.
Intro to Processes CSSE 332 Operating Systems
Structure of Processes
Module 2.2 COP4600 – Operating Systems Richard Newman
More examples How many processes does this piece of code create?
System Structure and Process Model
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Processes in Unix and Windows
CS510 Operating System Foundations
Process Description and Control in Unix
Process Description and Control in Unix
Presentation transcript:

WORKING OF SCHEDULER IN OS How does a scheduler work? When / How is it needed ?

Suppose a process is executing and Disk interrupt occurs ( say any I/p taken at keyboard ). ( Each I/O device has an entry in Interrupt Descriptor Table which contains the address of its interrupt handler). It maybe any interrupt like time interrupt. Here we consider I/O interrupt After sending interrupt the I/o device is blocked waiting for a reply / confirmation from current executing process that it can be scheduled Interrupt hardware saves the program counter and 2-3 more registers on the current executing process' stack. Now current executing process → Interrupt Handler. Interrupt handler saves all the present register in the process description table. ( Store the process context needed to resume the process execution ). Free the current stack and go to the new stack. Message sent to the I/O device indicating that current executing process' context has been successfully saved and it can be scheduled. I/.o device: blocked → ready state Call to SCHEDULER NOW that uses scheduling algorith to run new process based on nice value ( priority) If scheduled the I/O device is run else it remains in the queue (running state) waiting for scheduler to schedule it

EXECUTION OF SYSTEM CALLS IN OS System calls are special function determined by the OS that are executed by kernels only. They are special functions executed by OS on behalf of user. They are a layer of abstraction between software and hardware. E.g.: create a text file-> create(), open a file-> open().

User space 1- Calling program ( C code ) loads the parameters of sys call on the stack of the calling process. Increment stack pointer. What is stack? It stores all functions that have not returned yet! 2- Now actual call to the library procedure that is to be executed by the kernel 3- Library procedure stores the system call to be executed in the register where OS expects it 4- TRAP Kernel Space 5- Execute the system call by calling system call handler that executes by accessing parameters and system call number in the stack and registers respectively. ( Each system call is mapped to the address of its handler ) 6- Check for error after execution. If any error then save value Process Register accordingly, store error code in the errno variable and return -1. Else return the exit code. (What is errno? Special variable that stores the code of the error. Errno is mapped to sys_err_list that contains the description of error) 7- TRAP User Space

8- Library routine checks the returned value and returns to calling program accordingly 9- Registers cleared and stack freed. Stack pointer decremented. NOTE: THIS IS GENERAL PROCUDRE FOR MONOLITHIC KERNEL ARCHITECTURE ONLY NOT MICROKERNEL THANK YOU