Site Loader
Rock Street, San Francisco

SVKM’s NMIMSMukesh Patel School of TechnologyManagement & EngineeringComputer EngineeringDepartmentProgram:B.Tech. Sem IV Course: Operating System  List of Experimentsw.

e.f. 2nd Jan 2018Faculty: Dr.

Best services for writing your paper according to Trustpilot

Premium Partner
From $18.00 per page
4,8 / 5
4,80
Writers Experience
4,80
Delivery
4,90
Support
4,70
Price
Recommended Service
From $13.90 per page
4,6 / 5
4,70
Writers Experience
4,70
Delivery
4,60
Support
4,60
Price
From $20.00 per page
4,5 / 5
4,80
Writers Experience
4,50
Delivery
4,40
Support
4,10
Price
* All Partners were chosen among 50+ writing services by our Customer Satisfaction Team

D. Mishra /Prof. Ishani Saha/Prof. Payal Mishra  Exp No. Title Prerequisite* CO# 1 Introduction to Operating system: Explore the Unix Environment.

Knowledge of fundamentals of OS CO4 2. To study the various Unix system calls and basic Unix Commands Knowledge of fundamentals of OS and Unix Environment CO4 3. Implementation of Process Scheduling Algorithms a.

       FCFS b.     Round Robin c.      SJF   Prior knowledge of Process scheduling algorithms CO2 4 Implementation of Inter Process Communication schemes Prior knowledge of Process communication  algorithms CO2 5 Simulate the Process Deadlock environment and solve it using Banker’s Algorithm Prior knowledge of Process deadlock handling algorithms CO2 6 Simulate Memory management function -Paging Prior knowledge of Memory Management algorithms CO3 7 Implement the Memory Management function -Segmentation Prior knowledge of Memory Management algorithms CO3 8 Simulate the I/O Management algorithm Prior knowledge of Input and output Management algorithms CO3 9 Design the FAT table and simulate following schemes of file management   Prior knowledge of File  Management algorithms CO3 10 Case Study Presentation    Review paper and PPT Presentation based on  case study performed CO5  * Students are expected to be ready with the prerequisite beforeattending the labLABManualPARTA(PART A : TO BE REFFERED BY STUDENTS)Experiment No.03A.1Aim:  Toexplore and implement the various Process Scheduling Algorithms:1.      FCFS2.     Round Robin3.

      SJF A.2 Prerequisite:Prior knowledge of Processscheduling algorithmsA.3 Outcome:              After successful completion ofthis experiment students will be able to:Aftersuccessful completion of this experiment students will be able to: 1.     Understand the basics of Process & Process Scheduling2.     Implement Process Scheduling Algorithm 3.     Compare the various process scheduling algorithmA.4Theory:First ComeFirst ServeFirst-Come-First-Serve algorithm isthe simplest scheduling algorithm. Processes are dispatched according to theirarrival time on the ready queue.

Being a non-pre-emptive discipline, once aprocess has a CPU, it runs to completion. The FCFS scheduling is fair in theformal sense or human sense of fairness but it is unfair in the sense that longjobs make short jobs wait and unimportant jobs make important jobs wait. FCFS is more predictable than most of other schemes since it offerstime. FCFS scheme is not useful in scheduling interactive users because itcannot guarantee good response time. The code for FCFS scheduling is simple towrite and understand. One of the major drawback of this scheme is that theaverage time is often quite long.

The First-Come-First-Served algorithm israrely used as a master scheme in modern operating systems but it is oftenembedded within other schemes. Shortest-Job-First(SJF)Shortest-Job-First (SJF) is anon-pre-emptive discipline in which waiting job (or process) with the smallestestimated run-time-to-completion is run next. In other words, when CPU isavailable, it is assigned to the process that has smallest next CPU burst.

The SJF scheduling is especiallyappropriate for batch jobs for which the run times are known in advance. Sincethe SJF scheduling algorithm gives the minimum average time for a given set ofprocesses, it is probably optimal. The SJF algorithm favours short jobs (orprocessors) at the expense of longer ones. The obvious problem with SJF schemeis that it requires precise knowledge of how long a job or process will run,and this information is not usually available. The best SJF algorithm can do isto rely on user estimates of run times.

