Memory Layout of a Process

The OpenVMS virtual memory management subsystem is responsible for the allocation of physical memory among processes and provides the illusion of a 4GB address space to each process.

This section describes the layout of memory as seen from within a process. This does not bear any resemblance to the contents of physical memory on the computer; it is the memory-addressing space as seen from process context, an illusion constructed by the virtual memory management subsystem. The process is free to use the 4GB addressing space as if it were real, physical memory. The memory management subsystem is responsible for allocating memory to the process so as to maintain this illusion.

The layout to be described here is based mostly on the 32-bit VAX layout. The earliest Alpha layouts closely resembled that of the VAX, effectively using only 4GB of the 64-bit space. Over time, the Alpha approach began moving certain items to previously unused ranges of the 64-bit space. Ignoring these details will not change the essence of this discussion.

The remainder of the discussion will express memory addresses in hexadecimal format. A primer on hexadecimal notation is included as Appendix A.

A process-addressing space is divided into two main parts: process space, from 0 to 7FFFFFFF, and system space, 80000000 and above. You will recall that process space is unique to each process and that system space is shared by all processes. Process space is further divided into two regions: the program region, or P0 space, located from 0 through 3FFFFFFF, and the control region, or P1 space, located from 40000000 through 7FFFFFFF.

Recall Figure 17-1:

click to expand
Figure 17-1: Virtual Memory Regions

click to expand
Figure 17-2: Virtual Memory Regions

OpenVMS uses each of these regions for specific purposes, as follows:

  • P0 Space Known as the program region, this is the area in which programs are mapped when they execute. Programs are executed as the result of the DCL RUN command, many other DCL commands, and foreign commands. When a program is interrupted, it is not immediately removed from this region, but when a new program starts, the existing contents of this region are destroyed. This is why the CONTINUE command can be used to continue an interrupted program only if no other program has been executed. When a program ends (as opposed to being temporarily interrupted), this region is reset to an initial state.

  • P1 Space Known as the control region, this area contains items of a more permanent nature than the contents of the P0 space. The DCL command interpreter resides here, which is why you can interrupt a program and execute other DCL commands before resuming the program (again, with the stipulation that you have not executed another program in between). This area also contains the four per-process stacks, information used by the file-and record-management services, the DCL command table, the DCL symbol table, scratch memory for a variety of purposes, and various other information that must survive program termination.

  • System Space In contrast to the P0 and P1 regions, which are unique to each process, system space is common to all processes. This feature allows each process to reference systemwide data from within its own context. System space addresses are not mapped into the memory management data for each process. Instead, the translation of a virtual memory address (described later) at or above 80000000 causes a reference to system space through a common set of address translation data.

System space contains the OpenVMS operating system itself, as well as systemwide code and data, including system service vectors (tables to locate OpenVMS routines), memory management databases, dynamic storage pools (described further on), the interrupt stack, and data structures describing each process.



Getting Started with OpenVMS(c) A Guide for New Users
Getting Started with OpenVMS: A Guide for New Users (HP Technologies)
ISBN: 1555582796
EAN: 2147483647
Year: 2005
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net