The scheme which permits the physical address space of a process to be non-contagious is called as paging. It is use to solve the problem of external fragmentation. It provides the solution by avoiding the substantial problem of fitting memory chunks of varying sizes onto the backing store. The memory management schemes that were used before the introduction of paging suffered from this problem. When some code fragments or data exist in main memory required to be swapped out, space must be found on the backing store then this problem occurs.
The backing store also has the fragmentation problems discussed in association with main memory, but that access is much slower, therefore compaction is impossible. Its advantages over earlier methods, paging in its different forms is usually used in most operating systems. Conventionally, maintenance for paging has been handled by hardware. Though, modern designs have implemented paging by closely integrating the hardware and operating system, especially on 64-bit microprocessors.
Paging is a method in which physical memory is broken down into blocks of the same size called pages’ size is power of 2, b/w 512 bytes and 8192 bytes. When a process is to be executed then it’s corresponding pages are loaded into any offered memory frames. Logical address space of a process can be non-adjacent and a process is assigned physical memory when the free memory frame is available. Operating system always keeps track of all free frames. Operating system wants n free frames to run a program of size n pages. Address generated by CPU is divided into p, d which is shown in following diagram.
Page number (p) — page number p is used as an index into a page table which holds base address of each page in physical memory.
Page offset (d) — page offset d is joined with base address to define the physical memory address.
Given figure shows the paging table architecture.