Notes:
1. For each shared segment specified, 64K of virtual storage is reserved. The
number of pages actually saved (via the SAVESYS command) can be less than
a segment. However, only one saved system name can be associated with each
64K request.
2. For each shared named system specified, page zero of the first shared segment
should always be saved via a SA VESYS command.
Loading and Saving Discolltiguous Shared Seglnents
Before a discontiguous saved segment can be attached and detached by name, it
must be loaded and saved. The discontiguous saved segment must be loaded at an
address that is beyond the highest address of any virtual machine to which it will be
attached. It is the system programmer's responsibility to make sure the name seg­
ment is loaded at an address that does not overlay the defined virtual machine or
any other named segment that may be attached at the same time.
The load address for the discontiguous saved segment should be just beyond the
largest virtual machine that uses it. If the load address is unnecessarily high, real
storage is wasted because CP must have segment table entries for storage that is
never used.
For example, assume you have five CMS virtual machines in your installation. Also
assume that all five use the CMS support for DOS program development and test­
ing which is in a 32K segment named CMSDOS. If each of your five CMS virtual
machines has a machine size of 320K you should load the CMSDOS segment just
beyond 320K. If you load CMSDOS at a much higher address, for example 512K,
you are wasting real storage. In this case, whenever one of your eMS virtual
machines attaches the CMSDOS segment, CP creates segment table entries for a
544K (512K + 32K) virtual machine. Although the virtual machine cannot refer
to storage addresses beyond 320K or below 512K, CP still must have segment
table entries in nonpageable real storage for those virtual addresses. Once the named segment is loaded at the correct address, you can save it by issuing
the CP SA VESYS command. To be sure that the CMS discontiguous saved seg­
ment has segment protection, set the storage key for the segment, via the CMS SETKEY command, to something other than X'F' before you save it.
The format of the CMS SETKEY command is: I SETKEY
where:
key
key systemname [startadr]
is the storage protection key, specified in decimal. The valid keys
are 0-15. systemname is the name of the saved system or segment for which the storage
protection is being assigned.
startadr is the starting address (in hexadecimal) at which the keys are to be
assigned. The address must be within the address range defined for
the saved system or discontiguous saved segments. Using the
Generating Saved Systems 77
How the Interface Works
startadr operand, you can issue the SETKEY command several
times and, thus, assign different keys to various portions of the
saved system or segment.
The linkage to attach and detach discontiguous saved segments is supported via
several CP DIAGNOSE codes.
Since the virtual machine is responsible for insuring that the discontiguous saved
segment that it is attaching does not overlay other programming code, it must know
how much virtual storage it has. By issuing DIAGNOSE code X'60' during its
initialization process, the virtual machine can determine its virtual machine storage
size.
When the virtual machine needs to attach a discontiguous saved segment, it must
first ensure that the segment is available and that it does not overlay existing stor­
age. By issuing the DIAGNOSE code X'64' with a subcode of X'OC', it can verify
that a loadable copy of the discontiguous shared segment exists on a CP-owned
volume. This DIAGNOSE code is called the FINDSYS function. FINDSYS returns the starting address of the segment. The virtual machine should compare
the starting address of the segment to its own ending address; if the segment does
not overlay existing storage, it can be loaded.
A LOADSYS function is provided by the CP DIAGNOSE code X'64' and sub­
codes X'OO' and X'04'. The section "Diagnose Instruction in a Virtual Machine" contains a complete description of the Diagnose codes used in the discontiguous
saved segment interface. If you want CMS to load the named segment in non­
shared mode, you may do so by issuing the CMS command: SET NONS HARE segmentname
before CMS attaches the named segment. If the segment is loaded in nonshared
mode you can test and debug it using the CP TRACE, STORE, and ADSTOP commands and the CMS DEBUG sub commands BREAK and STORE. When CMS loads a named segment in shared mode, it issues the CP DIAGNOSE code X'64' with subcode X'OOOO'. CMS also issues the same code with sub code X'0004' to load the named segment in nonshared mode.
When a discontiguous saved segment is loaded (or attached) to a virtual machine, CP expands its segment table entries for that virtual machine to reflect the highest
address of the virtual machine.
When a named segment is successfully loaded, all of its storage is addressable by
the virtual machine. For example, when CMS attaches a named segment, it can
execute the routines contained in that segment. All of the commands that are exe­
cutable for CMS are also executable for the attached named segment, with the fol­
lowing exceptions: The response for the CP QUERY VIRTUAL STORAGE command does not
reflect the storage occupied by the named segment.
If you execute a command that alters storage (such as STORE), you are given
a nonshared copy of the named segment.
78 VM/SP System Programmer's Guide
Previous Page Next Page