Introduction What is an operating system bootstrap

Slides:



Advertisements
Similar presentations
Topic : Process Management Lecture By: Rupinder Kaur Lecturer IT, SRS Govt. Polytechnic College for Girls,Ludhiana.
Advertisements

CH 5. CPU Scheduling Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading.
Operating Systems Process Scheduling (Ch 3.2, )
Chapter 3: CPU Scheduling
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Scheduling in Batch Systems
Chapter 5-CPU Scheduling
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
3.1 : Resource Management Part2 :Processor Management.
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
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.
Processor Scheduling Hank Levy. 22/4/2016 Goals for Multiprogramming In a multiprogramming system, we try to increase utilization and thruput by overlapping.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Purpose of Operating System Part 2 Monil Adhikari.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Scheduling.
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.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
UNIT–II: Process Management
OPERATING SYSTEMS CS 3502 Fall 2017
lecture 5: CPU Scheduling
CPU SCHEDULING.
Dan C. Marinescu Office: HEC 439 B. Office hours: M, Wd 3 – 4:30 PM.
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Copyright ©: Nahrstedt, Angrave, Abdelzaher
OPERATING SYSTEMS CS3502 Fall 2017
Uniprocessor Scheduling
Chapter 2.2 : Process Scheduling
Process Scheduling B.Ramamurthy 9/16/2018.
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Operating Systems CPU Scheduling.
Process management Information maintained by OS for process management
CS 143A - Principles of Operating Systems
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System Concepts
So far…. Firmware identifies hardware devices present
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
TDC 311 Process Scheduling.
Chapter 5: CPU Scheduling
Process Description and Control
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 5: CPU Scheduling
Processor Scheduling Hank Levy 1.
Uniprocessor Process Management & Process Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
CPU Scheduling: Basic Concepts
Scheduling 21 May 2019.
Chapter 6: CPU Scheduling
Uniprocessor Process Management & Process Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Presentation transcript:

Introduction What is an operating system bootstrap different objectives of OS functions of OS OS as manager

Objectives of OS Convenience. Efficiency. Ability to evolve.

Evolution of OS Different generation of computers. Serial processing. Simple batch system multi-programmed batch system, IBSYS ‘60. Timesharing OS Parallel systems, Distributed systems, Real time systems, Embedded systems

Process Program under execution. It is an dynamic entity consisting of the sequence of events created as a result of execution of instructions. Is has a beginning, a life time and an end. It includes the current activity as represented by PC, stack containing temporary data (Parameter, return address, temporary variables). The same code of program can result in many processes. A program may have several conditional branches, depending on data, CPU may follow different paths in the address space. The same program code can be shared by more than one user at a time. This type of memory sharing will result in different processes.

Process life cycle Five state model Scheduled Admitted Interrupt Running New Ready I/O or event wait exit I/O or event completion Terminate Wait

Process life cycle Seven state model Suspend New Admit Admit Scheduler dispatch Activate Interrupt Running Ready Ready, suspend I/O or event wait Suspend exit I/O or event completion Event complete Terminate Activate Wait, suspend Wait Memory release

Transitions newready,suspend (process creation duty with blocked process) newready if the new process is of high priority wait wait suspend, if no space for new process readyready suspend, if the wait queues are empty ready suspend ready, ready queue is empty wait suspend  ready suspend, event for what process waited is completed wait suspend  wait, if the process is of high priority and memory becomes available.(poor performance) Running  ready suspend, a high priority process preempts the process and no memory available.

Process control block The structure maintained by the operating system that represents a process Typical elements of PCB Process identification Process ID Parent process ID User identifier Processor state information User visible registers Control registers Stack pointers

PCB Process ID Registers Memory limits List of open files  Registers Memory limits List of open files Program counter Process state Pointer

Process control block (contd.) Process control information Scheduling information Process state Priority Scheduling related information Event waiting Data structuring Pointers to other processes in queues Inter process communication Process control information Process privileges Memory management Resource ownership and utilization