In the production environment wherethe same jobs run regularly, it may be possible to provide reasonable estimateof run time, based on the past performance of the process. But in thedevelopment environment users rarely know how their program will execute.Like FCFS, SJF is non pre-emptivetherefore, it is not useful in timesharing environment in which reasonableresponse time must be guaranteedThe preemptive version of SJF isknown as Shortest Remaining Time First (SRT) Algorithm RoundRobin SchedulingOneof the oldest, simplest, fairest and most widely used algorithm is round robin(RR). In the round robin scheduling, processes aredispatched in a FIFO manner but are given a limited amount of CPU time called atime-slice or a quantum.Ifa process does not complete before its CPU-time expires, the CPU is pre-emptedand given to the next process waiting in a queue. The pre-empted process isthen placed at the back of the ready list. Round Robin Scheduling ispre-emptive (at the end of time-slice) therefore it is effective in timesharing environments in which the system needs to guarantee reasonable responsetimes for interactive users.Theonly interesting issue with round robin scheme is the length of the quantum.

Setting the quantum too short causes too many context switches and lower theCPU efficiency. On the other hand, setting the quantum too long may cause poorresponse time and approximates FCFS.Inany event, the average waiting time under round robin scheduling is often quitelong. A.

5Procedure/Algorithm: A.5.1 TASK 1:1. Implement the following Process Scheduling Algorithma) FCFS schedulingalgorithmb) SJF schedulingalgorithmc)  Round Robinalgorithm 2.  Save and closethe file and name it as EXP3_ your Roll no. **********************PARTB(PART B : TO BE COMPLETED BY STUDENTS)(Students must submit the soft copy as perfollowing segments within two hours of the practical.

The soft copy must beuploaded on the Blackboard or emailed to the concerned lab in charge facultiesat the end of the practical in case there is no Black board access available)  Roll No. E039 Name: Vvyom Shah Class : B. Tech CSE Batch : E2 Date of Experiment: 30-01-18 Date of Submission: 30-01-18 Grade :    B.1Answers of Task to be written by student:  B.

1.1Code#include#include#includeusing namespace std;int main(){    stringproccess={“A”,”B”,”C”,”D”,”E”};    inttime_arr={1,2,3,4,5};    inttime_exec={5,10,25,3,30};    intwaiting={0,5,15,40,43};   cout<<"Proccesses executing: "<

h>#includeusing namespace std;int main(){    stringproccess={“A”,”B”,”C”,”D”,”E”};    inttime_arr={1,2,3,4,5};    inttime_exec={5,10,25,3,30};    intwaiting={0,3,8,18,43};    for(inti=0;i<4;i++)    {        for(intj=0;j<4-i;j++)        {           if(time_execj>time_execj+1)            {               int tmp=time_execj;               time_execj=time_execj+1;               time_execj+1=tmp;               string tmp2=proccessj;                proccessj=proccessj+1;               proccessj+1=tmp2;             }        }    }   cout<<"Proccesses executing: "<

3Compare the following process scheduling algorithm on the basis of(i)        Waiting Time(ii)       Turn Around Time      PID Arrival Burst Waiting Time TAT Average Waiting Time Average TAT FCFS P1             P2         P3         SJF P1             P2         P3         RR P1             P2         P3                                                                                         (Pasteyour answers completed during the 2 hours of practical in the lab here)B.2Observations and learning:(Studentsare expected to comment on the output obtained with clear observations andlearning for each task/ sub part assigned)B.3Conclusion: (Students mustwrite the conclusion as per the attainment of individual outcome listed above andlearning/observation noted in section B.

2)B.4Question of Curiosity (To be answered by student based on thepractical performed and learning/observations)  Q1: Justify “The performance ofRound Robin is heavily dependent on the size of the time             quantum.”Q2.

 Find out waiting time and turnaround time for following using Shortestremaining time first algorithm.Process                       Burst time                       Arrival Time               P1                                    6                                          0P2                                    8                                          1P3                                    7                                          2P4                                    3                                          3 ***************************************************************************************

Post Author: admin

x

Hi!
I'm Eric!

Would you like to get a custom essay? How about receiving a customized one?

Check it out