Exercise – 9 – Paging Technique

$30.00

Category: Tags: , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

Lab Exercise 9 Implementation of Paging Technique
Aim:
To develop a C program to implement the paging technique in memory management.
Procedure:
1. Get the total size of the physical memory and the page size.
2. Divide the physical memory into frames.
3. Initialize the physical memory structure using random number generation (Some
frames must be free and some random frames are already allotted to other process)
4. Construct the free frame list.
5. Get the Process memory requirement. Divide the LAS into n pages.
6. If n free frames are available, allot the process and update the page table.
7. Show the conversion of any logical address into the corresponding physical
address.
8. Do de-allocation accordingly.
9. Repeat the steps 5-8 for N processes.
SAMPLE INPUT/OUTPUT:
Paging Technique
Enter the physical memory size: 32 KB
Enter the page size = 1 KB
Physical memory is divided into 32 frames.
After initialization
Free Frames: 3 6 9 12 1 2 18 30 25
1. Process request
2. Deallocation
3. Page Table display for all input process
4. Free Frame list display
5. Exit
Enter the option:1
Enter the Process requirement(ID,size): P1, 4 KB
Process is divided into 4 pages
Page Table for P1:
Page 0 : Frame 3
Page 1: Frame 6
Page 2 : Frame 9
Page 3: Frame 12
Enter the option: 4
Free Frames: 1 2 18 30 25
Enter the option: 1
Enter the Process requirement (ID,size): P2, 2 KB
Process is divided into 2 pages
Page Table for P2:
Page 0 : Frame 1
Page 1: Frame 2
Enter the option: 4
Free Frames: 18 30 25
Enter the option: 3
Page Table for P1:
Page 0 : Frame 3
Page 1: Frame 6
…..
Page Table for P2:
Page 0 : Frame 1
Page 1: Frame 2
Enter the option: 2
Enter the process ID to be de-allocated: P1
Enter the option:4
Free Frames: 18 30 25 3 6 9 12 ( freed frames appended at end)