G53OPS - Operating Systems

This course is run at the The University of Nottingham within the School of Computer Science & IT. The course is run by Graham Kendall (EMAIL : gxk@cs.nott.ac.uk)


Page Tables

The way we have described how virtual addresses map to physical addresses is how it works but we still have a couple of problems to consider.

The page table can be large

Assume a computer uses virtual addresses of 32 bits (very common) and the page size is 4K. This results in over 1 million pages (232 / 4096 = 1048576).

The mapping between logical and physical addresses must be fast

A typical instruction requires two memory accesses (to fetch the instruction and to fetch the data that the instruction will operate upon). Therefore, it requires two page table accesses in order to find the right physical location.

Assume an instruction takes 10ms. The mapping of the addresses must be done in a fraction of this time in order for this part of the system not to become a bottleneck.

In this course we are not going to look in detail at how these problems are overcome but the interested student might like to look at (Tanenbaum, 1992) which covers it in some detail (see pages 93 - 107).

However, we need to look at, in more detail, the structure of a page table so that we can use it in future material.

This diagram shows typical entries in a page table (although the exact entries are operating system dependent). The various components are described below.

Page Frame Number : This is the number of the physical page that this page maps to. As this is the whole point of the page, this can be considered the most important part of the page frame entry.

Present/Absent Bit : This indicates if the mapping is valid. A value of 1 indicates the physical page, to which this virtual page relates is in memory. A value of zero indicates the mapping is not valid and a page fault will occur if the page is accessed.

Protection : The protection bit could simply be a single bit which is set to 0 if the page can be read and written and 1 if the page can only be read. If three bits are allowed then each bit can be used to represent read, write and execute.

Modified : This bit is updated if the data in the page has been modified. This bit is used when the data in the page is evicted. If the modified bit is set, the data in the page frame needs to be written back to disc. If the modified bit is not set, then the data can simply be evicted, in the knowledge that the data on disc is already up to date.

Referenced : This bit is updated if the page has been referenced. This bit can be used when deciding which page should be evicted (we will be looking at its use later).

Caching Disabled : This bit allows caching to be disabled for the page. This is useful if a memory address maps onto a device register rather than to a memory address. In this case, the register could be changed by the device and it is important that the register is accessed, rather than using the cached value which may not be up to date.

Last Page Back to Main Index Next Page

 

 


 Last Updated : 23/01/2002