Question: Write a program in JAVA to implement three Memory Allocation Methods: FF,BF,WF. This program should read data about the processes from Minput.data(see the format below)
Write a program in JAVA to implement three Memory Allocation Methods: FF,BF,WF. This program should read data about the processes from Minput.data(see the format below) and produce the memory allocations for new processes in 3 files: FFoutput.data, BFoutput.data , and WFoutput.data files (see the format below). Attention: whatever black inside () is only for explanation and should not be present/printed in the data files.
Format of Minput.data:
3 (#of free memory slots)
100 400 (addresses of start and end of a free memory slot => size 300)
600 800 (addresses of start and end of a free memory slot => size 200)
1500 1900 (addresses of start and end of a free memory slot => size 400)
3(# of processes)
1 (ID of process) 190 (size of process)
2 (ID of process) 210 (size of process)
3 (ID of process) 205 (size of process)
Format of FFoutput.data, BFoutput.data , and WFoutput.data
100(addresses of start) 310(addresses of end) 2(process ID)
600(addresses of start) 790(addresses of end) 1(process ID)
1500(addresses of start) 1705(addresses of end) 3(process ID)
-0 (means all are allocated, or -1,3 if processes 1 and 3 can't be allocated)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
