Presentation is loading. Please wait.

Presentation is loading. Please wait.

OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes.

Similar presentations


Presentation on theme: "OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes."— Presentation transcript:

1

2 OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes. To know more about the semaphores and Inter process communication. AIM: To understand the basic concepts of operating system.

3 LIST OF EXERCISES S.NOTITLE OF THE PROGRAMS 1.a.Program using exec & wait system calls 1.b. Program using fork & exit system calls 1.c. Program using opendir & readdir system calls 1.d. Program using stat system calls 2. Program to implement I/O system call of unix operating system 3.a. Simulation of ls command 3.b. Simulation of grep command 4.a. Implementation of First Come First Serve Scheduling algorithm 4.b. Implementation of Shortest Job First Scheduling algorithm

4 S.NOTITLE OF THE PROGRAMS 5. Implementation of Priority & Round Robin Scheduling algorithm 6. Application using Inter Process Communication 7. Implementation of Producer – Consumer Problem using Semaphores 8. Implementation of Memory Management Scheme -I 9. Implementation of Memory Management Scheme -II 10.a. Implementation of First In First Out Page Replacement algorithm 10.b. Implementation of Best Fit algorithm 10.c. Implementation of First Fit algorithm

5 Hardware and Software required HARDWARE: Personal Computers SOFTWARE: Linux

6 SYSTEM CALLS A request to the operating system to perform some activity System call is how a program requests a service from an operating system 's kernel System calls provide the interface between a process and the operating system.

7

8 EXAMPLE OF SYSTEM CALLS getuid() //get the user ID fork() //create a child process exec() //executing a program

9 SCHEDULING ALGORITHMS  A scheduling algorithm is the method by which threads, processes or data flows are given access to system resources (e.g. processor time, communications bandwidth).  This is usually done to load balance a system effectively or achieve a target quality of service.

10 SCHEDULING ALGORITHMS  First-come, first-served scheduling (FCFS) algorithm  Shortest Job First Scheduling (SJF) algorithm  Non-preemptive priority Scheduling algorithm  Preemptive priority Scheduling algorithm  Round-Robin Scheduling algorithm  Multilevel Feedback Queue Scheduling algorithm  Multilevel Queue Scheduling algorithm

11 FCFS ProcessBurst Time P 1 24 P2 3 P2 3 P3 3 P3 3 Suppose that the processes arrive in the order: P 1, P 2, P 3 The Gantt Chart for the schedule is: Waiting time for P 1 = 0; P 2 = 24; P 3 = 27 Average waiting time: (0 + 24 + 27)/3 = 17 P1P1 P2P2 P3P3 2427300

12 SJF ProcessArrival TimeBurst Time P 1 0.07 P 2 2.04 P 3 4.01 P 4 5.04 SJF (non-preemptive) Average waiting time = (0 + 6 + 3 + 7)/4 = 4 P1P1 P3P3 P2P2 73160 P4P4 812

13 Process Arrival Time Burst Time P 1 0.07 P 2 2.04 P 3 4.01 P 4 5.04 SJF (preemptive) Average waiting time = (9 + 1 + 0 +2)/4 = 3 P1P1 P3P3 P2P2 42 11 0 P4P4 57 P2P2 P1P1 16

14 Priority Scheduling A priority number (integer) is associated with each process The CPU is allocated to the process with the highest priority (smallest integer ≡ highest priority). 1. Preemptive 2. non-preemptive SJF is a priority scheduling where priority is the predicted next CPU burst time. Problem ≡ Starvation – low priority processes may never execute. Solution ≡ Aging – as time progresses increase the priority of the process.

15 RR (Quantum=20) ProcessBurst Time P 1 53 P 2 17 P 3 68 P 4 24 The Gantt chart is: Typically, higher average turnaround than SJF, but better response P1P1 P2P2 P3P3 P4P4 P1P1 P3P3 P4P4 P1P1 P3P3 P3P3 02037577797117121134154162

16 INTER PROCESS COMMUNICATION  Inter-process communication (IPC) is a set of techniques for the exchange of data among multiple threads in one or more processes.  Processes may be running on one or more computers connected by a network.

17 SEMAPHORES  Semaphores provide mutual exclusion.  They are used for process sync and are used to resolve deadlock conditions.  They are used in pairs basically wait() and signal().  Commonly used semaphore is mutex()

18 PAGE REPLACEMENT ALGORITHMS  page replacement algorithms decide which memory pages to page out (swap out, write to disk) when a page of memory needs to be allocated.  Paging happens when a page fault occurs and a free page cannot be used to satisfy the allocation

19 Memory Management Memory-Management Unit ( MMU )

20 SWAPPING

21 PAGING

22 Page Replacement Algorithms (FIFO)

23


Download ppt "OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes."

Similar presentations


Ads by Google