Factories that support OS programs
Code called GNOBIBMx is available in three versions to be included in a .program. They are in SYS.TEXTS.GNOBIBMx where "x" is "A", "B", or "C". (These correspond closely and respectively to the three ranges of ordinals used by GNOFIBM.) GNOBIBMx is responsible for making the transition from the factory environment to the OS environment. See (gnobibmx) for the differences.
The .program component of the factory must be an l-segment factory that was produced from the OS binder factory. Along with the OS program, it must include one of the versions of GNOBIBMx (and use the starting address thereof).
Let OSFACT be a requestor's key to such a factory. Here is what the versions of GNOBIBMx do.
Calling sequence for reusable program
Programs loaded with GNOBIBMA are suitable to interface with the command system. The OSFLOAD command calls these factories and puts the entry key into the directory. The EXECUTE or FORK commands will call these entry keys with terminal keys and run them as follows:
OSFACT(kt+5;PSB,M,SB ==> kt+5;,,,OSFACTCO)
OSFACTCO(akt;FILEDEFQUERY,CLOCK,ARG ==>c ;OSENTRY,OSFD)
Akt becomes the alleged type of the program. If specified as zero (0) the alleged type will be x'FF14'. 0 < akt < kt.
Return code c
c = 1 The first space bank is not prompt and official
c = 2 The first spacebank doesn't have sufficient space
c = 3 calling sequence error
c = 4 OSSIMFB factory failure
c = 5 SNODE factory failure
oc is currently unavailable to the OS program, but is included for consistency.
SIK, SOK, PARM will be returned to the caller in the same fashion as is currently done, that is the return keys are DK(0),PARM,SIK,SOK.
OSENTRY(kt ==> akt) or if akt was specified as 0, x'FF14'.
OSFACTCO(kt+5;FILEDEFQUERY,CLOCK,ARG ==> kt+5;,,,OSFACTCO)
OSFACTCO(oc,osparms;SIK,SOK,PARM ==> c;,PARM,SIK,SOK)
It is the responsibility of the OS program to destroy anything it creates before returning.
oc is currently unavailable to the OS program, but is included for consistency.
NOTE that the os environment CLOSEs SYSOUT and SYSPRINT when the program terminates so that SOK may not be available (having been signalled EOF)./
Slot 1 OSCOM
Slot 2 Exit to caller. GNOBIBMA is responsible for returning to it.
Slot 3 Parameter zero {(osen)} (nominally SIK)
Slot 4 Parameter one (nominally SOK)
Slot 5 Parameter two
Slot 6 The domain creator
Slot 7 The synthetic domain key
Slot 8 PSB
Slot 9 The meter key M
Slot 10 ARG
Slot 11 SB
Slot 15 The key returned by the binder for reporting ref key blocks
OSFACT(akt;PSB,M,SB ==> c;OSENT)
OSENT(oc,params;key0,key1,key2 ==> c;)
The order code is not available to the program.
Slot 1 OSCOM
Slot 2 Exit to caller
Slot 3 key0
Slot 4 key1
Slot 5 key2
Slot 6 The domain creator
Slot 7 The synthetic domain key
Slot 8 PSB
Slot 9 The meter key M
Slot 10 OSFD
Slot 11 SB
Slot 15 The key returned by the binder for reporting ref key blocks
If PSB is an official prompt space bank and has enough space then OSFACT(oc;PSB,M,SB,EXIT) starts the OS program.
The order code is passed to the OS program as a 4 byte parameter that is the binary order code.
When the OS program returns, the domain will be destroyed and the caller (the key in c-slot 2) returned to with the return code (in R15) from the OS program. It is the responsibility of the OS program to destroy anything it creates before returning.
Initial contents of the c-slots
Slot 1 OSCOM
Slot 2 EXIT
Slot 3 the synthetic domain key
Slot 4 PSB
Slot 5 the meter key M
Slot 6 The domain creator
Slot 10 OSFD
Slot 11 SB
Slot 15 The key returned by the binder for reporting ref key blocks
OSSIMFB initializes itself, installs itself as the domain keeper (databyte 0), builds a new meter and installs itself as the meter keeper (databyte 3), makes a virtual domain key (databyte 1), windows the user memory, and returns the communication key (databyte 2) and OSFD (databyte 4) which is used to establish local filedefs.
The Domain Keeper key understands one explicit order code other than kt.
DK(kt; ==> x'214')
OSSIMFBCO2(0,(4,#@FRBEG),(4,#@FREND);FILEDEFQUERY,CLOCK,DOMKEY ==> c;OSCOM,OSFD)
CLOCK is a time of day server.
DOMKEY is the domain key of the program domain that is to be kept by the OSSIM domain.
#@FRBEG and #@FREND are addresses which mark the beginning and end of free storage.
If PSB is an official prompt space bank and has enough space, the return code c will be 0. Otherwise it may be 1 or 2 according to (p3,fact-ret-codes).
The binder used has the necessary OS facilities built in. There are 14 megabytes left for the user program and data. GNOBIBMx {(gnobibm)} should be the first TEXT deck delivered to OSLOAD.
The locator for CESSEK2 is called CESSEJ2. GNOBIBMx uses it.
OSLOAD(kt; ==> X'70F0D';)
{arcane}The layout of memory of the segments produced with OSLOAD is as follows. Addresses are in hexadecimal.
2000 unused
E000 IBMBEEFA and IBMBEERA, GNOCPIRA
F000 unused because OSSIM uses this address for CESOS2
10000 unused because OSSIM uses this address for CESOS1
15000 CESTERM1 (shared)
19000 unused (shared)
20000 PL/I library (shared)
60000 unused
100000 ref key block CESSEK2, used for OS segment I/O
200000 User read-only segment (shared)
after that, the user read/write segment, including free storage
1000000 end of memory