| Virtual Memory |
|
|
| Nov 01 2007 | |
|
Page 4 of 6
advertisement: The valid bit is used to keep track of whether the page is in or out of main memory. If the valid bit is off, then this page is not in main memory, and a page fault occurs. We now know that that page resides on disk and it will need to be swapped in.
Virtual memory can also have a twolevel page table. The first-level page table is always present, while the second- level page table is allocated on demand. There are more bits in a second- level page table to describe its properties. A few of these properties are as follows:
![]() Two processes within a single physical memory. In Process 1, the address space ranges from 0 to 1000 while Process 2 ranges from 1001 to 2001. Click to enlarge In an OS, each process has its own virtual address space. A virtual address space is a set of all virtual addresses. Notice in Figure 2 that the virtual addresses are mapped onto different physical addresses, which simplifies loading the program for execution. This is known as “relocation” and is one of the advantages of virtual memory. Before the concept of virtual memory came into existence, software developers had to divide programs into overlays. Overlays were mutually exclusive pieces of programs that had to be loaded and unloaded into memory under user program control. As one would imagine, this was a huge responsibility for programmers. Each overlay consisted of its own instructions and data. |







