Question: Simulate the Linked File allocation method in C/C++. ALGORITHM: Step 1: Create a queue to hold all pages in memory Step 2: When the page
Simulate the Linked File allocation method in C/C++.
ALGORITHM:
Step 1: Create a queue to hold all pages in memory
Step 2: When the page is required replace the page at the head of the queue
Step 3: Now the new page is inserted at the tail of the queue
Step 4: Create a stack
Step 5: When the page fault occurs replace page present at the bottom of the stack
Step 6: Stop the allocation.
OUTPUT:
Enter no. of files:2
Enter file name: file1
Enter starting block:20
Enter no.of blocks:6
Enter block numbers: 4
12
15
45
32
25
Enter file name: file2
Enter starting block:12
Enter no.of blocks:5
Enter block numbers:6
5
4
3
2
File start size block
File1 20 6 4--->12--->15--->45--->32--->25
File2 12 5 6--->5--->4--->3--->2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
