To develop a C program to implement the paging technique in memory management.
Procedure:
- Get the total size of the physical memory and the page size.
- Divide the physical memory into frames.
- Initialize the physical memory structure using random number generation (Some frames must be free and some random frames are already allotted to other process)
- Construct the free frame list.
- Get the Process memory requirement. Divide the LAS into n pages.
- If n free frames are available, allot the process and update the page table.
- Show the conversion of any logical address into the corresponding physical
- Do de-allocation accordingly.
- 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
- Process request
- Deallocation
- Page Table display for all input process
- Free Frame list display
- 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)

![[Solved] UCS1411 Exercise 9- Implementation of Paging Technique](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] UCS1411 Exercise 2- System calls](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.