Schedulers Long term Short term Medium term Controls degree of multiprogramming Good mixture of I/O and CPU bound process Short term CPU scheduler Medium term swapping

CPU and I/O burst CPU burst I/O burst or wait Process can be viewed as an alternating sequence of CPU and I/O burst. Starts and ends with CPU burst CPU burst I/O

Context switching Executing a new process needs to save the current state of the currently executing process, that includes the contents of different registers. It is a pure overhead to the system. It is dependent on hardware. DECSYSTEM-20 uses different set of registers. Contex switching here is a simply the change of pointer to a new set of registers. If the no of process is high, then needs the saving in memory

Scheduling criteria CPU utilization Throughput Turnaround time Waiting time Response time

Category of scheduling algorithm Preemptive Non-preemptive

When to make scheduling decision Running  wait Terminate Running  ready Wait  ready Only in Preemptive

Scheduling algorithms First in first out (FIFO) Shortest job first (SJF) Shortest remaining time next(SRTN) Highest response ration next(HRTN) Round Robin (RR) Priority Scheduling Multilevel queue Multilevel feedback queue

FIFO Process P1 P2 P3 P4 P5 Arrival time 0 0 2 8 12 Length 10 9 5 5 4 P3 2 P4 8 P5 12 P1 P2 P3 P4 P5 10 19 24 29 33 Process P1 P2 P3 P4 P5 Average Waiting time 0 10 17 16 17 12 Turnaround time 10 19 22 21 21 18.6

SJF Process P1 P2 P3 P4 P5 Arrival time 0 0 2 8 12 Length 10 9 5 5 4 P3 2 P4 8 P5 12 P2 P3 P5 P4 P1 9 14 18 23 33 Process P1 P2 P3 P4 P5 Average Waiting time 23 0 7 10 2 8.4 Turnaround time 33 9 12 15 6 15

SRTN Process P1 P2 P3 P4 P5 Arrival time 0 0 2 8 12 Length 10 9 5 5 4 P3 0 2 7 5 7 P3 P4 8 5 P1 33 P5 8 12 1 4 P4 13 12 4 P2 23 P5 17 8 P2 6 P2 2 12 P4 Process P1 P2 P3 P4 P5 Average Waiting time 23 5+9 0 0 1 7.6 Turnaround time 33 23 5 5 5 14.2

HRRN RR=(L+W)/L P5 33 Process P1 P2 P3 P4 P5 Arrival time 0 0 2 8 12 Length 10 9 5 5 4 Process P1 P2 P3 P4 P5 Arrival time 0 0 2 8 12 Length 10 9 5 5 4 P1 P2 P2 P3 2 P4 8 9 2 8 5 5 P4 29 P1 24 P3 P5 12 14 8 12 5 4 RR 1 1 RR 4.2 4 RR 2.4 2.2 1.5 RR 1.9 2.4 1.2 RR 5.2 Process P1 P2 P3 P4 P5 Average Waiting time 14 0 7 16 17 10.8 Turnaround time 24 9 12 21 21 17.4

Round Robin Process P1 P2 P3 P4 P5 Arrival time 0 0 2 8 12 Length 10 9 5 5 4 Process P1 P2 P3 P4 P5 Arrival time 0 0 2 8 12 Length 10 9 5 5 4 P1 P3 5 2 5 0 2 5 9 5 P2 P4 10 8 5 10 2 8 5 4 5 5 P1 20 P3 P5 15 12 8 12 5 4 P2 29 P1P2 P4 25 P5 33 Process P1 P2 P3 P4 P5 Average Waiting time 10 5+15 8 12 17 13.4 Turnaround time 20 29 13 17 21 20

Round Robin with Time slice 10 &2 P1 P2 P4 P3 P5 P1 P2 2 8 12 10 19 24 29 33 With longer time slice RR will be converted to FIFO P1 P2 P3 P4 P5 With very short time slice in RR, considerable amount of time will be wasted on Context Switching.

