Thursday, October 13, 2011

Memory Management, Paging

Page frames or frames: memory is partitioned into equal, fixed-size chunks
Pages: memory of processes are divided into chunks with same size

Pages fit into any free page frame.
Benefits: No external fragmentation. Relatively little internal fragmentation(a part of a page).

For each process, a page table is associated with it. It records the information about which
page is in which page frame.

Virtual Address = Page number + Page offset = vaddr / page size + vaddr % page size

Some calculations:
Suppose a logical address is 32 bits and a page is 8 kbytes
Bits of the logical address are used to address bytes within a page:
8kbytes = 2^10 * 2^3 = 2^13; least significant 13 bits
Number of bytes can be addressed with a logical address:
2^32
Number of logical pages:
2^20
If a PTE is 4 bytes, space required for the page table:
2^20*2*2 = 2*22 bytes, 22 bits to represent

No comments: