$PAGE "MPE TABLE ACCESS:  DCT, TDT"                                     00005000
comment                                                                 00010000
<<**********************************************************>>          00015000
<<*                                                        *>>          00020000
<<*                 incldct - module g1                    *>> <<06423>>00025000
<<*               (contains dct and tdt)                   *>>          00030000
<<*                    mpe 5 version                       *>>          00035000
<<*                                                        *>>          00040000
<<**********************************************************>>          00045000
                                                                        00050000
$if x8 = off                                                            00055000
$control nolist                                                         00060000
$if                                                                     00065000
$title "MPE TABLE ACCESS:  DEVICE CLASS TABLE (DCT)"                    00070000
                                                                        00075000
                   overview of device tables                            00080000
                   -------------------------                            00085000
                                                                        00090000
dst 40 (= %50)   +---------------------------+<-----dst %50             00095000
sir 40 (= %50)   |                           |                          00100000
                 |    device class table     |                          00105000
                 |                           |                          00110000
                 |          (dct)            |                          00115000
                 |                           |                          00120000
                 +---------------------------+                          00125000
                 |                           |                          00130000
                 | terminal descriptor table |                          00135000
                 |                           |                          00140000
                 |           (tdt)           |                          00145000
                 |                           |                          00150000
                 +---------------------------+                          00155000
                                                                        00160000
                                                                        00165000
                    device class table                                  00170000
                                                                        00175000
                    header entry format                                 00180000
                    -------------------                                 00185000
                                                                        00190000
       0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                   00195000
     +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                  00200000
    0|          total table (segment) size           |                  00205000
     +-----------------------------------------------+                  00210000
    1|   entry size (variable, this word set to 1)   |                  00215000
     +-----------------------------------------------+                  00220000
    2|        number of device class entries         |                  00225000
     +-----------------------------------------------+                  00230000
    3|     pointer to first device class entry       |                  00235000
     |              (segment relative)               |                  00240000
     +-----------------------------------------------+                  00245000
    4|    number of terminal descriptor entries      |                  00250000
     +-----------------------------------------------+                  00255000
    5|  pointer to first terminal descriptor entry   |                  00260000
     |              (segment relative)               |                  00265000
     +-----------------------------------------------+                  00270000
$page                                                                   00275000
                   typical entry format                                 00280000
                   --------------------                                 00285000
                                                                        00290000
       0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                   00295000
     +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                  00300000
    0|                                               |                  00305000
     |                                               |                  00310000
    1|                                               |                  00315000
     |              class name (ascii)               |                  00320000
    2|                                               |                  00325000
     |                                               |                  00330000
    3|                                               |                  00335000
     +--+--------------------+--+--+-----------------+                  00340000
    4|//|  cyclical pointer  |sq| t|class access type|                  00345000
     +--+--------------------+--+--+-----------------+                  00350000
    5|        number of devices in class (n)         |                  00355000
     +-----------------------------------------------+                  00360000
    6|                   ldev #1                     |                  00365000
     +-----------------------------------------------+                  00370000
    7|                   ldev #2                     |                  00375000
     +-----------------------------------------------+                  00380000
                 .                      .                               00385000
                 .                      .                               00390000
                 .                      .                               00395000
     +-----------------------------------------------+                  00400000
  n+5|                   ldev # n                    |                  00405000
     +-----------------------------------------------+                  00410000
                                                                        00415000
discussion:                                                             00420000
  the device class table (dct) contains a  varying  number  of          00425000
variable length entries.  this is because you may configure an          00430000
arbitrary number of device classes on a system, and  each  de-          00435000
vice  class may be comprised of an arbitrary number of logical          00440000
devices. there is one dct entry per device class, and each dct          00445000
entry contains a list of logical devices in the  class.  there          00450000
is no established order of entries in the dct, nor is there an          00455000
order of ldevs within an entry.                                         00460000
  due to the haphazard nature of the dct, its overall  proper-          00465000
ties are kept in the header entry.  these include the segment-          00470000
relative starting address of the dct (in case the header entry          00475000
should be expanded later) and the number of entries in the ta-          00480000
ble. a segment-relative pointer to the terminal descriptor ta-          00485000
ble (which follows the dct) may also be used to calculate  the          00490000
size of the dct.  also note the "Entry size" word. it is mean-          00495000
ingless for this table, but is included for compatibility with          00500000
other fixed-length entry mpe tables.                                    00505000
  since the dct entries are of variable length, when you  want          00510000
