70 likes | 182 Views
Operating Systems Date:26/3/14 By B Harishma 11CS30009. Paging. Logical Address Address generated by the CPU Divide logical memory into blocks of same size called PAGES . Physical Address Address seen by the memory unit Physical address of a process can be non contiguous.
E N D
Operating Systems Date:26/3/14 By B Harishma 11CS30009
Paging • Logical Address Address generated by the CPU Divide logical memory into blocks of same size called PAGES. • Physical Address Address seen by the memory unit Physical address of a process can be non contiguous. Divide physical memory into fixed size blocks called FRAMES. “Page table is used to translate logical address to physical address”
Size of frame: power of 2 with a range between 512 bytes to 16 Mbytes. • To run a program of size N pages, one need to have N free frames and the program is then loaded. 0 1 2 0 3 1 4 2 3 5 Physical Memory Logical Memory 6 Page Table Task is to perform mapping. 7
MMU CPU RAM LA PA Address Translation scheme: • Logical address space= 2mPage Size = 2n • Then the high-order bits of logical address designates the page number and the n low-order bits designates the page offset. Page number Page offset m-n n p is an index into the page table contains base address of each page in physical memory. d is the displacement within the page and when combined with the physical memory address that is sent to the memory unit. p d
Physical address Logical address CPU f000....0000 f Paging Hardware: p d f d f111....1111 f p Page Table Physical Memory
Paging Example External Fragmentation: Holes are scattered in memory. Paging scheme does not suffer from external fragmentation. Reason : There is no need of contiguous memory. But, it does suffer from --------------------INTERNAL FRAGMENTATION Reason : Pages and frames are basic units and cannot be divided further.
Small page size low page sizesize of page table increases I/O operations from disk increases initially slow User’s View: Process Contained in single contiguous memory space. By implementation, process can only access its memory--- PROTECTION.