CS3461_OS_Labmanual
CS3461_OS_Labmanual
CS3461
OPERATING SYSTEMS LABORATORY
LAB MANUAL
Academic Year
ODD SEMESTER 2023-2024
LIST OF EXPERIMENTS
3. Process Management using System Calls: Fork, Exit, Getpid, Wait, Close
15. Write C programs for the implementation of various disk scheduling algorithms
16. Install any guest operating system like Linux using VMware.
AIM:
Make sure that you are using USB Drive that is at least 4GB for the 32-bit version and
8GB for 64-bit version.
Rufus is one of several programs that allow you to create an ‘ISO Image’ on USB drive
To create a bootable USB using Rufus, all we need is:
• ISO of our choice Eg.Windows 10
• Any version of rufus
• A spare USB drive (an 8GB USB should be plenty for Windows
10 but make sure you have one that's large enough for the ISO
you're using)
DOWNLOADING WINDOWS ISO
STEP 3: At the next screen, choose Create Installation media for another PC & Next.
Important Notes
STEP 1: In order to perform a clean installation of Windows 10, you must own a valid
Windows 10 product key to activate windows.
STEP 2: If you bought a pre-installed Windows 10 computer (on which the OS installed
from the computer manufacturer), then the product key is in BIOS and it will be retrieved
automatically (from BIOS) during Windows installation.
STEP 3: If you're currently running Windows 8.1 or Windows 7 SP1 (already activated),
and you want to upgrade your computer to Windows 10* select "Upgrade this PC now" at
the next screen & then follow the onscreen instruction to upgrade your OS to Windows
10.
STEP 7: Choose the destination location (where the ISO file will be saved/stored) & press
Save.
RESULT:
Thus the installation of windows operating system has been done successfully.
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
EX.NO: 2 BASIC UNIX COMMANDS
Aim:
To study and execute UNIX commands.
Login:
Type telnet server IP address in run window. Users must authenticate themselves by providing a username
and password. Once verified, a greeting and $ prompt appear. The shell is now ready to receive commands
from the user. Options are suffixed with a hyphen (-), and arguments are separated by space.
General Commands:
1. date:
Syntax: $ date
Example:$date
Output:
Sat Mar 09
10:17:27
IST 2024
Formats:
1. date +%m
Example:$date+%m
Output: 03
2. date +%y
Example:$date+%y
Output: 24
3. date +%d
Example:$date+%d
Output: 09
4. date +%h
Example:$date+%h
Output: Mar
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
5. date +%H
6. date +%M
Example:$date+%M
Output: 17
7. date +%S
Example:$date+%S
Output: 27
2) cal
• Syntax: $ cal
• Example:$cal
Output: Displays the current month's calendar.
• Description: Displays the calendar for the specified month and year.
• Example:$cal52024
Output: Displays May 2024 calendar.
3) echo
• Syntax: $ echo
• Example:$echo"HelloWorld"
Output: Hello World
4) LS-It is used to list the files and the files are kept in a directory
syntax: $ 18
Example: $ 18
os File Files
syntax: $ Lp filename
6) who- who displays the data about all the users who have logged into the system currently
Syntax $ who
Example: $ who
syntax :$ who am i
Example: $ who am i
(8) uptime- uptime tells how long the computer has been sunning since its last reboot power off
Syntax: $ uptime
Example: $ uptime
10:21:53 up 169 days, 22:56, 25 users, load average: 1.00, 0.42, 0.15
syntax: $ hostname
Example:$ hostname
telnet sce.com.
10) uname - uname displays the system information such as hardware platform, system name and
Processor OS type
syntax $ uname
Example: $ uname
Linux
syntax :$ bc
Example: $ bc
15+2
17
sqrt (25)
syntax :$ clear
(13) history- It prints the command history in the current active session
1. date
2. date +%m
3. date +%y
syntax :$ man
$find ex1/sce
16) Pwd -If is used to find out what directory you are working with
syntax $ pwd
Example:
1) $ pwd
/name/SCE/251046
2) $ cd ex2
$ pwd
/name/SCE/251046/ex2
syntax: $ id
Example: $ id
Syntax: $ Last
Hello world
$18
Ex1
Hello world
ctrl +d
$cat ex1
Hello world
(2) grep- Used to search a related to that file particular word or pattern related to that file,
Hello
Example:
$ cat ex 2
Hello world
$ cat ex1
$ cat ex4
Hello world
Example: $ tail ex 2
10) wc- It counts the number of lines, words and characters in a file
syntax: $ wc filename
Example:
Hell
welcome
to
oslab
$ wc csea
5 5 24 csea
i)$wc -c csea
24 csea
ii) $ wc -w csea
5 csea
iii) $ wc -l ese
5 csea
Syntax: $ rm filename
Example: $ rm csea
Directory command:
A directory created.
syntax: $ cd directoryname
Example: $ cd sce
AIM:
ALGORITHM:
STEP 3: Calculate the swapping of two values by using a temporary variable temp.
PROGRAM:
read a
read b
temp=$a
a=$b
b=$temp
echo $a
echo $b
After swapping
//ARITHMETIC FUNCTION
ALGORITHM:
PROGRAM:
read a
read b
c=`expr $a + $b`
c=`expr $a - $b`
c=`expr $a \* $b`
c=`expr $a / $b`
c=`expr $a % $b`
Sum: 12
Diff: -2
Mul: 35
Div: 0
modulus: 5
ALGORITHM:
read r
Enter radius:
area:78.50
circumference: 31.40
//TEMPERATURE CONVERSION
ALGORITHM:
PROGRAM:
read c
45
RESULT:
Thus, basic programs using shell program has been executed successfully.
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
Ex No-3b SHELL PROGRAMMING
CONDITIONAL STATEMENTS
AIM:
//ODD OR EVEN
ALGORITHM:
PROGRAM:
read n
if [ `expr $n % 2` -eq 0 ]
then
else
fi
Enter a num:
5 is odd
ALGORITHM:
PROGRAM:
read x
read y
read z
if [ $x -gt $y -a $x -gt $z ]
then
else
if [ $y -gt $z -a $y -gt $x ]
then
fi
if [ $z -gt $y -a $z -gt $x ]
then
fi
fi
45
23
12
45 is greatest
//STUDENT GRADE
ALGORITHM:
PROGRAM:
read name
read mark
then
fi
then
fi
then
fi
then
fi
then
fi
then
fi
if [ $mark -lt 40 ]
then
echo "ReAppear"
fi
Student's Grade
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
Enter name
selena
87
A+ grade
ALGORITHM:
PROGRAM:
read y
if [ `expr $y % 4 ` -eq 0 ]
then
else
fi
Leap Year
Enter a year:
2020
RESULT:
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
Thus, the conditional statements using shell program has been executed successfully.
LOOPING STATEMENTS
AIM:
//FACTORIAL
ALGORITHM:
PROGRAM:
echo "factorial"
read n
f=1
do
f=`expr $f \* $i`
done
Output:
factorial
echo n:
factorial 5 = 120
//FIBONACCI SEQUENCE
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
ALGORITHM:
STEP 3: Intitalize 0 to a, 1 to b, 3 to i
STEP 7: Increment I by 1.
PROGRAM:
read n
f1=0
f2=1
temp=0
for ((i=0;i<=n;i++))
do
echo $f1
temp=$f2
f1=$temp
done
Output:
Enter limit
2
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
3
//ARMSTRONG NUMBER
ALGORITHM:
PROGRAM:
read num
n=$num
do
done
if [ $n -eq $val ]
then
else
fi
Output:
Enter number:
153
Armstrong number
Enter number:
234
//MULTIPLICATION TABLE
ALGORITHM:
PROGRAM:
read n
for ((i=1;i<=10;i++))
do
val=`expr $n \* $i`
done
Output:
Multiplication table
Enter n:
1*7=7
2 * 7 = 14
3 * 7 = 21
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
4 * 7 = 28
5 * 7 = 35
6 * 7 = 42
7 * 7 = 49
8 * 7 = 56
9 * 7 = 63
10 * 7 = 70
RESULT:
Thus, the looping statements using shell program has been executed successfully.
AIM:
ALGORITHM:
PROGRAM:
#include<stdio.h>
#include<unistd.h>
void main(void)
int childpid;
childpid=fork();
printf("\n%d",childpid);
if(childpid==-1)
exit(0);
{/*child process*/
exit(0);
{/*Parent process*/
printf("Hai\n");
exit(0);
Output:
14233
Hai
RESULT:
Thus, the Fork System call using C Program is done and the output is verified successfully.
AIM:
ALGORITHM:
cid = wait(&status)
STEP 7: When the child process completes, the parent process resumes from the call to wait() where
it completes.
PROGRAM:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
int main()
pid_t Pid;
switch(Pid=fork())
case -1:
printf("Fork failed");
exit(-1);
case 0:
printf("Child process\n");
execl("/bin/date","date",0);
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
exit(0);
default:
wait(NULL);
exit(0);
Output:
Child process
Child Terminated
------------------------------------
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/wait.h>
int main()
int i,status;
pid_t pid;
pid =fork();
if(pid < 0)
exit(-1);
else if(pid>0)
wait(NULL);
printf("%3d",i);
else if(pid==0)
for(i=1;i<10;i+=2)
printf("%3d",i);
return 0;
Output:
Child starts
Odd no's: 1 3 5 7 9
Child ends
Parent Starts
Even no's: 2 4 6 8 10
Parent ends
RESULT:
Thus, the wait System call is done and the output is verified successfully.
AIM:
ALGORITHM:
PROGRAM:
#include <stdio.h>
#include <sys/types.h>
int main(void)
if((fork())<0)
exit(1);
else
int pid_t=getpid();
printf("Process id is :%d",pid_t);
sleep(1);
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
exit(0);
return 0;
Output:
Process id is :14121
RESULT:
Thus, the getpid and exit System call algorithm has done and the output is verified successfully.
AIM:
ALGORITHM:
STEP 7: Execute the following calculation till the loop condition is true:
tw = tw + wait[i];
avgw = tw / n;
avgtt = ttq / n;
STEP 9: Print the value of all process IDs, CPU burst time, waiting time, and turn-around time as in
the execution order of processes.
STEP 10: Print total waiting time, total turn-around time, average waiting time, and average turn-
around time.
PROGRAM:
#include <stdio.h>
int main()
float avg_wt,avg_tt;
printf("\n=============================================\n");
printf("\n=============================================\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
printf("P%d\t",i);
scanf("%d",&b[i]);
printf("\n=============================================\n");
printf("\n=============================================\n");
for(i=1;i<=n;i++)
t=t+w;
r=r+b[i];
w=w+b[i];
a=a+r;
printf("\n=============================================\n");
avg_wt=(float)t/n;
avg_tt=(float)a/n;
return 1;
Output:
=============================================
CPU Scheduling
=============================================
P1 2
P2 1
P3 8
P4 4
=============================================
=============================================
P1 2 0 2
P2 1 2 3
P3 8 3 11
P4 4 11 15
=============================================
RESULT:
AIM:
ALGORITHM:
STEP 3: Get the CPU burst time of n processes using looping statement .
STEP 4: Arranged the process ID and CPU bus time based on ascending order.
STEP 6: Execute the following calculation till the loop condition is true
for(i=1;i<n;i++)
Wait[i]=wait[i-1]+cput[i-1];
tt[i]=cpu[i]+wait[i];
STEP 7: Execute the following calculation till the loop condition is true
For(i=0;i<n;i++)
PROGRAM:
#include <stdio.h>
int main()
int n,w[100],tot[100],i,j,awt,atot;
float avwt,avtot;
struct {
int p,bt;
}sjf[10],temp;
printf("========================================================\n");
printf("\n========================================================\n");
scanf("%d",&n);
printf("p%d : ",i);
scanf("%d",&sjf[i].bt);
sjf[i].p=i;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
temp=sjf[i];
sjf[i]=sjf[j];
sjf[j]=temp;
w[1]=0;
tot[1]=sjf[1].bt;
for(i=2;i<=n;i++)
tot[i]=tot[i-1]+sjf[i].bt;
awt=0;
atot=0;
for(i=1;i<=n;i++)
w[i]=tot[i]-sjf[i].bt;
awt+=w[i];
atot+=tot[i];
avwt=(float)awt/n;
avtot=(float)atot/n;
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
printf("\n\n========================================================\n");
printf("\n\n============================================================\n");
for(i=1;i<=n;i++)
printf("\n\t%d\t\t%d\t\t%d",sjf[i].p,w[i],tot[i]);
printf("\n=======================================================\n");
return 0;
Output:
========================================================================
CPU Scheduling
========================================================================
p1 : 2
p2 : 1
p3 : 8
p4 : 4
========================================================================
========================================================================
2 0 1
1 1 3
4 3 7
3 7 15
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
========================================================================
RESULT:
AIM:
ALGORITHM:
STEP 3: Retrieve the CPU burst time and priority for n processes using looping statements.
STEP 4: Arrange the process IDs, CPU burst times, and priorities in ascending order based on priority.
STEP 5: Initialize wait[0] = 0, tt[0] = cpu[0], and set twt = 0 and tta = 0.
STEP 7: Calculate the total waiting time (twt) and total turnaround time (tta):
STEP 8: Compute the average waiting time and average turnaround time:
• avgwt = twt / n
• avgtt = tta / n
STEP 9: Print the process ID, priority, CPU burst time, waiting time, and turnaround time in the
execution order.
STEP 10: Print the total waiting time, total turnaround time, average waiting time, and average
turnaround time.
PROGRAM:
#include <stdio.h>
int main()
int t1,d[20],i,te=0,b1[20],t3=0;
printf("\n=============================================\n");
printf("\n=============================================\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
printf("P%d :",i);
scanf("%d",&b[i]);
d[i]=i;
for(i=1;i<=n;i++)
printf("P%d :",i);
scanf("%d",&p[i]);
for(i=1;i<=n;i++)
for(j=i+1;j<=n;j++)
if(p[i]<p[j])
temp=p[i];
t1=d[i];
te=b[i];
p[i]=p[j];
d[i]=d[j];
b[i]=b[j];
p[j]=temp;
d[j]=t1;
b[j]=te;
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
}
printf("\n\n==============================================\n");
printf("Process\tPriority\tBurst\tWaiting\t\tTurnaround\n");
printf("=========================================");
for(i=1;i<=n;i++)
t=d[i];
w[i+1]=w[i]+b[i];
t2[i]=b[i]+w[i];
t3+=t2[i];
printf("\nP%d\t%d\t\t%d\t%d\t\t%d",d[i],p[i],b[i],w[i],t2[i]);
printf("\n=======================================================\n");
temp=0;
for(i=1;i<=n;i++)
temp+=w[i];
t=(float)temp/n;
r=(float)t3/n;
return 0;
Output:
=============================================
CPU Scheduling
Priority Scheduling
=============================================
P1 :3
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
P2 :6
P3 :4
P4 :2
P1 :3
P2 :1
P3 :4
P4 :2
==============================================
=========================================
P3 4 4 0 4
P1 3 3 4 7
P4 2 2 7 9
P2 1 6 9 15
=======================================================
RESULT:
AIM:
ALGORITHM:
STEP 2: Get the number of processes in a variable 'n' and time quantum value..
STEP 3: Get the CPU burst time and priority of 'n' processes using looping statements.
STEP 5: Initialize q[i]=0 for the value of I; From 0 to n and calculate the value of count.
STEP 6: Do the following till the value of count becomes zero, check whether p[i]>0, If it is TRUE,
exe=exe+t;
q[i]=q[i]-t;
otherwise,
exe=exe+p[i];
wait[i]=exe-p[i];
STEP 7: Execute the following calculation till the loop condition is true, For ((i=0; i<n; i++))
Tti[i =cpu[i]+wait[i];
tta=tta + ttt[i];
STEP 8: Calculate average waiting time and average turn around time
avgw=tw/n; avgtt=tta/n;
STEP 9: Print the values of all process id, priority, CPU burst time, waiting time and turn around time
as in Execution order of process..
STEP 10: Print total waiting time, total turnaround time, average waiting time and average turnaround
time.
PROGRAM:
#include<stdio.h>
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
int main()
int i,tbt=0,nop,ts=0,flag[20],rem[20];
int from,wt[20],tt[20],b[20],twt=0,ttt=0,dur;
float awt,att;
printf("==========================================\n");
printf("\n========================================");
printf("\nEnter No of Processes:");
scanf("%d",&nop);
scanf("%d",&ts);
for(i=0;i<nop;i++)
wt[i]=tt[i]=0;
printf("P%d:",i+1);
scanf("%d",&b[i]);
rem[i]=b[i];
tbt+=b[i];
flag[i]=0;
from=0;
i=0;
printf("\t\tGantt Chart");
printf("\n==============================================\n");
printf("\n===============================================\n");
while(from<tbt)
if(!flag[i])
if(rem[i]<=ts)
{
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
dur=rem[i];
flag[i]=1;
tt[i]=dur+from;
wt[i]=tt[i]-b[i];
else
dur=ts;
printf("%7d%15d%15d\n",i+1,from,from+dur);
rem[i]-=dur;
from+=dur;
i=(i+1)%nop;
for(i=0;i<nop;i++)
twt+=wt[i];
ttt+=tt[i];
printf("\n\n=========================================\n");
printf("\tProcess\t\tWaiting\t\tTurnAround\n");
printf("===============================================");
for(i=0;i<nop;i++)
printf("\n\t%d\t\t%d\t\t%d",i+1,wt[i],tt[i]);
printf("\n==============================================\n");
awt=(float)twt/(float)nop;
att=(float)ttt/(float)nop;
Output:
==========================================
CPU Scheduling
========================================
Enter No of Processes:5
P1:7
P2:9
P3:7
P4:8
P5:4
Gantt Chart
==============================================
===============================================
1 0 5
2 5 10
3 10 15
4 15 20
5 20 24
1 24 26
2 26 30
3 30 32
4 32 35
=========================================
===============================================
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
1 19 26
2 21 30
3 25 32
4 27 35
5 20 24
RESULT:
Thus, Round Robin Scheduling is done and the output is verified successfully.
AIM:
To implement Unix C program for Inter process communication using shared memory.
ALGORITHM:
STEP 1: Create the shared memory for parent process using shmget() system call.
STEP 2: Now allow the parent process to write in shared memory using shmget pointer which is
return type of shmget().
STEP 3: Now across and attach the same shared memory to the child process.
STEP 4: The data in the shared memory is read by the child process using the shmdt pointer
SENDER:
#include <stdio.h>
#include <sys/shm.h>
#include <sys/ipc.h>
#define size 32
int main()
int shmid;
char *s[100],*str;
shmid=shmget(60,size,IPC_CREAT|0666);
str=shmat(shmid,0,0);
gets(s);
strcpy(str,s);
return 0;
RECEIVER:
#include <stdio.h>
#include <sys/ipc.h>
#define size 32
int main()
int shmid;
char *str;
shmid=shmget(60,size,IPC_CREAT|0666);
str=shmat(shmid,0,0);
puts(str);
return 0;
OUTPUT:
RESULT:
Thus, the IPC program using shared memory has been written and executed successfully.
AIM:
ALGORITHM:
STEP 2: Invoke the wait() to enter into critical section and signal() is for exit section.
mutex=wait (mutex);
Full=signal (Full);
empty=walt (empty);
x++;
Mutex=wait(mutex);
empty=signal (empty),
consumes an item
STEP 5: If the Buffer s empty then the Consumer will not consume the items.
STEP 6: of the Buffer is full then the Producer will not produce the items.
PROGRAM:
#include<stdio.h>
#include<stdlib.h>
int mutex=1,full=0,empty=3,x=0;
int main()
int n;
void producer();
void consumer();
int wait(int);
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
int signal(int);
printf("\n1.Producer\n2.Consumer\n3.Exit");
while(1)
scanf("%d",&n);
switch(n)
case 1:
if((mutex==1)&&(empty!=0))
producer();
else
printf("Buffer is full!");
break;
case 2:
if((mutex==1)&&(full!=0))
consumer();
else
printf("Buffer is empty!!");
break;
case 3:
exit(0);
break;
return 0;
int wait(int s)
return(--s);
int signal(int s)
return(++s);
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
}
void producer()
mutex=wait(mutex);
full=signal(full);
empty=wait(empty);
x++;
mutex=signal(mutex);
void consumer()
mutex=wait(mutex);
full=wait(full);
empty=signal(empty);
x--;
mutex=signal(mutex);
Output:
1.Producer
2.Consumer
3.Exit
Buffer is full!
Buffer is empty!!
RESULT:
Thus, the implementation of producer, consumer problem using semaphore has been executed
successfully.
AIM:
ALGORITHM:
STEP 4: Get the avail value, allocation and max value for all processes based on each resource.
STEP 9: If the new request comes then check that the system is in safety or not if we allow the
request .
PROGRAM:
#include<stdio.h>
struct file
int all[10];
int max[10];
int need[10];
int flag;
};
void main()
int avail[10],seq[10];
scanf("%d",&n);
printf("Enter no of resources:");
scanf("%d",&r);
for(i=0;i<n;i++)
for(j=0;j<r;j++)
scanf("%d",&f[i].all[j]);
for(j=0;j<r;j++)
scanf("%d",&f[i].max[j]);
f[i].flag=0;
for(i=0;i<r;i++)
scanf("%d",&avail[i]);
scanf("%d",&id);
for(i=0;i<r;i++)
scanf("%d",&newr);
f[id].all[i]+=newr;
avail[i]=avail[i]-newr;
for(i=0;i<n;i++)
for(j=0;j<r;j++)
f[i].need[j]=f[i].max[j]-f[i].all[j];
if(f[i].need[j]<0)
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
f[i].need[j]=0;
cnt=0;
f1=0;
while(cnt!=n)
g=0;
for(j=0;j<n;j++)
if(f[j].flag==0)
b=0;
for(p=0;p<r;p++)
if(avail[p]>=f[j].need[p])
b=b+1;
else
b=b-1;
if(b==r)
printf("\np%d is visited",j);
seq[f1++]=j;
f[j].flag=1;
for(k=0;k<r;k++)
avail[k]=avail[k]+f[j].all[k];
cnt=cnt+1;
printf("(");
for(k=0;k<r;k++)
printf("%3d",avail[k]);
printf(")");
g=1;
}
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
}
if(g==0)
goto y;
for(i=0;i<f1;i++)
printf("p%d",seq[i]);printf(")");
y:printf("\nProcess\t\tAllocation\t\tMax\t\t\tNeed\n");
for(i=0;i<n;i++)
printf("p%d\t",i);
for(j=0;j<r;j++)
printf("%6d",f[i].all[j]);
for(j=0;j<r;j++)
printf("%6d",f[i].max[j]);
for(j=0;j<r;j++)
printf("%6d",f[i].need[j]);
printf("\n");
OUTPUT:
Enter no of processes:5
Enter no of resources:3
Enter max -- 7
Enter allocation -- 2
Enter max -- 3
Enter allocation -- 3
Enter max -- 9
Enter allocation -- 2
Enter max -- 2
Enter allocation -- 0
Enter max -- 4
3
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
Enter available resources -- 3
Enter pid -- 1
p1 is visited( 5 3 2)
p3 is visited( 7 4 3)
p4 is visited( 7 4 5)
p0 is visited( 7 5 5)
p2 is visited( 10 5 7)
P0 0 1 0 7 5 3 7 4 3
P1 3 0 2 3 2 2 0 2 0
P2 3 0 2 9 0 2 6 0 0
P3 2 1 1 2 2 2 0 1 1
P4 0 0 2 4 3 3 4 3 1
[******@telnet ~]$
RESULT:
Thus, the banker’s algorithm for deadlock avoidance has been written and executed successfully.
AIM:
ALGORITHM:
STEP 1: Mark each process that has a row in the Allocation matrix if all zeros.
STEP 3: Find on index i such that process i is currently unmarked and the row of Q is less than or
equal to W. That is, Q ik..... Wk For 1...k...m. If no such now is found, terminate the algorithm.
STEP 4: If such a row is found, mark process and add the corresponding row of the allocation matrix
to W. That is, Set Wk=Wk+Aik, For l...k...m. Return to Step 3.
PROGRAM:
#include <stdio.h>
int i,j,np,nr;
int main()
int alloc[10][10],request[10][10],avail[10],r[10],w[10];
scanf("%d",&np);
scanf("%d",&nr);
for(i=0;i<nr;i++)
scanf("%d",&r[i]);
for(i=0;i<np;i++)
for(j=0;j<nr;j++)
scanf("%d",&request[i][j]);
for(j=0;j<nr;j++)
scanf("%d",&alloc[i][j]);
for(j=0;j<nr;j++)
avail[j]=r[j];
for(i=0;i<np;i++)
avail[j]-=alloc[i][j];
for(i=0;i<np;i++)
int count=0;
for(j=0;j<nr;j++)
if(alloc[i][j]==0)
count++;
else
break;
if(count==nr)
mark[i]=1;
for(j=0;j<nr;j++)
w[j]=avail[j];
for(i=0;i<np;i++)
int canbeprocessed=0;
if(mark[i]!=1)
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
{
for(j=0;j<nr;j++)
if(request[i][j]<=w[j])
canbeprocessed=0;
else
canbeprocessed=0;
break;
if(canbeprocessed)
mark[i]=1;
for(j=0;j<nr;j++)
w[j]+=alloc[i][j];
int deadlock=0;
for(i=0;i<np;i++)
if(mark[i]!=1)
deadlock=1;
if(deadlock)
else
Output:
00101
00001
10101
11000
00010
00000
Deadlock detected
RESULT:
Thus, the deadlock detection algorithm has been written and executed successfully.
AIM:
ALGORITHM:
STEP 2: When a program starts up and becomes a process, it starts with a default thread. So, we can
say that every process has atleast one thread of control.
STEP 3: A process can create extra threads wing the following functions.
#include <pthread.h>
*restrict tidp, const pthread attr_t *restrict attr. void (*start_rtn) (void), void *restrict avg).
STEP 4: Inside the function "defome Thing()” the thread uses pthread self() and pthread.equ
Functions to identify whether the execution thread is the first one or second one is created.
STEP 5: Also inside the same function dofome Thing() a For loop is run so as to stimulate sometime
consuming work.
PROGRAM:
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
pthread_mutex_t lock;
pthread_mutex_lock(&lock);
return NULL;
main()
if (pthread_mutex_init(&lock, NULL) != 0)
while(i < 2)
i++;
return 0;
Output:
$ cc filename.c -lpthread
$ ./a.out
Job 1 started
Job 1 finished
Job 2 started
Job 2 finished
RESULT:
Thus, the implementation of the threading and synchronization application using C program has
been executed successfully.
AIM:
ALGORITHM:
STEP 1: Start.
STEP 2: Read the number of Free blocks and size of each Free block.
STEP 4: Allocate the first hole that is big enough to load the process.
STEP 5: If no hole is big enough to load the process, then process cannot be allocate.
STEP 7: Stop.
PROGRAM:
#include<stdio.h>
int main()
int i,j,bno,bsize[10],pno,psize[10];
scanf("%d",&bno);
for(i=0;i<bno;i++)
scanf("%d",&bsize[i]);
printf("No of process:");
scanf("%d",&pno);
printf("Size of process");
for(i=0;i<pno;i++)
scanf("%d",&psize[i]);
for(i=0;i<bno;i++)
for(i=0;i<pno;i++)
printf("\nFirst fit");
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
printf("\npno\tallocated block\tallocated size\tfragment\n");
i=0;
while(i<pno)
for(j=0;j<bno;j++)
if(psize[i]<bsize[j])
bsize[j]-=psize[i];
break;
printf("%d\t\t%d\t\t%d\t\t%d\n",i+1,j+1,psize[i],bsize[j]);
i++;
printf("\nFragment size negative or more than max allocated block that process is out of memory otherwise
all process fit into memory"); 7,1 60%
return 0;
No of process:4
First fit
1 2 212 288
2 5 417 183
3 2 112 176
4 6 426 32767
Fragment size negative or more than max allocated block that process is out of memory otherwise all
process fit into memory
[******@telnet ~]$
RESULT:
Thus, the dynamic storage allocation scheme using First Fit Algorithm has been written and executed
successfully.
AIM:
ALGORITHM:
STEP 1: Start.
STEP 2: Read the number of Free blocks and size of each Free block.
STEP 4: Allocate the smallest hole that is big enough to load the process.
STEP 5: If no hole is big enough to load the process, then process cannot be allocated.
STEP 7: Stop.
PROGRAM:
#include<stdio.h>
#define max 25
void main()
int frag[max],b[max],f[max],i,j,nb,nf,temp,lowest=10000;
scanf("%d",&nb);
scanf("%d",&nf);
for(i=1;i<=nb;i++)
printf("Block %d:",i);
scanf("%d",&b[i]);
for(i=1;i<=nf;i++)
scanf("%d",&f[i]);
for(i=1;i<=nf;i++)
for(j=1;j<=nb;j++)
if(bf[j]!=1)
temp=b[j]-f[i];
if(temp>=0)
if(lowest>temp)
ff[i]=j;
lowest=temp;
frag[i]=lowest;
bf[ff[i]]=1;
lowest=10000;
printf("\nFile_no\tFile_size\tBlock_no\tBlock_size\tFragment");
printf("\n%d\t\t%d\t\t%d\t\t%d\t\t%d",i,f[i],ff[i],b[ff[i]],frag[i]);
Block 1:200
Block 2:400
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
Block 3:600
Block 4:500
Block 5:300
Block 6:250
File 1:357
File 2:210
File 3:468
File 4:491
File 5:40
1 357 2 400 43
2 210 6 250 40
3 468 4 500 32
5 40 1 200 160
[******@telnet ~]$
RESULT:
Thus, the dynamic storage allocation scheme using Best Fit Algorithm has been written and
executed successfully.
AIM:
ALGORITHM:
STEP 1: Start.
STEP 2: Read the number of Free blocks and size of each Free block.
STEP 4: Allocate the largest hole that is big enough to load the process.
STEP 5: If no hole is big enough to load the process, then process cannot be allocated.
STEP 7: Stop.
PROGRAM:
#include <stdio.h>
#define max 25
void main()
int frag[max],b[max],f[max],i,j,nb,nf,temp,highest=0;
scanf("%d",&nb);
scanf("%d",&nf);
for(i=1;i<=nb;i++)
printf("Block %d:",i);
scanf("%d",&b[i]);
for(i=1;i<=nf;i++)
printf("File %d:",i);
scanf("%d",&f[i]);
for(i=1;i<=nf;i++)
for(j=1;j<=nb;j++)
if(bf[j]!=1)
temp=b[j]-f[i];
if(temp>=0)
if(highest<temp)
ff[i]=j;
highest=temp;
frag[i]=highest;
bf[ff[i]]=1;
highest=0;
for(i=1;i<=nf;i++)
printf("\n %d\t\t%d\t\t%d\t\t%d\t\t%d",i,f[i],ff[i],b[ff[i]],frag[i]);
Output:
Block 1:200
Block 2:400
13,7 Bot
Block 3:600
Block 4:500
Block 5:300
Block 6:250
File 1:357
File 2:210
File 3:468
File 4:491
File 5:40
3 468 0 1 0
4 491 0 1 0
5 40 2 400 360
RESULT:
Thus, the dynamic storage allocation scheme using Worst Fit Algorithm has been written and
executed successfully.
AIM:
ALGORITHM:
STEP 3: Get the number of pages, required is greater than the total number of available pages in
memory.
STEP 4: Then print Memory is full otherwise calculate remaining pages=$rem page-s[1]
STEP 5: Enter the page table info for each process and calculate the logical address to find physical
address.
STEP 6: When process is executed, pages loaded in available memory frames from their source.
PROGRAM:
#include <stdio.h>
#include <math.h>
main()
scanf("%d", &size);
m1 = size / 4; n = ceil(m1);
printf("Total No. of pages: %d", n); printf("\nEnter relative address (in hexa) \n");
scanf("%d", &ra);
printf("page table");
for(i=0;i<n;i++)
frameno = pagetable[pgno];
Output:
0 [5]
1 [6]
2 [7]
RESULT:
Thus, the paging technique of memory management is executed successfully and the output is
verified.
AIM:
ALGORITHM:
STEP 2: Get the reference string and store it in a array say rs.
STEP 7: For each page in reference string in the given order, examine:
PROGRAM:
#include <stdio.h>
main()
int i,j,k,f,pf=0,count=0,rs[25],m[10],n;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&rs[i]);
scanf("%d",&f);
for(i=0;i<f;i++)
m[i]=-1;
fir(i=0;i<n;i++)
for(k=0;k<f;k++)
if(m[k]==rs[i])
break;
if(k==f)
m[count++]=rs[i];
pf++;
for(j=0;j<f;j++)
printf("\t%d",m[j]);
if(k==f)
printf("\n");
if(count==f)
count=0;
return 0;
Output:
7 -1 0 PF NO. 1
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
7 -1 0
7 1 0 PF NO. 2
7 1 2 PF NO. 3
0 1 2 PF NO. 4
0 3 2 PF NO. 5
0 3 2
0 3 4 PF NO. 6
2 3 4 PF NO. 7
2 3 4
2 0 4 PF NO. 8
2 0 3 PF NO. 9
2 0 3
1 0 3 PF NO. 10
1 2 3 PF NO. 11
1 2 0 PF NO. 12
1 2 0
7 2 0 PF NO. 13
7 2 0
7 1 0 PF NO. 14
RESULT:
AIM:
ALGORITHM:
STEP 2: Get the reference string and store it in an array, say rs.
STEP 4: Create account access array to store counter that indicates a measure of recent usage.
STEP 5: Create a function as min that returns position of minimum of the given array.
STEP 10: For each page in reference starting in the given order, examine
(2) If there is an empty frame, Assign that frame to the page. Store incremented freq for that
position in accars array, Increment count.
(3). If there is no free frame then, Determine page to be replaced using as min function. Store
incremented freq For the page position in access array, Increment count
PROGRAM:
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
#include <stdio.h>
main()
int i,j,k,min,rs[25],m[10],count[10],flag[25],n,f,pf=0,next=1;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&rs[i]);
flag[i]=0;
scanf("%d",&f);
for(i=0;i<f;i++)
count[i]=0;
m[i]=-1;
for(i=0;i<n;i++)
for(j=0;j<f;j++)
if(m[j]==rs[i])
flag[i]=1;
count[j]=next;
next++;
if(flag[i]==0)
if(i<f)
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
{
m[i]=rs[i];
count[i]=next;
next++;
else
min=0;
for(j=1;j<f;j++)
if(count[min]>count[j])
min=j;
m[min]=rs[i];
count[min]=rs[i];
count[min]=next;
next++;
pf++;
for(j=0;j<f;j++)
printf("%d\t",m[j]);
if(flag[i]==0)
printf("PF NO.__%d",pf);
printf("\n");
Output:
7 0 -1 PF NO.__2
7 0 1 PF NO.__3
2 0 1 PF NO.__4
2 0 1
2 0 3 PF NO.__5
2 0 3
4 0 3 PF NO.__6
4 0 2 PF NO.__7
4 3 2 PF NO.__8
0 3 2 PF NO.__9
0 3 2
0 3 2
1 3 2 PF NO.__10
1 3 2
1 0 2 PF NO.__11
1 0 2
1 0 7 PF NO.__12
1 0 7
1 0 7
RESULT:
Thus, page replacement was implemented using LRU Algorithm and the output is verified.
AIM:
ALGORITHM:
STEP 2: Read the length of the reference string and also get the reference string.
STEP 4: Allocate the pages in to frames by selecting the page that will not use for the longest period
of time.
PROGRAM:
#include <stdio.h>
void main()
int rs[50],i,j,k,m,f,cntr[20],a[20],min,pf=0;
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d",&rs[i]);
scanf("%d",&f);
for(i=0;i<f;i++)
cntr[i]=0;
a[i]=-1;
for(i=0;i<m;i++)
for(j=0;j<f;j++)
if(rs[i]==a[j])
cntr[j]++;
break;
if(j==f)
min=0;
for(k=1;k<f;k++)
if(cntr[k]<cntr[min])
min=k;
a[min]=rs[i];
cntr[min]=1;
pf++;
printf("\n");
for(j=0;j<f;j++)
printf("\t %d",a[j]);
if(j==f)
Output:
2
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
0
7 -1 -1 pf not 1
7 0 -1 pf not 2
7 0 1 pf not 3
2 0 1 pf not 4
2 0 1 pf not 4
3 0 1 pf not 5
3 0 1 pf not 5
4 0 1 pf not 6
2 0 1 pf not 7
3 0 1 pf not 8
3 0 1 pf not 8
3 0 1 pf not 8
3 0 2 pf not 9
3 0 1 pf not 10
3 0 2 pf not 11
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
3 0 2 pf not 11
3 0 1 pf not 12
3 0 7 pf not 13
3 0 7 pf not 13
3 0 1 pf not 14
RESULT:
Thus, the LFU page replacement algorithm has been written and executed successfully.
AIM:
To implement Unix C program for file organization techniques for single level directory.
ALGORITHM:
STEP 1: Get name of directory for the user to store all the files.
PROGRAM:
#include<stdio.h>
#include<string.h>
struct
char dname[10],fname[10][10];
int fcnt;
}dir;
void main()
int i,ch;
char f[30];
dir.fcnt = 0;
scanf("%s", dir.dname);
while(1)
scanf("%d",&ch);
switch(ch)
scanf("%s",dir.fname[dir.fcnt]);
dir.fcnt++;
break;
scanf("%s",f);
for(i=0;i<dir.fcnt;i++)
if(strcmp(f, dir.fname[i])==0)
strcpy(dir.fname[i],dir.fname[dir.fcnt-1]);
break;
if(i==dir.fcnt)
else
dir.fcnt--;
break;
case 3:
scanf("%s",f);
for(i=0;i<dir.fcnt;i++)
if(strcmp(f, dir.fname[i])==0)
break;
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
}
if(i==dir.fcnt)
break;
case 4:
if(dir.fcnt==0)
printf("\nDirectory Empty");
else
for(i=0;i<dir.fcnt;i++)
printf("\t%s",dir.fname[i]);
break;
default: exit(0);
Output:
[******@telnet ~]$
RESULT:
AIM:
ALGORITHM:
STEP 1: Assure number of blocks in the disk as 20 and all are free.
c) Check to see whether any black in the range (start, start, length-1) is allocated. If so, then go to
step 2.
d) Allocate blocks to the file contiguously from start block to start + length-1
STEP 6: Stop.
PROGRAM:
#include<conio.h>
void main()
clrscr();
for(i=0;i<50;i++)
f[i]=0;
x: count=0;
scanf("%d%d", &st,&len);
for(k=st;k<(st+len);k++)
count++;
if(len==count)
for(j=st;j<(st+len);j++)
if(f[j]==0)
f[j]=1;
printf("%d\t%d\n",j,f[j]);
if(j!=(st+len-1))
else
scanf("%d", &c);
if(c==1)
goto x;
else
exit(0);
getch();
Output:
10 1
11 1
12 1
25 1
26 1
27 1
28 1
29 1
30 1
RESULT:
Thus, the sequential allocation is done for the file with the available free blocks.
AIM:
ALGORITHM:
STEP 6: It the location is allocated set the flag= 1 and if free set flag=0 .
STEP 7: Print the file number, length and the block allocated.
PROGRAM:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
clrscr();
for(i=0;i<50;i++)
f[i]=0;
scanf("%d",&ind);
if(f[ind]!=1)
printf("Enter no of blocks needed and no of files for the index %d on the disk : \n", ind);
scanf("%d",&n);
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
}
else
goto x;
y: count=0;
for(i=0;i<n;i++)
scanf("%d", &index[i]);
if(f[index[i]]==0)
count++;
if(count==n)
for(j=0;j<n;j++)
f[index[j]]=1;
printf("Allocated\n");
printf("File Indexed\n");
for(k=0;k<n;k++)
printf("%d-------->%d : %d\n",ind,index[k],f[index[k]]);
else
goto y;
scanf("%d", &c);
if(c==1)
goto x;
else
exit(0);
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
getch();
Enter no of blocks needed and no of files for the index 5 on the disk :
1234
Allocated
File Indexed
5-------->1 : 1
5-------->2 : 1
5-------->3 : 1
5-------->4 : 1
Enter no of blocks needed and no of files for the index 6 on the disk :
78
A5llocated
File Indexed
6-------->7 : 1
6-------->8 : 1
RESULT:
Thus, the blocks for file were allocation using Indexed Allocation Method.
AIM:
ALGORITHM:
STEP 8: Display the linked File Allocation files blocks for that file.
STEP 9: Stop.
PROGRAM:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
clrscr();
for(i=0;i<50;i++)
f[i]=0;
scanf("%d",&p);
for(i=0;i<p;i++)
scanf("%d",&a);
f[a]=1;
scanf("%d%d", &st,&len);
k=len;
if(f[st]==0)
for(j=st;j<(st+k);j++)
if(f[j]==0)
f[j]=1;
printf("%d-------->%d\n",j,f[j]);
else
k++;
else
scanf("%d", &c);
if(c==1)
goto x;
else
exit(0);
getch();
2-------->1-
4-------->1-
10-------->1
11-------->1
12-------->1
13-------->1
[******@telnet ~]$
RESULT:
Thus, blocks for file were allocated using linked allocation method.
AIM:
ALGORITHM:
STEP 1: Let Request array represents an index of tracks that have been requested in ascending order
of their time of arrival. 'head' is the position of disk heads
STEP 2: Let us one by one take the tracks in default order and calculate the absolute distance of the
track from the head.
STEP 4: Currently serviced trade position now becomes the new head position.
STEP 5: Go to Step 2 until all tracks in request array have not been serviced.
PROGRAM:
#include<stdio.h>
int main()
int queue[100],n,head,i,j,k,seek=0,diff;
float avg;
printf("==============================================================");
printf("==============================================================\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&queue[i]);
scanf("%d",&head);
queue[0]=head;
printf("\n");
diff=abs(queue[j+1]-queue[j]);
seek+=diff;
avg=seek/(float)n;
return 0;
==============================================================
==============================================================
183
37
122
14
124
65
67
[******@telnet ~]$
RESULT:
Thus, the FCFS disk scheduling algorithm has been written and executed successfully.
AIM:
ALGORITHM:
STEP 1: Let Request array represents an array storing indexes of tracks that have been requested.
'head' is the position of disk head.
STEP 2: Find the positive distance of all trade in the request array from head.
STEP 3: Find a track from requested array which has not been accessed / serviced yet and has
minimum distance from head.
STEP 5: Currently serviced track position now becomes the new head position.
STEP 6: Go to step2 until all tracks in request array have not been serviced.
PROGRAM:
#include<stdio.h>
#include<math.h>
int main()
int queue[100],t[100],head,seek=0,n,i,j,temp;
float avg;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&queue[i]);
scanf("%d",&head);
for(i=1;i<n;i++)
t[i]=abs(head-queue[i]);
for(j=i+1;j<n;j++)
if(t[i]>t[j])
temp=t[i];
t[i]=t[j];
t[j]=temp;
temp=queue[i];
queue[i]=queue[j];
queue[j]=temp;
for(i=1;i<n-1;i++)
seek=seek+abs(head-queue[i]);
head=queue[i];
avg=seek/(float)n;
return 0;
183
37
122
14
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
124
65
67
[******@telnet ~]$
RESULT:
Thus, the SSTF disk scheduling algorithm has been written and executed successfully.
AIM:
ALGORITHM:
STEP 2: The head will start moving in the right direction i.e from the 0 to size of the block.
STEP 4: While moving in the right direction calculate the distance of the track from the head
movement.
STEP 8: If we reach the end, head will go from right to left and again stouts moving in the right
direction.
STEP 9: This process is completed, when all the requests are processed.
PROGRAM:
#include<stdio.h>
int main()
int queue[20],n,head,i,j,k,seek=0,max,diff,temp,queue1[20],queue2[20],temp1=0,temp2=0;
float avg;
scanf("%d",&max);
scanf("%d",&head);
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&temp);
if(temp>=head)
queue1[temp1]=temp;
temp1++;
else
queue2[temp2]=temp;
temp2++;
for(i=0;i<temp1-1;i++)
for(j=i+1;j<temp1;j++)
if(queue1[i]>queue1[j])
temp=queue1[i];
queue1[i]=queue1[j];
queue1[j]=temp;
for(i=0;i<temp2-1;i++)
for(j=i+1;j<temp2;j++)
if(queue2[i]>queue2[j])
temp=queue2[i];
queue2[i]=queue2[j];
queue2[j]=temp;
CS3461-OPERATING SYSTEMS LABORATORY E SHAPNA RANI, AP-CSE
}
for(i=1,j=0;j<temp1;i++,j++)
queue[i]=queue1[j];
queue[i]=max;
queue[i+1]=0;
for(i=temp1+3,j=0;j<temp2;i++,j++)
queue[i]=queue2[j];
queue[0]=head;
for(j=0;j<=n+1;j++)
diff=abs(queue[j+1]-queue[j]);
seek+=diff;
avg=seek/(float)n;
return 0;
Output:
200
50
RESULT:
Thus, the C-Scan disk scheduling algorithm has been written and executed successfully.
AIM:
Step 7: In the Next step you need to specify a key or a serial number of the operating
system. If you are using the trial version then that part can be skipped.
Step 8: Enter the name for the virtual machine and specify a path to the directory
where you want to create your virtual machine. It is recommended that the drive
you're selecting to install a virtual machine should have sufficient space.
Step 9: Specify the amount of disk space you want to allocate for a virtual machine.
Allocate disk space according to the size of the software you are going to install on the
virtual machine.
Step 11: It will allocate Hardware according to the default settings but you can
change it by using Customize Hardware button in the above screen.
You can specify what amount of RAM, a processor has to be allocated for a virtual
Also, do not allocate very little RAM or processor. Leave default settings or allocate
in machine. Do not allocate complete RAM or a complete Processor for a virtual
machine, such a way that your application should be able to run on the virtual
machine. Else it will result in a slow virtual machine.
Result:
Thus, guest operating system Linux installed using vmware.