a  particular  entry you must always start at the beginning of          00515000
the dct and link through each entry until  you  find  the  one          00520000
you're interested in.                                                   00525000
$page                                                                   00530000
  a few of the fields in the dct require further description:           00535000
  word 4.( 1:7) -- cyclical pointer.  currently used only  for          00540000
                   system and private volume disc devices. the          00545000
                   pointer varies from 1 to n (number  of  en-          00550000
                   tries in the class) and indicates the ldev#          00555000
                   in the class list on which the last  extent          00560000
                   was  allocated.  the  disc space allocation          00565000
                   routines will try to satisfy the  next  re-          00570000
                   quest  on  the next disc drive indicated by          00575000
                   the cyclical pointer (with wraparound to  1          00580000
                   if  the  pointer  > n).  if that fails, the          00585000
                   pointer is incremented until space is found          00590000
                   or all  devices  in  the  class  have  been          00595000
                   tried.                                               00600000
  word 4.( 8:1) -- if set, spooling has  been  enabled  (spool          00605000
                   queues opened) for this device class.                00610000
  word 4.( 9:1) -- if set, the class is a terminal type class.          00615000
  word 4.(10:6) -- usually the same as the device type  repre-          00620000
                   sented  by  the  class  (0 for disc, 24 for          00625000
                   tape, 32 for printer,  etc.).  serial  disc          00630000
                   classes  are  disc devices accessed as tape          00635000
                   drives, so their true device types are kept          00640000
                   in the ldt, while this field holds  a  spe-          00645000
                   cial type (31, or %37), indicating a serial          00650000
                   i/o (non-concurrent) device.  similarly,  a          00655000
                   foreign disc is a non-shareable disc drive,          00660000
                   so that fact is reflected by a special type          00665000
                   7 in this field, even though the true hard-          00670000
                   ware type is kept in the ldt, as for serial          00675000
                   discs.                                               00680000
$page                                                                   00685000
$if x8 = off                                                            00690000
$control list                                                           00695000
$if                                                                     00700000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              00705000
             |  declarations start here  |                              00710000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              00715000
                                                                        00720000
conventions used in the declarations:                                   00725000
1.  we presume the existence of the following  logical  arrays          00730000
    or pointers:                                                        00735000
  a)  dct'head -- when referencing the dct head entry.                  00740000
  b)  dct      -- for referencing any field of a dct entry ex-          00745000
                  cept the class name.                                  00750000
  c)  dct'b    -- byte array equivalent of dct for referencing          00755000
                  the class name.                                       00760000
    the arrays (pointers) can be direct, indirect, db-relative          00765000
    or q-relative. if db-relative, make sure you know where db          00770000
    is before you use them.  the only time you have to  expli-          00775000
    citly reference them is when you declare them and when you          00780000
    set their starting address.  thereafter the defines  below          00785000
    will  implicitly reference them.  you must use the defines          00790000
    though.                                                             00795000
2.  prefixes in the defines are:                                        00800000
  a)  dcth -- when referencing dct'head.                                00805000
  b)  dct  -- when referencing the logical array dct.                   00810000
  c)  dctb -- when referencing the byte array dct'b.                    00815000
3.  within the defines, symbols are given  alphabetically  for          00820000
    easier lookup without using xref.                                   00825000
;                                                                       00830000
equate                                                                  00835000
   dct'dst            = 40,                                             00840000
   dct'sir            = 40;                                             00845000
                                                                        00850000
equate                                                                  00855000
   dct'mpe'version    =  5;                                             00860000
                                                                        00865000
equate                                                                  00870000
   dct'first'ldev     =  6; << entry-rltv offset to ldev #1 >>          00875000
                                                                        00880000
<< dct header entry fields.                                 >>          00885000
                                                               <<06423>>00890000
equate                                                         <<06423>>00895000
   size'of'dct'head   =  6;                                    <<06423>>00900000
                                                                        00905000
define                                                                  00910000
   dcth'dct'base        = dct'head(3) #,                                00915000
   dcth'entry'size      = dct'head(1) #,                                00920000
   dcth'num'dct'entries = dct'head(2) #,                                00925000
   dcth'num'tdt'entries = dct'head(4) #,                                00930000
   dcth'segment'size    = dct'head(0) #,                                00935000
   dcth'tdt'base        = dct'head(5) #;                                00940000
$page                                                                   00945000
<< dct entry fields.                                        >>          00950000
                                                                        00955000
define                                                                  00960000
   dct'access'type    = dct(4).(10:3)        #,                <<06400>>00965000
       dct'direct'access = 0                 #,                <<06400>>00970000
       dct'serial'in     = 1                 #,                <<06400>>00975000
       dct'io'concurrent = 2                 #,                <<06400>>00980000
       dct'io'nonconcur  = 3                 #,                <<06400>>00985000
   dct'class'acc'type = dct(4).(10:6)      #,                           00990000
   dct'cyclical'ptr   = dct(4).( 1:7)      #,                           00995000
   dct'next'entry     = dct'num'devices + 6#,                           01000000
   dct'num'devices    = dct(5)             #,                           01005000
   dct'spool'queues   = dct(4).( 8:1)      #,                           01010000
       dct'open       = 1                  #,                           01015000
       dct'shut       = 0                  #,                           01020000
   dct'term'class     = dct(4).( 9:1)      #,                           01025000
   dct'words'in'entry = dct'next'entry     #,                           01030000
   dctb'class'name    = dct'b(0)           #;                           01035000
