0% found this document useful (0 votes)
2K views6 pages

MVT MFT

The document describes an experiment to simulate memory management techniques MVT and MFT using C programming. MFT partitions memory into fixed sized partitions and assigns each job to a partition. MVT assigns each job just the amount of memory it needs, allowing dynamic partitioning. The objective is to write programs to simulate MFT, which suffers from internal fragmentation, and MVT, which suffers from external fragmentation. The programs for each technique are presented along with sample outputs showing fragmentation calculations. Viva questions at the end test understanding of key aspects of MFT and MVT.

Uploaded by

raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views6 pages

MVT MFT

The document describes an experiment to simulate memory management techniques MVT and MFT using C programming. MFT partitions memory into fixed sized partitions and assigns each job to a partition. MVT assigns each job just the amount of memory it needs, allowing dynamic partitioning. The objective is to write programs to simulate MFT, which suffers from internal fragmentation, and MVT, which suffers from external fragmentation. The programs for each technique are presented along with sample outputs showing fragmentation calculations. Viva questions at the end test understanding of key aspects of MFT and MVT.

Uploaded by

raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

OPERATING SYSTEMS LAB MANUAL

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.2.1 HARDWARE REQUIREMENTS: Intel based Desktop Pc


RAM of 512 MB
3.2.2 SOFTWARE REQUIREMENTS:
Turbo C/ Borland C.

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:

Enter total memory size : 50

Enter memory for OS :10

Enter no.of partitions to be divided:4

Enter size of page : 10


Enter size of page :9
Enter size of page :9
Enter size of page :8

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)

NAME OF EXPERIMENT: multiple Programming with Varible Number of Tasks (MVT) :

AIM: Simulate multiple Programming with Varible Number of Tasks (MVT)

HARDWARE REQUIREMENTS: Intel based Desktop Pc


RAM of 512 MB
SOFTWARE REQUIREMENTS:
Turbo C/ Borland C.

THEORY:

multiple Programming with Varible Number of Tasks (MVT) Algorithm

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:

o Initially RAM is portioned according to the of programs to be loaded into


Memory till such time no other program can be loaded.
o The Left over Memory is called a hole which is too small too fit any process.
o When a new program is to be into Memory Look for the partition, Which
Leads to least External fragmentation and load the Program.
o The space that is not used in a partition is called as External Fragmentation

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);
}

printf("External Fragmentation is=%d",tot);


getch();
}

OUTPUT:

Enter total memory size : 50


Enter no.of pages :4
Enter memory for OS :10

Enter size of page : 10


Enter size of page :9
Enter size of page :9
Enter size of page : 10

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.

You might also like