JSBR 3000- Overlay Module 005
P1=Address of Parameter Block
Copies the specified sectors from the Master Disc to the Copy Disc.
The Master and Copy Discs may be the same disc.
The transfer is carried out in blocks of 8 sectors (the last transfer being a short block if necessary). The program must provide a core buffer area large enough to contain the block (i.e. 1K in the case of 8 or more sectors).
Each block written to the Copy Disc is read back and a hash sum calculated and compared with the Master hash sum. The message HASHFAIL is flashed if the sums are not equal, and the transfer is retried.
Control returns to the step following P1 upon completion of the Copy.
The module occupies one sector and is loaded at 3000-
JSBR IZ 1700
P1=Control Word
The subroutine returns to the step following P1 with the A-Register holding the contents of the specified word and with the B-Register pointing to the absolute core location of the word.
Disc/Core transfers always involve one or more consecutive sectors of 128 words each. Thus a core buffer area is required, equal in size to the number of sectors specified in the top byte of FCB Word 1. If FCB Word 2 is zero, then the buffer area used will be the Master Buffer of the Task requesting the transfer (in this case the number of sectors per transfer will be one, or possibly two if the spool buffer area is being used as an extension); otherwise FCB Word 2 points to a two-word Shared Buffer Control Block:
This is an optional one or four word block containing the file’s dynamic data. The FSB will normally exist within the System Control Record, which should be STOWED whenever the block is updated.
JSBR IZ 1670
P1=Control Word
P2=Address of Record Number
P3=Address of Extract Area
The record identified by the File Identifier (specified in P1) and relative record number within the file (a single word binary field pointed to by P2) is read into the issuing task’s Master Buffer.
If (and only if) the TEST option is specified in P1, the first word of the record is compared with the relative record number (pointed to by P2). If not equal, the subroutine returns to the step following P3 (record not loaded). If equal, the subroutine skips this step on return (record loaded).
When the TEST option is not specified, the subroutine always returns to the step following P3.
The record may be automatically de-buffered by specifying in P3 the address to which it is to be copied (this process is referred to as extraction). If extraction is not required, P3 must be zero. Extraction does not take place if the record is found to be not loaded by the TEST option.
If the issuing task is fetching the record in order to perform an update, the LOCK option must be specified in P1.
On return from FETCH, 0/0151 points to the first word of the record within the Master Buffer, and 0/0152 contains the logical record length.
JSBR IZ 1670
P1=Control Word
P2=Address of Module Number
The overlay module identified by the File Identifier (specified in P1) and Module Number (a single word binary field pointed to by P2) is read into core.
Control returns to the step following P2 upon completion of the transfer, unless the LINK option is specified in P1 in which case control is passed to the first word of the overlay module.
The absolute address of the first word of the module will be found in core location 0/0144 upon completion of the transfer.
JSBR IZ 1670
P1=Control Word
P2=Address of four-character ASCII name
The overlay module identified by the File Identifier (specified in P1) and name (a double word pointed to by P2) is read into core.
Automatic Offset Address Resolution will be carried out if (and only if) this option is set in the program’s Overlay Module Index entry.
If the LINK option is specified in P1 control is passed to the logical entry point within the Overlay Module associated with the four-character program name.
If the program is not found the subroutine returns to the step following P2. If the program is found but LINK is not requested, the subroutine skips this step on return.
On completion of the transfer, 0/0153 contains the Overlay Module Number, 0/0144 points to the first word of the Overlay Module and 0/0154 points to the logical entry point.
Byte Addressing of the program name is not supported. All four characters addressed by P2 comprise the name (a NUL byte does not act as terminator).
JSBR IZ 1671
The record just FETCHED from a Direct Access File is written back to disc. The subroutine returns to the step following JSBR upon completion of the transfer.
There are no parameters. All relevant information is defined in the preceding FETCH parameters. The FETCH must specify the LOCK option.
If, and only if, the record was extracted by FETCH, it will be automatically replaced (i.e. re-buffered) by REWRITE.
Task HALTS at 0/1376 if REWRITE called out-of-context (A-Register contains FETCH back address). Out-of-context occurs if there is no LOCK in force on the record, if there was no preceding FETCH & LOCK, or if the File Type is not Direct Access.
JSBR IZ 1672
P1=Address of new record
The record just FETCHED from a Direct Access File is overwritten in its core buffer by the new record pointed to by P1, and the buffer is written back to disc. The subroutine returns to the step following P1 upon completion of the transfer.
JSBR IZ 1667
Writes the System Control Record to disc and returns to the step following JSBR upon completion of the transfer.
There are no parameters.
The System Control Record is permanently core resident at 0/0400 and occupies 1, 2 or 3 sectors as required by the application. The record is the only record (number 1) in the System Control File, File Identifier 10.
The System Control Record is never read from disc, except once when the system is started via control panel switches, but it is necessary to write the record to disc whenever updates are carried out within it, as a security precaution.
The first 64 words (0/0400 to 0/0477) are reserved for systems use, the remainder for applications use.
0/0477 contains the System Date in packed format.
LOS Bulletin No 23 (May 1978)
The FETCH, GET (Fetch Mode) and EXTRACT from FILE CONTROL BLOCK routines have been modified to handle file identifiers 000 to 377 octal.
This increases the number of files accessible from a single file table from 64 to 256. However, the reason for making this increase is to allow related files to be grouped together. System designers are requested to adhere to the following standards when allocating file identifiers to Indexed Files:
- File Id
- Record Access Method
- 0xx
- Via the slot number. FETCH reads the record into core by direct access (the slot number having been obtained by a previous FETCH via the record key).
- 1xx
- Via the record “key”. FETCH searches the index to obtain the slot number, then reads the record into core. The slot number to be available in 0/0153 on return.
- 2xx
- Access Index Record via record “key” (used only by File Maintenance programs with responsibility to update the Index).
- 3xx
- Available to File Maintenance routines, e.g. if more than one Index is required.
Implementation.
The file table remains 64 words long. Existing entries are unchanged. Step xx contains the address of a five-word “Hybrid” File Control Block, format as follows:
- Word
- Contents
- 0
- 201426 (HYBRID FILE MASK)
- 1
- Address of FCB of 0xx (set to 001377 if not in use)
- 2
- Address of FCB of 1xx (set to 001377 if not in use)
- 3
- Address of FCB of 2xx (set to 001377 if not in use)
- 4
- Address of FCB of 3xx (set to 001377 if not in use)
LOS Bulletin No 25 (July 1978)
The "FETCH" and "GET (FETCH MODE)" routines now support Indexed Sequential files.
A new subroutine, JSBR IZ 1661 is available to programs requiring to LOAD or DELETE records in an Indexed Sequential File.
A new system utility is available for the re-organisation of Indexed Sequential Indexes.
Notes
- The Operating System ISAM coding is permanently resident at 7/0200 to 7/0677. If IS files are to be added at existing installations the Configuration Table will (in most cases) require modification to avoid using this area.
- The LOAD/DELETE subroutine calls System Overlays into the last two sectors of the calling task's Overlay area, i.e. into 2600-
Setting up an Indexed Sequential File
An Indexed Sequential File structure comprises three Direct Access files. Conventionally these will be allocated file identifiers within a single Hybrid FCB (File Control Block) as follows:
- File Id
- Used to access records within:
- 0xx
- Data File directly via Direct Access method
- 1xx
- Data File sequentially via ISAM
- 2xx
- Secondary Index File via Direct Access method
- 3xx
- Primary Index File via Direct Access method
Data File Control Block
This is a Direct Access file defined as is appropriate for the individual application. The record's ISAM key need not be included within the actual data record. A four-word File Status Block must be provided within the System Control Record and initially cleared to zeros; this will be automatically maintained in the "Free Chain" format.
Indexed Sequential File Control Block
- Word
- Contents
- 0
- 201427 (ISAM FILE MASK)
- 1
- Data File Identifier
- 2
- Secondary Index File Identifier
- 3
- Primary Index File Identifier
- 4
- Key Length (in words)
- 5
- Address of File Status Block
A one-word File Status Block must be provided within the System Control Record and initially cleared to zero.
Secondary Index File Control Block
This is a Direct Access file with a minimum record length equal to Key Length (in words) + 2 but preferably extended, if necessary, to be a Binary file for efficient access. A one-word File Status Block must be provided within the System Control Record. A Shared Buffer must be used. The number of records must be at least equal to the number of data records allowed for.
Primary Index File Control Block
This again is a Direct Access file. A Shared Buffer must be used and the record length is the same as that of the Secondary Index file. For efficient use, the Shared Buffer of the Secondary Index must be different to that of the Primary Index. A File Status Block is not required. The file size is chosen to produce an efficient access time. A rough guide is to allow approximately 100 secondary index entries per primary index entry as a minimum.
Indexed Sequential Re-Organisation Utility
It is essential to re-organise the indexed to an Indexed Sequential File from time to time because:
- New Secondary Index records, although logically linked into the correct position in the collating sequence, are physically loaded into the next free record. This tends to increase the number of disc transfers required to search for a key.
- Deleted Secondary Index records are not released for re-use (although the deleted key may be reloaded).
- Primary Index records tend to become unevenly spaced along the logical sequence.
A re-organisation program must therefore be provided for each Indexed Sequential file at an installation. It is five steps long (+ ASCII file name for display purposes) and should be placed in System Overlay Module 11:
JSBR IZ 1670 FETCH & LINK Module 21
P1=002002
P2=0/0221 -> Module Number 021
P3=Indexed Sequential File Identifier
P4=Byte Address of File Name (ASCII terminated by NUL)Notes
- The program is requested at an I/O Station. A suitable name should be placed in the "Input" Directory.
- The operator will be prompted for Password 1.
- The request is posted to a plain paper print queue, renamed as program "ISAM".
- The I/O Station returns (or escapes) to the "PROGRAM?" prompt.
- Re-organisation is carried out by program ISAM in a printer partition. If the File Identifier (P3) is not that of an IS file, ISAM halts. Disc workspace (at least equal to the size of the index files) is required from the spool file; if insufficient space is available ISAM aborts.
- Only the indexes are re-organised; the Data File is not re-organised (Data Record slot numbers remain unaltered).
- Other tasks should not access an IS file whilst it is being re-organised.
LOS Bulletin No 27 (July 1978)
File Identifier 007 is reserved for the System Catalogue. Each new installation will have a System Catalogue, and it is recommended that a System Catalogue be added at existing installations. Each Dataset (= File on disc) is allocated one 16-word Catalogue record containing (among other fields) its File Control Block.
If the Catalogue Record Number (+ Bit 17 set) is inserted into the File Table (in the Configuration Table) instead of the FCB core address, the Initiator (on bootstrapping) obtains the FCB from the catalogue and establishes it in a free core area.
Note: All FCBs other than that of the Catalogue itself may be obtained in this manner.
The Catalogue is maintained as an Indexed Sequential File (with File Identifier 107) with six-character keys (the Dataset Name) via the new utility program "CATM". Program "CATP" is available to print the catalogue either in alphabetic order or in physical order. The CATM utility does not allow datasets to physically overlap.
In addition, program ACT has been modified to enable catalogue numbers to be inserted into the file table.
"System Disc" recommended layout
The recommended layout of the installation's "System Disc" (usually Unit 70 Fixed Cartridge and always on-line when the system is running) follows:
Start Sector (octal) Number of Sectors (decimal) Number of Records (decimal) File Identifier Description 000000 1 BOOTSTRAP 000001 31 Not used 000040 1 DISC LABEL 000041 1 MASTER BOOTSTRAP (backup copy of Sector 000000 000042 3 CONFIGURATION TABLE 000045 3 1 010 SYSTEM CONTROL FILE 000050 95 OPERATING SYSTEM (12K) 000207 1 16 307 System Catalogue (Primary Index 000210 8 128 207 System Catalogue (Secondary Index) 000220 8 16 305 File of File Tables 000230 16 128 007 System Catalogue 000250 8 256 001 Overlay Index 000260 8 256 003 Input/Output Station Directory 000270 8 256 004 Printer Directory 000300 1 Not used 000301 1103 002 Overlay Module Library 002420 Start of User Datasets 014537 D818 cartridge max (6,496 sectors) 031277 D1600 cartridge max (12,992 sectors)