next up previous
Next: Virtual Memory for Up: Persistence Previous: Persistence

The address space architecture

CPUs derived from the Intel 386 architecture support two different virtual memory mechanisms. At the base level the machines support a 32 bit linear address space, on which a segmented address space, of either 46 or 30 bits, is overlain. In version 3.1 of the Microsoft Windows operating system, user programs saw only the upper layer, giving them a theoretical virtual address space of 1 gigabyte. Windows NT and Windows 95 allow programs to be compiled to directly access the 32 bit linear space, and moreover, they provide a library of routines that can be used to map ranges of linear addresses onto disk files. These new facilities could be used to provide the infrastructure of a persistence system. The new programming model is, however, poorly supported by some popular program development tools which continue to produce code modules designed to run in the 30bit segmented address space, which provides a strong incentive to develop a persistence manager that will run in this context.

The restrictions involved in sticking to the segmented model are not as severe as might be supposed. Windows 95 restricts new model programs to the lower 2 Gigabyte of linear memory whilst reserving the next Gigabyte to segmented memory applications, and reserving the top Gigabyte to the operating system. There is thus only a doubling in total address space entailed in moving to the linear addressed model. More serious is the absence of explicit support in the operating system for memory mapped files.

Figure 3.6: The format of a 32 bit segmented intel address. Note that the DPL bits control access rights so that there are only distinct addresses.

Use of the virtual memory for persistence involves being able to detect when an access is made to a data structure currently on disk so that it can be brought into RAM before the program continues. In terms of control over system facilities this demands abilities to:

  1. capture the `not present' interrupt,
  2. set up the tables used by the virtual memory hardware
  3. reserve areas of random access memory for active data,
  4. reserve areas of disk for passive data.
Fortunately, windows is built on top of the Dos Protected Memory Interface (DPMI) which provides access to all of the required facilites.

next up previous
Next: Virtual Memory for Up: Persistence Previous: Persistence

W Paul Cockshott
Fri Sep 6 10:29:18 BST 1996