Operating System Practical: Name:-Ashish Bhandar ROLL NO: - 1518 Div: - A Class: - Fy Bscit
Operating System Practical: Name:-Ashish Bhandar ROLL NO: - 1518 Div: - A Class: - Fy Bscit
DIV :- A
INDEX
PRACTICAL 1
AIM:- Installation of virtual machine software like
vmware VirtualBox, vmware workstation to install guest
operating systems.
REQUIRED STEPS:
Step 1-: First go to a web browser and type vmware
then click on vmware official site.
tep 2-: Then click on downloads and here you will find
open source click on it.
CLASS:- FY BSCIT
DIV :- A
Step 3-: Here scroll down and you will see desktop &
End – User Computing under that click on VMware
Player.
PRACTICAL 2
Step2-: Then click on I will install operating system
later. The virtual machine will be created with a blank
hard disk
PRACTICAL 3
CLASS:- FY BSCIT
DIV :- A
PRACTICAL 4
PRACTICAL 5
PRACTICAL 6
read name
read remark
PRACTICAL 7
PRACTICAL 8
}
printf("Enter process burst time : \n");
for(i=0;i<n;i++)
{
scanf("%d",&bt[i]);
CLASS:- FY BSCIT
DIV :- A
}
for(i=0;i<n;i++)
{
for(j=0;j<n-i-1;j++)
{
if(bt[j]>bt[j+1])
{
t=bt[j];
bt[j]=bt[j+1];
bt[j+1]=t;
t=p[j];
p[j]=p[j+1];
p[j+1]=t;
}
}
}
printf("process\t Burst time\t Waiting time\t Turnaround time
\n");
for(i=0;i<n;i++)
{
wt[i]=0;
tat[i]=0;
for(j=0;j<i;j++)
{
CLASS:- FY BSCIT
DIV :- A
wt[i]=wt[i]+bt[j];
}
tat[j]=wt[i]+bt[i];
awt=awt+wt[i]; atat=atat+tat[i];
printf("%d\t\t%d\t\t%d\t\t%d\n",p[i],bt[i],wt[i],tat[i]);
}
awt=awt/n;
atat=atat/n;
printf("\n Average waiting time : %d",awt);
printf("\n Average turn around time : %d",atat);
}
OUTPUT :
CLASS:- FY BSCIT
DIV :- A
PRACTICAL 9
void main()
{
// initlialize the variable name
int i, NOP, sum=0,count=0, y, quant, wt=0, tat=0, at[10], bt[10],
temp[10];
float avg_wt, avg_tat;
printf(" Total number of process in the system: ");
scanf("%d", &NOP);
y = NOP; // Assign the number of process to variable y
// Use for loop to enter the details of the process like Arrival
time and the Burst Time for(i=0; i<NOP; i++)
{
printf("\n Enter the Arrival and Burst time of the Process[%d]\n",
i+1);
printf(" Arrival time is: \t"); // Accept arrival time
CLASS:- FY BSCIT
DIV :- A
scanf("%d", &at[i]);
printf(" \nBurst time is: \t"); // Accept the Burst time
scanf("%d", &bt[i]);
temp[i] = bt[i]; // store the burst time in temp array
}
// Accept the Time qunat
printf("Enter the Time Quantum for the process: \t");
scanf("%d", &quant);
// Display the process No, burst time, Turn Around Time and the
waiting time
printf("\n Process No \t\t Burst Time \t\t TAT \t\t Waiting Time ");
for(sum=0, i = 0; y!=0; )
{
if(temp[i] <= quant && temp[i] > 0) // define the conditions
{
sum = sum + temp[i];
temp[i] = 0;
count=1;
}
else if(temp[i] > 0)
{
temp[i] = temp[i] - quant;
sum = sum + quant;
}
CLASS:- FY BSCIT
DIV :- A
OUTPUT :
CLASS:- FY BSCIT
DIV :- A
PRACTICAL 10
}
for(i=0; i<n; i++)
for(j=0; j<n; j++)
{
if(p[i]<p[j])
{
temp=p[i];
p[i]=p[j];
p[j]=temp;
temp=at[i];
at[i]=at[j];
at[j]=temp;
temp=et[i];
et[i]=et[j];
et[j]=temp;
strcpy(t,pn[i]);
strcpy(pn[i],pn[j]);
strcpy(pn[j],t);
}
}
for(i=0; i<n; i++)
{
CLASS:- FY BSCIT
DIV :- A
if(i==0)
{
st[i]=at[i];
wt[i]=st[i]-at[i];
ft[i]=st[i]+et[i];
ta[i]=ft[i]-at[i];
}
else
{
st[i]=ft[i-1];
wt[i]=st[i]-at[i];
ft[i]=st[i]+et[i];
ta[i]=ft[i]-at[i];
}
totwt+=wt[i];
totta+=ta[i];
}
awt=(float)totwt/n;
ata=(float)totta/n;
printf("\nPname\tarrivaltime\texecutiontime\tpriority\twaitin
gtime\ttatime");
for(i=0; i<n; i++)
CLASS:- FY BSCIT
DIV :- A
printf("\n%s\t%5d\t\t%5d\t\t%5d\t\t%5d\t\t
%5d",pn[i],at[i],et[i],p[i],wt[i],ta[i]);
printf("\nAverage waiting time is:%f",awt);
printf("\nAverage turnaroundtime is:%f",ata);
getch();
}