Problem Draw the Gantt chart and find the average waiting time for the following set of process, scheduled with -- Highest response ratio next algorithm Round Robin algorithm with time slice 5. P1 P2 P3 P4 P5 P6 Arrival time 0 4 6 10 12 15 Length 8 7 6 3 3 4

Multilevel Queue Scheduling Priority Scheduling Multilevel Queue Scheduling Ready queue 1 Ready queue 2 Ready queue N  Highest priority  Lowest priority

Multilevel Feedback Queue Scheduling Different ready queues with priority, Process’s priority is dynamic Ready queue 1 If the process can’t complete within time slice of the Q, then degrade the priority of the process. If process’s waiting time in a Q exceeds the limit, then improve its priority. Ready queue 2 Ready queue 3 Ready queue 3

Example At time 7 Q1(4,--) P5(7,6,0) Q2(8,10) P3(7,2,0) Q3(16,20) Process p1 p2 p3 p4 p5 p6 p7 p8 A/T 0 0 2 5 7 8 14 21 Priority 4 1 2 4 1 3 2 2 Len 18 3 6 20 6 10 9 10 At time 7 Q1(4,--) P5(7,6,0) Q2(8,10) P3(7,2,0) Q3(16,20) Q4(--,30) P1(0,18,7), P4(5,20,2) At time 3 Q1(4,--) Q2(8,10) P3(2,6,1) Q3(16,20) Q4(--,30) P1(0,18,3) At time 13 Q1(4,--) Q2(8,10) P5(11,2,2) Q3(16,20) P6(8,10,5) Q4(--,30) P1(0,18,13), P4(5,20,8) At time 11 (time expires for P5) Q1(4,--) Q2(8,10) P3(7,2,4), P5(11,6,0) Q3(16,20) P6(8,10,3) Q4(--,30) P1(0,18,11), P4(5,20,6) At time 0 Q1(4,--) P2(0,3,0) Q2(8,10) Q3(16,20) Q4(--,30) P1(0,18,0) At time 39(time expires for P6, P4 is promoted) Q1(4,--) Q2(8,10) Q3(16,20) P7(23,1,16),P1(30,18,9),P8(31,2,8), P4(35,20,0),P6(39,2,0) Q4(--,30) At time 51 (P8 is promoted) Q1(4,--) Q2(8,10) P8(51,2,0) Q3(16,20) P4(35,20,16),P6(39,2,12), P1(51,7,0) Q4(--,30) At time 40 Q1(4,--) Q2(8,10) Q3(16,20) P1(30,18,10),P8(31,2,9), P4(35,20,5),P6(39,2,1) Q4(--,30) At time 59 (P6 is promoted) Q1(4,--) Q2(8,10) P6(59,2,0) Q3(16,20) P1(51,7,8), P4(59,14,0) Q4(--,30) At time 53 Q1(4,--) Q2(8,10) Q3(16,20) P4(35,20,18),P6(39,2,14), P1(51,7,2) Q4(--,30) At time 61 Q1(4,--) Q2(8,10) Q3(16,20) P1(51,7,10), P4(59,14,2) Q4(--,30) At time 68 Q1(4,--) Q2(8,10) Q3(16,20) P4(59,14,9) Q4(--,30) At time 31(time expires for P8, P6and P1 are promoted) Q1(4,--) Q2(8,10) P6(28,10,3) Q3(16,20) P7(23,1,8), P1(30,18,1),P8(31,2,0) Q4(--,30) P4(5,20,26) At time 15 Q1(4,--) Q2(8,10) P7(14,9,1) Q3(16,20) P6(8,10,7) Q4(--,30) P1(0,18,15), P4(5,20,10) At time 23(time expires for P7) Q1(4,--) Q2(8,10) P8(21,10,2) Q3(16,20) P6(8,10,15), P7(23,1,0) Q4(--,30) P1(0,18,23), P4(5,20,18) P2 P3 P5 P7 P8 P6 P1 P4 0 3 7 11 13 15 23 31 39 40 51 53 59 61 68 82