Os Lab Manual Mani PDF
Os Lab Manual Mani PDF
system calls of UNIX operating system: fork, exec, getpid, exit, wait, close.
ALGORITHM:
3. Use fork() system call to create process, getppid() system call used to get the
parent process ID and getpid() system call used to get the current process ID
4. execvp() system call used to execute that command given on that command
line argument
#include<stdio.h>
main(int arc,char*ar[])
int pid;
char s[100];
pid=fork();
if(pid<0)
printf("error");
else if(pid>0)
wait(NULL);
execlp("cat","cat",ar[1],(char*)0);
else
printf("\nChild process:");
write(1,s,strlen(s));
printf(" ");
printf(" ");
printf(" ");
execvp(ar[2],&ar[2]);
OUTPUT:
Child process:
Child process id :
Parent Process:
sd
sd
dsaASD
EX NO:2 Write a program using the I/O system calls of UNIX
operating system (open,read, write, etc)
AIM:
To write a program using the I/O system calls of UNIX operating system (open,
ALGORITHM:
4. Show the file properties (access time, modified time, & etc,.)
#include<stdio.h>
#include<sys/stat.h>
#include<time.h>
main(int ag,char*arg[])
char buf[100];
struct stat s;
int fd1,fd2,n;
fd1=open(arg[1],0);
fd2=creat(arg[2],0777);
stat(arg[2],&s);
if(fd2==-1)
printf("ERROR IN CREATION");
while((n=read(fd1,buf,sizeof(buf)))>0)
if(write(fd2,buf,n)!=n)
close(fd1);
close(fd2);
close(fd1);
close(fd2);
}
OUTPUT:
ALGORITHM:
6. Start with the first process from it’s selection as above and let other process to
be in queue.
#include<stdio.h>
main()
float avgwt,avgtt;
char pname[10][10],c[10][10];
int wt[10],tt[10],bt[10],at[10],t,q,i,n,sum=0,sbt=0,ttime,j,ss=0;
scanf("%d",&n);
printf("\n\n Enter the NAME , BURST TIME and ARRIVAL TIME of the
process");
for(i=0;i<n;i++)
scanf("%s",&pname[i]);
scanf("%d",&bt[i]);
scanf("%d",&at[i]);
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
if(at[i]>at[j])
{
t=at[i];
at[i]=at[j];
at[j]=t;
q=bt[i];
bt[i]=bt[j];
bt[j]=q;
strcpy(c[i],pname[i]);
Strcpy(pname[i],pname[j]);
strcpy(pname[j],c[i]);
wt[0]=0;
for(i=0;i<n;i++)
wt[i+1]=wt[i]+bt[i];
sum=sum+(wt[i]-at[i]);
sbt=sbt+(wt[i+1]-at[i]);
tt[i]=wt[i]+bt[i];
ss=ss+bt[i];
avgwt=(float) sum/n;
avgtt=(float)sbt/n;
printf("|\t%s\t",pname[i]);
printf("\n");
for(i=0;i<n;i++)
printf("%d\t\t",wt[i]);
printf("%d\n",ss);
printf("\n");
OUTPUT:
Enter the NAME , BURST TIME and ARRIVAL TIME of the process
NAME : p1
BURST TIME : 4
ARRIVAL TIME : 0
NAME : p2
BURST TIME : 9
ARRIVAL TIME : 2
NAME : p3
BURST TIME : 8
ARRIVAL TIME : 4
NAME : p4
BURST TIME : 3
ARRIVAL TIME : 3
Average waiting time = 6.000000
GANTT CHART
| p1 | p2 | p4 | p3
0 4 13 16 24
EX NO:4 Write a Scheduling algorithm program for simulation of
SJF
AIM:
ALGORITHM:
4. Select the process which have shortest burst will execute first.
5. If two process have same burst length then FCFS scheduling algorithm used.
7. Start with the first process from it’s selection as above and let other process to
be in queue.
#include<stdio.h>
main()
float avgwt,avgtt;
char pname[10][10],c[10][10];
int wt[10],tt[10],bt[10],at[10],t,q,i,n,sum=0,sbt=0,ttime,j,ss=0;
scanf("%d",&n);
processes ");
for(i=0;i<n;i++)
scanf("%s",&pname[i]);
scanf("%d",&bt[i]);
scanf("%d",&at[i]);
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
if(at[i]==at[j])
if(bt[i]>bt[j])
{
t=at[i];
at[i]=at[j];
at[j]=t;
q=bt[i];
bt[i]=bt[j];
bt[j]=q;
strcpy(c[i],pname[i]);
strcpy(pname[i],pname[j]);
strcpy(pname[j],c[i]);
if(at[i]!=at[j])
if(bt[i]>bt[j])
t=at[i];
at[i]=at[j];
at[j]=t;
q=bt[i];
bt[i]=bt[j];
bt[j]=q;
strcpy(c[i],pname[i]);
strcpy(pname[i],pname[j]);
strcpy(pname[j],c[i]);
}
wt[0]=0;
for(i=0;i<n;i++)
wt[i+1]=wt[i]+bt[i];
sum=sum+(wt[i]-at[i]);
sbt=sbt+(wt[i+1]-at[i]);
tt[i]=wt[i]+bt[i];
ss=ss+bt[i];
printf("\n\n---------------------------------------------------------------------- \n");
for(i=0;i<n;i++)
printf("|\t%s\t",pname[i]);
printf("\n-----------------------------------------------------------------------\n");
for(i=0;i<n;i++)
printf("%d\t\t",wt[i]);
printf("%d\n",ss);
printf("\n--------------------------------------------------------------------------");
avgwt=(float)sum/n;
avgtt=(float)sbt/n;
}
OUTPUT:
NAME : p0
BURST TIME : 2
ARRIVAL TIME : 0
NAME : p1
BURST TIME : 4
ARRIVAL TIME : 0
NAME : p2
BURST TIME : 5
ARRIVAL TIME : 0
NAME : p3
BURST TIME : 6
ARRIVAL TIME : 0
NAME : p4
BURST TIME : 8
ARRIVAL TIME : 0
GANTT CHART
----------------------------------------------------------------------
| p0 | p1 | p2 | p3 | p4
-----------------------------------------------------------------------
0 2 6 11 17 25
.
EX NO: 5 Write a program for implementing the round robin
Scheduling Algorithm
AIM:
ALGORITHM:
8. Make the CPU scheduler goes around the ready queue allocating CPU to each
9. Make the CPU scheduler picks the first process and sets time to interrupt after
10. If the process has burst less than the time quantum than the process releases
the CPU.
PROGRAM:
#include<stdio.h>
main()
int pt[10][10],a[10][10],at[10],pname[10][10],i,j,n,k=0,q,sum=0;
float avg;
scanf("%d",&n);
for(i=0;i<10;i++)
for(j=0;j<10;j++)
pt[i][j]=0;
a[i][j]=0;
for(i=0;i<n;i++)
j=0;
scanf("%d",&pt[i][j]);
scanf("%d",&q);
printf("\n\n");
for(j=0;j<10;j++)
for(i=0;i<n;i++)
a[2*j][i]=k;
if((pt[i][j]<=q)&&(pt[i][j]!=0))
pt[i][j+1]=0;
k+=pt[i][j];
a[2*j+1][i]=k;
else if(pt[i][j]!=0)
pt[i][j+1]=pt[i][j]-q;
k+=q;
a[2*j+1][i]=k;
else
a[2*j][i]=0;
a[2*j+1][i]=0;
}
}
for(i=0;i<n;i++)
sum+=a[0][i];
for(i=0;i<n;i++)
for(j=1;j<10;j++)
if((a[j][i]!=0)&&(a[j+1][i]!=0)&&((j+1)%2==0))
sum+=((a[j+1][i]-a[j][i]));
avg=(float)sum/n;
sum=avg=0;
for(j=0;j<n;j++)
i=1;
while(a[i][j]!=0)
i+=1;
sum+=a[i-1][j];
avg=(float)sum/n;
}
OUTPUT:
Enter the process time for process 1 : 8 Enter the process time for process 2 : 3 Enter the
process time for process 3 : 6 Enter the process time for process 4 : 1
0 P1 2
2 P2 4
4 P3 6
6 P4 7
7 P1 9
9 P2 10
10 P3 12
12 P1 14
14 P3 16
16 P1 18
Priority of process3 : 2
Priority of process4 : 4
GANTT CHART
------------------------------------------------------
| p1 | p3 | p4 | p2
------------------------------------------------------
0 8 14 15 28
with pipes.
ALGORITHM:
2. Read the input from parent process and perform in child process.
#include<stdio.h>
#include<unistd.h>
#include<sys/ipc.h>
#include<sys/uio.h>
#include<sys/types.h>
main()
int pid,pfd[2],n,a,b,c;
if(pipe(pfd)==-1)
exit(1);
pid=fork();
if(pid>0)
printf("\nParent Process");\
printf("\n\n\tFibonacci Series");
scanf("%d",&n);
close(pfd[0]);
write(pfd[1],&n,sizeof(n));
close(pfd[1]);
exit(0);
}
else
close(pfd[1]);
read(pfd[0],&n,sizeof(n));
printf("\nChild Process");
a=0;
b=1;
close(pfd[0]);
printf("\n\n%d\n%d",a,b);
while(n>2)
c=a+b;
printf("\n%d",c);
a=b;
b=c;
n--;
}
OUTPUT:
Parent Process
Fibonacci Series
Child Process
01123
EX NO:8 Implement the Producer – Consumer problem using
semaphores (usingUNIX system calls).
AIM:
To write a program for Implement the Producer – Consumer problem using semaphores
ALGORITHM:
#include<stdio.h>
int mutex=1,full=0,empty=3,x=0;
main()
int n;
void producer();
void consumer();
int wait(int);
int signal(int);
printf("\n1.PRODUCER\n2.CONSUMER\n3.EXIT\n");
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;
int wait(int s)
return(--s);
int signal(int s)
return(++s);
void producer()
mutex=wait(mutex);
full=signal(full);
empty=wait(empty);
x++;
void consumer()
mutex=wait(mutex);
full=wait(full);
empty=signal(empty);
x--;
mutex=signal(mutex);
}
OUTPUT:
1.PRODUCER
2.CONSUMER
3.EXIT
2BUFFER IS EMPTY
3
EX NO:10 a) Implement first fit algorithm for memory management
AIM:
ALGORITHM
6. If not start at the hole that is sharing the pervious first fit search end.
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
struct allocate
int pid;
int st_add;
int end_add;
};
struct free_list
int st_add;
int end_add;
};
struct process
int pid;
int size;
};
printf("\n================");
while(temp_a!=NULL)
temp_a- >st_add,temp_a->end_add);
temp_a=temp_a->next;
printf("\n=================");
while(temp_f!=NULL)
temp_f->end_add);
temp_f=temp_f->next;
void insert(int p)
{
struct free_list *temp_f;
int i,n;
do
srand((unsigned int)time((time_t*)NULL));
n=rand()%5;
while(n==0);
for(i=0;i<n;i++)
pro[i].pid=i+p;
do
pro[i].size=rand()%300;
while(pro[i].size==0);
for(i=0;i<n;i++)
temp_f=flist;
temp_a=alot;
temp_f=temp_f->next;
if(temp_f!=NULL)
pre_a->st_add=temp_f->st_add;
pre_a->end_add=temp_f->st_add=temp_f->st_add+pro[i].size;
pre_a->pid=pro[i].pid;
if(temp_a==NULL)
alot=pre_a;
pre_a->next=NULL;
else
while(temp_a->next!=NULL)
temp_a=temp_a->next;
temp_a->next=pre_a;
pre_a->next=NULL;
}
else
display_alot(alot);
display_free(flist);
getch();
void main()
int no,n,i,nod,ndpid;
clrscr();
alot=NULL;
flist->st_add=0;
flist->end_add=1024;
flist->next=NULL;
insert(0);
do
srand((unsigned int)time((time_t*)NULL));
nod=rand()%2;
}
while(nod==0);
for(i=0;i<nod;i++)
scanf("%d",&ndpid);
temp_a=alot;
temp_f=flist;
pre_a=temp_a;
temp_a=temp_a->next;
if(temp_a!=NULL)
if(alot==temp_a)
alot=temp_a->next;
else
pre_a->next=temp_a->next;
pre_f=NULL;
pre_f=temp_f;
temp_f=temp_f->next;
}
if(pre_f!=NULL && pre_f->end_add==temp_a->st_add)
pre_f->end_add=temp_a->end_add;
else if(pre_f!=NULL&&temp_f!=NULL&&
temp_f- >st_add==temp_a->end_add)
temp_f->st_add=temp_a->st_add;
else
free_alot=(struct free_list*)malloc(sizeof
(struct free_list));
free_alot->st_add=temp_a->st_add;
free_alot->end_add=temp_a->end_add;
if(pre_f!=NULL)
pre_f->next=free_alot;
free_alot->next=temp_f;
if(flist==temp_f)
flist=free_alot;
free(temp_a);
temp_f=flist;
while(temp_f!=NULL)
{
if(temp_f->end_add==temp_f->next->st_add)
temp_f->end_add=temp_f->next->end_add;
temp_f->next=temp_f->next->next;
temp_f=temp_f->next;
display_alot(alot);
display_free(flist);
getch();
insert(10);
}
OUTPUT:
no. of process:3
allocated list:
================
free list:
=================
st_add:120 end_add:1024
allocated list:
================
free list:
=================
st_add:305 end_add:1024
allocated list:
================
free list:
=================
st_add:551 end_add:1024
process to be deleted:0
allocated list:
================
free list:
=================
st_add:0 end_add:120
st_add:551 end_add:1024
no. of process:3
allocated list:
================
free list:
=================
st_add:0 end_add:120
st_add:746 end_add:1024
allocated list:
================
process:1 st_add:120 end_add:305
free list:
=================
st_add:96 end_add:120
st_add:746 end_add:1024
allocated list:
================
free list:
=================
st_add:96 end_add:120
st_add:894 end_add:1024
EX NO: Implement Best fit algorithm for memory management
AIM :
ALGORITHM:
6. If not start at the hole that is sharing the pervious best fit search end.
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
struct allocate
int pid;
int st_add;
int end_add;
};
struct free_list
int st_add;
int end_add;
};
struct process
int pid;
int size;
};
printf("\n================");
while(temp_a!=NULL)
temp_a->st_add,temp_a->end_add);
temp_a=temp_a->next;
printf("\n=================");
while(temp_f!=NULL)
temp_f->end_add);
temp_f=temp_f->next;
void insert(int p)
{
struct free_list *temp_f;
int i,n;
do
srand((unsigned int)time((time_t*)NULL));
n=rand()%10;
while(n==0);
for(i=0;i<n;i++)
pro[i].pid=i+p;
do
pro[i].size=rand()%550;
while(pro[i].size==0);
for(i=0;i<n;i++)
temp_f=flist;
temp_a=alot;
temp_f=temp_f->next;
if(temp_f!=NULL)
pre_a->st_add=temp_f->st_add;
pre_a->end_add=temp_f->st_add=temp_f->st_add+pro[i].size;
pre_a->pid=pro[i].pid;
if(temp_a==NULL)
alot=pre_a;
pre_a->next=NULL;
else
while(temp_a->next!=NULL)
temp_a=temp_a->next;
temp_a->next=pre_a;
pre_a->next=NULL;
}
else
display_alot(alot);
display_free(flist);
getch();
void bestfit(int p)
int i,n,rem_space;
do
srand((unsigned int)time((time_t*)NULL));
n=rand()%10;
while(n==0);
printf("\n no of processes:%d",n);
for(i=0;i<n;i++)
pro[i].pid=i+p;
do
pro[i].size=rand()%200;
}
while(pro[i].size==0);
for(i=0;i<n;i++)
temp_f=flist;
temp_a=alot;
enough_hole=NULL;
rem_space=1024;
while(temp_f!=NULL)
if(temp_f->end_add - temp_f->
st_add - pro[i].size<rem_space)
rem_space=temp_f->end_add - temp_f->
st_add - pro[i].size;
enough_hole=temp_f;
temp_f=temp_f->next;
if(enough_hole!=NULL)
{
pre_a->st_add=enough_hole->st_add;
pre_a->end_add=enough_hole->st_add=
enough_hole->st_add + pro[i].size;
pre_a->pid=pro[i].pid;
if(temp_a==NULL)
alot=pre_a;
pre_a->next=NULL;
else
while(temp_1->next!=NULL)
temp_a=temp_a->next;
temp_a->next=pre_a;
pre_a->next=NULL;
else
display_alot(alot);
display_free(flist);
getch();
void main()
int no,n,i,nod,ndpid;
clrscr();
alot=NULL;
flist->st_add=0;
flist->end_add=1024;
flist->next=NULL;
insert(0);
do
srand((unsigned int)time((time_t*)NULL));
nod=rand()%5;
while(nod==0);
for(i=0;i<nod;i++)
{
printf("\n\n\n process to be deleted:");
scanf("%d",&ndpid);
temp_a=alot;
temp_f=flist;
pre_a=temp_a;
temp_a=temp_a->next;
if(temp_a!=NULL)
if(alot==temp_a)
alot=temp_a->next;
else
pre_a->next=temp_a->next;
pre_f=NULL;
pre_f=temp_f;
temp_f=temp_f->next;
pre_f->end_add=temp_a->end_add;
else if(pre_f!=NULL&&temp_f!=NULL&&
temp_f->st_add==temp_a->end_add)
temp_f->st_add=temp_a->st_add;
else
free_alot=(struct free_list*)malloc(sizeof
(struct free_list));
free_alot->st_add=temp_a->st_add;
free_alot->end_add=temp_a->end_add;
if(pre_f!=NULL)
pre_f->next=free_alot;
free_alot->next=temp_f;
if(flist==temp_f)
flist=free_alot;
free(temp_a);
temp_f=flist;
while(temp_f!=NULL)
if(temp_f->end_add==temp_f->next->st_add)
temp_f->end_add=temp_f->next->end_add;
temp_f->next=temp_f->next->next;
}
temp_f=temp_f->next;
display_alot(alot);
display_free(flist);
getch();
bestfit(10);
}
OUTPUT:
no. of process:7
allocated list:
================
free list:
=================
st_add:351 end_add:1024
allocated list:
================
free list:
=================
st_add:817 end_add:1024
allocated list:
================
free list:
=================
st_add:817 end_add:1024
allocated list:
================
free list:
=================
st_add:817 end_add:1024
allocated list:
================
free list:
=================
st_add:817 end_add:1024
allocated list:
================
=================
st_add:817 end_add:1024
allocated list:
================
free list:
=================
st_add:906 end_add:1024
process to be deleted:0
allocated list:
================
free list:
=================
st_add:0 end_add:351
st_add:906 end_add:1024
process to be deleted:2
allocated list:
================
free list:
=================
st_add:0 end_add:351
st_add:906 end_add:1024
process to be deleted:3
allocated list:
================
free list:
=================
st_add:0 end_add:351
st_add:906 end_add:1024
process to be deleted:4
allocated list:
================
free list:
=================
st_add:0 end_add:351
st_add:906 end_add:1024
no of processes:9
allocated list:
================
free list:
=================
st_add:155 end_add:351
st_add:906 end_add:1024
allocated list:
================
free list:
=================
st_add:155 end_add:351
st_add:949 end_add:1024
================
free list:
=================
st_add:343 end_add:351
st_add:949 end_add:1024
allocated list:
================
free list:
=================
st_add:350 end_add:351
st_add:949 end_add:1024
allocated list:
================
free list:
=================
st_add:350 end_add:351
st_add:949 end_add:1024
allocated list:
================
free list:
=================
st_add:350 end_add:351
st_add:949 end_add:1024
allocated list:
================
free list:
=================
st_add:350 end_add:351
st_add:949 end_add:1024
allocated list:
================
free list:
=================
st_add:350 end_add:351
st_add:1000 end_add:1024
allocated list:
================
free list:
=================
st_add:350 end_add:351
st_add:1000 end_add:1024
EX NO:10 b) Implement worst fit algorithm for memory
management
AIM :
ALGORITHM:
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
struct allocate
};
struct free_list
};
struct process
};
printf("\n================");
while(temp_a!=NULL)
{
temp_a->st_add,temp_a->end_add);
temp_a=temp_a->next;
printf("\n=================");
while(temp_f!=NULL)
temp_f=temp_f->next;
void insert(int p)
int i,n;
do
srand((unsigned int)time((time_t*)NULL));
n=rand()%10;
}
while(n==0);
for(i=0;i<n;i++)
pro[i].pid=i+p;
do
pro[i].size=rand()%550;
while(pro[i].size==0);
for(i=0;i<n;i++)
temp_f=flist;
temp_a=alot;
temp_f=temp_f->next;
if(temp_f!=NULL)
pre_a->st_add=temp_f->st_add;
pre_a->end_add=temp_f->st_add=temp_f->st_add+pro[i].size;
pre_a->pid=pro[i].pid;
if(temp_a==NULL)
alot=pre_a;
pre_a->next=NULL;
else
while(temp_a->next!=NULL)
temp_a=temp_a->next;
temp_a->next=pre_a;
pre_a->next=NULL;
else
display_alot(alot);
display_free(flist);
getch();
void worstfit(int p)
{
int i,n;
do
srand((unsigned int)time((time_t*)NULL));
n=rand()%10;
while(n==0);
for(i=0;i<n;i++)
pro[i].pid=i+p;
do
pro[i].size=rand()%250;
while(pro[i].size==0);
for(i=0;i<n;i++)
temp_f=flist;
temp_a=alot;
big_hole=NULL;
while(temp_f!=NULL)
if(temp_f->end_add-temp_f->st_add>=pro[i].size)
if(big_hole==NULL)
big_hole=temp_f;
big_hole=temp_f;
temp_f=temp_f->next;
if(big_hole!= NULL)
pre_a->st_add=big_hole->st_add;
pre_a->end_add=big_hole->st_add=big_hole->st_add + pro[i].size;
pre_a->pid=pro[i].pid;
if(temp_a==NULL)
alot=pre_a;
pre_a->next=NULL;
else
{
while(temp_a->next!=NULL)
temp_a=temp_a->next;
temp_a->next= pre_a;
pre_a->next=NULL;
else
display_alot(alot);
display_free(flist);
getch();
void main()
int no,n,i,nod,ndpid;
clrscr();
alot=NULL;
flist->st_add=0;
flist->end_add=1024;
flist->next=NULL;
insert(0);
do
srand((unsigned int)time((time_t*)NULL));
nod=rand()%5;
while(nod==0);
for(i=0;i<nod;i++)
scanf("%d",&ndpid);
temp_a=alot;
temp_f=flist;
pre_a=temp_a;
temp_a=temp_a->next;
if(temp_a!=NULL)
if(alot==temp_a)
alot=temp_a->next;
else
pre_a->next=temp_a->next;
pre_f=NULL;
pre_f=temp_f;
temp_f=temp_f->next;
pre_f->end_add=temp_a->end_add;
else if(pre_f!=NULL&&temp_f!=NULL&&
temp_f->st_add==temp_a->end_add)
temp_f->st_add=temp_a->st_add;
else
free_alot->st_add=temp_a->st_add;
free_alot->end_add=temp_a->end_add;
if(pre_f!=NULL)
pre_f->next=free_alot;
free_alot->next=temp_f;
if(flist==temp_f)
flist=free_alot;
}
free(temp_a);
temp_f=flist;
while(temp_f!=NULL)
if(temp_f->end_add==temp_f->next->st_add)
temp_f->end_add=temp_f->next->end_add;
temp_f->next=temp_f->next->next;
temp_f=temp_f->next;
display_alot(alot);
display_free(flist);
getch();
worstfit(10);
}
OUTPUT:
no. of process:9
allocated list:
================
free list:
=================
st_add:21 end_add:1024
allocated list:
================
free list:
=================
st_add:490 end_add:1024
allocated list:
================
free list:
=================
st_add:520 end_add:1024
allocated list:
================
free list:
=================
st_add:594 end_add:1024
allocated list:
================
free list:
=================
st_add:776 end_add:1024
allocated list:
================
process:0 st_add:0 end_add:21
free list:
=================
st_add:876 end_add:1024
allocated list:
================
free list:
=================
st_add:876 end_add:1024
allocated list:
================
free list:
=================
st_add:876 end_add:1024
allocated list:
================
free list:
=================
st_add:876 end_add:1024
process to be deleted:0
allocated list:
================
free list:
=================
st_add:0 end_add:21
st_add:876 end_add:1024
process to be deleted:1
allocated list:
================
free list:
=================
st_add:0 end_add:490
st_add:876 end_add:1024
no.of process:6
allocated list:
================
free list:
=================
st_add:105 end_add:490
st_add:876 end_add:1024
allocated list:
================
free list:
=================
st_add:198 end_add:490
st_add:876 end_add:1024
allocated list:
================
free list:
=================
st_add:258 end_add:490
st_add:876 end_add:1024
allocated list:
================
free list:
=================
st_add:361 end_add:490
st_add:876 end_add:1024
allocated list:
================
st_add:876 end_add:948
free list:
=================
st_add:361 end_add:490
st_add:948 end_add:1024
allocated list:
================
free list:
=================
st_add:378 end_add:490
st_add:948 end_add:1024