$page "MPE TABLE ACCESS:  TERMINAL DESCRIPTOR TABLE (TDT)"              01040000
comment                                                                 01045000
$if x8 = off                                                            01050000
$control nolist                                                         01055000
$if                                                                     01060000
                terminal descriptor table                               01065000
                                                                        01070000
                   typical entry format                                 01075000
                   --------------------                                 01080000
                                                                        01085000
       0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                   01090000
     +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                  01095000
    0|                                               |                  01100000
    1|                  file name                    |                  01105000
    2|                                               |                  01110000
    3|                                               |                  01115000
     +-----------------------------------------------+                  01120000
    4|                                               |                  01125000
    5|                  group name                   |                  01130000
    6|                                               |                  01135000
    7|                                               |                  01140000
     +-----------------------------------------------+                  01145000
    8|                                               |                  01150000
    9|                 account name                  |                  01155000
   10|                                               |                  01160000
   11|                                               |                  01165000
     +-----------------------------------------------+                  01170000
   12|        number of devices in class (n)         |                  01175000
     +-----------------------------------------------+                  01180000
   13|                   ldev #1                     |                  01185000
     +-----------------------------------------------+                  01190000
   14|                   ldev #2                     |                  01195000
     +-----------------------------------------------+                  01200000
                 .                      .                               01205000
                 .                      .                               01210000
                 .                      .                               01215000
     +-----------------------------------------------+                  01220000
 n+12|                   ldev # n                    |                  01225000
     +-----------------------------------------------+                  01230000
                                                                        01235000
discussion:                                                             01240000
  the terminal descriptor table (tdt)  points  to  mpe  system          01245000
files which contain custom terminal configuration information.          01250000
this can be used to override system or terminal  defaults,  as          01255000
desired by a user. consult user manuals or the datacomm lab of          01260000
ind for further information.                                            01265000
  the tdt is very similar to the dct, in that it too  contains          01270000
an arbitrary number of entries, each of arbitrary length, with          01275000
no defined order within the table or within an entry.                   01280000
  since the tdt entries are of variable length, when you  want          01285000
a  particular  entry you must always start at the beginning of          01290000
the tdt and link through each entry until  you  find  the  one          01295000
you're interested in.                                                   01300000
$page                                                                   01305000
$if x8 = off                                                            01310000
$control list                                                           01315000
$if                                                                     01320000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              01325000
             |  declarations start here  |                              01330000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              01335000
                                                                        01340000
conventions used in the declarations:                                   01345000
1.  we presume the existence of the following  logical  arrays          01350000
    or pointers:                                                        01355000
  a)  tdt'b -- byte array equivalent of  tdt  for  referencing          01360000
               the file, group or account name(s).                      01365000
  b)  tdt   -- for referencing any other field of an entry.             01370000
    the arrays (pointers) can be direct, indirect, db-relative          01375000
    or q-relative. if db-relative, make sure you know where db          01380000
    is before you use them.  the only time you have to  expli-          01385000
    citly reference them is when you declare them and when you          01390000
    set their starting address.  thereafter the defines  below          01395000
    will  implicitly reference them.  you must use the defines          01400000
    though.                                                             01405000
2.  prefixes in the defines are:                                        01410000
  a)  tdtb -- when referencing the byte array tdt'b.                    01415000
  b)  tdt  -- when referencing the logical array tdt.                   01420000
3.  within the defines, symbols are given  alphabetically  for          01425000
    easier lookup without using xref.                                   01430000
;                                                                       01435000
equate                                                                  01440000
   tdt'mpe'version    =  5;                                             01445000
                                                                        01450000
equate                                                                  01455000
   tdt'first'ldev     = 12; << entry-rltv offset to ldev #1 >>          01460000
                                                                        01465000
define                                                                  01470000
   tdt'next'entry     = tdt'num'devices + 13#,                          01475000
   tdt'num'devices    = tdt(12)             #,                          01480000
   tdtb'acct'name     = tdt'b(16)           #,                          01485000
   tdtb'file'name     = tdt'b(0)            #,                          01490000
   tdtb'group'name    = tdt'b(8)            #;                          01495000
                                                                        01500000
comment                                                                 01505000
<<**********************************************************>>          01510000
<<*                                                        *>>          01515000
<<*                     end incldct                        *>>          01520000
<<*                                                        *>>          01525000
<<**********************************************************>>          01530000
;                                                                       01535000
