MVT MFT
MVT MFT
EXPERIMENT- 3
3. OBJECTIVE
Write a C program to simulate the MVT and MFT memory management techniques
3.1 DESCRIPTION
MFT (Multiprogramming with a Fixed number of Tasks) is one of the old memory management techniques in
which the memory is partitioned into fixed size partitions and each job is assigned to a partition. The memory
assigned to a partition does not change. MVT (Multiprogramming with a Variable number of Tasks) is the
memory management technique in which each job gets just the amount of memory it needs. That is, the
partitioning of memory is dynamic and changes as jobs enter and leave the system. MVT is a more ``efficient''
user of resources. MFT suffers with the problem of internal fragmentation and MVT suffers with external
fragmentation.
3.2 AIM: Simulate Multiple Programming with fixed Number of Tasks (MFT)
3.3 THEORY:
Multiple Programming with fixed Number of Tasks (MFT) Algorithm
Background:
IBM in their Mainframe Operating System OS/MFT implements the MFT concept. OS/MFT uses Fixed
partitioning concept to load programs into Main memory.
Fixed Partitioning:
In fixed partitioning concept, RAM is divided into set of fixed partition of equal Size
Programs having the Size Less than the partition size are loaded into Memory
Programs Having Size more then the size of Partitions Size is rejected
The program having the size less than the partition size will lead to internal Fragmentation.
If all partitions are allocated and a new program is to be loaded, the program that lead to Maximum
Internal Fragmentation can be replaced
ALGORITHM:
Step1: start
Step2: Declare variables.
Step3: Enter total memory size.
Step4: Read the no of partitions to be divided.
Step5: Allocate memory for os.
Step6:calculate available memory by subtracting the memory of os from total memory
Step7: calculate the size of each partition by dividing available memory with no of partitions.
Step8: Read the number of processes and the size of each process.
Step9: If size of process<= size of partition then allocate memory to that process.
Step10: Display the wastage of memory.
Step11: Stop .
1.
OPERATING SYSTEMS LAB MANUAL
PROGRAM:
#include<stdio.h>
#include<conio.h>
main()
{
int ms,i,ps[20],n,size,p[20],s,intr=0;
clrscr();
printf("Enter size of memory:");
scanf("%d",&ms);
printf("Enter memory for OS:");
scanf("%d",&s);
ms-=s;
printf("Enter no.of partitions to be divided:");
scanf("%d",&n);
size=ms/n;
for(i=0;i<n;i++)
{
printf("Enter process size");
scanf("%d ",&ps[i]);
if(ps[i]<=size)
{
intr=intr+size-ps[i];
printf("process%d is allocated\n",p[i]);
}
else
printf("process%d is blocked",p[i]);
}
printf("total fragmentation is %d",intr);
getch();
}
OUTPUT:
Internal Fragmentation is = 4
1.
OPERATING SYSTEMS LAB MANUAL
VIVA QUESTIONS
1. The problem of fragmentation arises in ________.
1)Static storage allocation 2) Stack allocation storage
3 Stack allocation with dynamic binding 4 Heap allocation
2.Boundary registers ________.
1 Are available in temporary program variable storage
2 Are only necessary with fixed partitions
3 Track the beginning and ending the program
4 Track page boundaries
3.The principle of locality of reference justifies the use of ________.
1 Virtual Memory 2 Interrupts
3 Main memory 4 Cache memory
4. In memory management , a technique called as paging, physical memory is broken into fixed-sized blocks called
___________.
1) Pages 2) Frames 3) Blocks 4) Segments
5.Demand paged memory allocation
1 allows the virtual address space to be independent of the physical memory
2 allows the virtual address space to be a multiple of the physical memory size
3 allows deadlock tobe detected in paging schemes
4 is present only in Windows NT
1.
OPERATING SYSTEMS LAB MANUAL
EXPERIMENT :3 b)
THEORY:
Background:
IBM in their Mainframe Operating ‘System OS/MVT implements the MVT concept. OSIMVT uses Dynamic Partition
concept to load programs into Main memory.
Dynamic Partitioning:
ALGORITHM:
Step1: start
Step2: Declare variables.
Step3: Enter total memory size.
Step4: Read the no of processes
Step5: Allocate memory for os.
Step6: read the size of each process
Step7:calculate available memory by subtracting the memory of os from total memory
Step8: If available memory >= size of process then allocate memory to that process.
Step9: Display the wastage of memory.
Step10: Stop .
1.
OPERATING SYSTEMS LAB MANUAL
PROGRAM:
#include<stdio.h>
#include<conio.h>
main()
{
int i,m,n,tot,s[20];
clrscr();
printf("Enter total memory size:");
scanf("%d",&tot);
printf("Enter no. of processes:");
scanf("%d",&n);
printf("Enter memory for OS:");
scanf("%d",&m);
for(i=0;i<n;i++)
{
printf("Enter size of process %d:",i+1);
scanf("%d",&s[i]);
}
tot=tot-m;
for(i=0;i<n;i++)
{
if(tot>=s[i])
{
printf("Allocate memory to process %d\n",i+1);
tot=tot-s[i];
}
else
printf("process p%d is blocked\n",i+1);
}
OUTPUT:
External Fragmentation is = 2
1.
OPERATING SYSTEMS LAB MANUAL
VIVA QUESTIONS:
1. Explain about MFT?
2. Full form of MFT____________________
3. Full form of MVT____________________
4. differentiate MFT and MVT?
5. The __________________ Memory is called a hole.
6. OSIMVT uses ________________concept to load programs into Main memory.
7.OS/MFT uses ____________________ concept to load programs into Main memory.
1.