home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / Hack / MISC / MORPRIME.ZIP / MORPRIME.TXT
Encoding:
Text File  |  1996-04-27  |  10.4 KB  |  264 lines

  1. The THC Hack/Phreak Archives: MORPRIME.TXT (258 lines)
  2. Note: I did not write any of these textfiles.  They are being posted from
  3. the archive as a public service only - any copyrights belong to the
  4. authors.  See the footer for important information.
  5. ==========================================================================
  6.  
  7.  
  8. ______________________________________________________________________________
  9.  
  10.                       RVEC Parameters and DMSTK Format
  11.  
  12.                   A Telecom Computer Security Bulletin File
  13. ______________________________________________________________________________
  14.  
  15.  
  16.                                 RVEC Parameters
  17.  
  18. The commands RESTOR, RESUME, SAVE, PM, and START process a group of optional
  19. parameters associated with the PRIMOS RVEC vector.  These parameters are
  20. stored on disk for every runfile (executable program).
  21.  
  22. Initial values for the RVEC parameters are usually specified in the PRIMOS
  23. SAVE command, or by LOADer's or SEG's SAVE command when the program was
  24. stored on disk.
  25.  
  26. Each parameter is a 16-bit processor word, represented by up to six octal
  27. digits.
  28.  
  29.  
  30.                    Memory
  31.    Parameter      Location     Definition
  32.  
  33.       SA             --        Starting Address (first memory word used
  34.                                by program)
  35.       EA             --        Ending Address (last memory word used
  36.                                by program)
  37.       PC              7        P Register (Program Counter)
  38.        A              1        A Register (Arithmetic)
  39.        B              2        B Register (Arithmetic)
  40.        X              0        Index Register
  41.      Keys            --        Status keys associated with INK, OTK
  42.                                instructions
  43.  
  44.  
  45. The RVEC parameters are optional in the command string.  Any item that is
  46. specified replaces the previous value in RVEC, which is saved with the prog-
  47. ram.  Thus, for any parameters that are not specified, the value previously
  48. stored in RVEC is saved with the program
  49.  
  50. Slash convention: An ordinal value followed by a slash and a value can be used
  51. to set a selected octal parameter without setting other octal parameters.  For
  52. example, given the command format:
  53.  
  54.    RESUME pathname [pc] [a] [b] [x] [keys]
  55.  
  56. the command:
  57.  
  58.    R FILNAM 2/1000
  59.  
  60. sets the value of the RVEC parameter, B (ie, skip two octal parameters and
  61. then set the third to '1000').
  62.  
  63. Supplying RVEC parameters: RVEC parameters specified in RESUME or START comm-
  64. ands replace the previous values in RVEC.  Also, when a program returns to
  65. PRIMOS through the EXIT subroutine, RVEC is loaded from the processor values
  66. in effect at the time of the exit.  Only the SAVE command alters the values of
  67. RVEC stored on disk with the program.
  68.  
  69. RESTOR returns a program from disk to memory and loads the SAVE parameters
  70. into RVEC in preparation for a START command.
  71.  
  72. RESUME combines the functions of RESTOR and START.
  73.  
  74. PM lists the current values of the RVEC parameters.
  75.  
  76. External commands have RVEC parameters that can be modified at the time the
  77. command is started (eg, PMA filename 1/740).  Providing RVEC parameters to a
  78. command that does not need them will cause unpredictable results.
  79.  
  80.    Keys
  81.  
  82. The item, keys, when specified among RVEC parameters, refers to the processor
  83. status keys handled by the INK and OTK instructions (refer to the System Arch-
  84. itecture Reference Guide).  These are represented by a single 16-bit word in
  85. one of the following formats (S-mode and R-mode programs use the first format;
  86. V-mode and I-mode programs use the second).
  87.  
  88. Keys (SR)
  89.  
  90. Process status information is available in a word called the keys, which can be
  91. read or set by the program.  It's format is as follows:
  92.  
  93.     _______________________________________________________________
  94.    |     |       |      |        |     |                           |
  95.    |  C  |  DBL  |  --  |  Mode  |  0  |  Bits 9-16 of location 6  |
  96.    |_____|_______|______|________|_____|___________________________|
  97.  
  98.       1      2      3      4-6     7-8    9         ---         16
  99.  
  100.    C (Bit 1)            Set by arithmetic error conditions
  101.    DBL (Bit 2)          0 - Single Precision, 1 - Double Precision
  102.  
  103.  
  104.                           001     32S
  105.  
  106.  
  107.  
  108. Process status information is available in a 16-bit register known as the keys.
  109. It may be referenced by the LPSW, TKA, and TAK instructions.
  110.  
  111.  _____________________________________________________________________________
  112. |     |     |     |     |     |     |      |      |       |       |     |     |
  113. |  C  |  0  |  L  |  M  |  F  |  X  |  LT  |  EQ  |  DEX  |  0-0  |  I  |  S  |
  114. |_____|_____|_____|_____|_____|_____|______|______|_______|_______|_____|_____|
  115.  
  116.    1     2     3    4-6    7     8      9     10      11    12-14   15    16
  117.  
  118.    C (Bit 1)            C-bit
  119.    L (Bit 3)            L-bit
  120.  
  121.    MODE (Bits 4-6)      Addressing Mode:
  122.  
  123.                           000    16S
  124.                           001    32S
  125.                           011    32R
  126.                           010    64R
  127.                           110    64V
  128.                           100    32I
  129.  
  130.    F (Bit 7)            Floating point exception disable:
  131.  
  132.                           0      take fault
  133.                           1      set C-bit
  134.  
  135.    X (Bit 8)            Integer exception enable:
  136.  
  137.                           0      set C-bit
  138.                           1      take fault
  139.  
  140.    LT (Bit 9)           Condition code bits:
  141.  
  142.    EQ (Bit 10)            LT     set if result is negative
  143.                           EQ     set if result is zero
  144.  
  145.    DEX (Bit 11)         Decimal exception enable:
  146.  
  147.                           0      set C-bit
  148.                           1      take fault
  149.  
  150.    I (Bit 15)           In dispatcher -- set/cleared only by process exchange
  151.  
  152.    S (Bit 16)           Save done -- set/cleared only by process exchange
  153.  
  154.  
  155. C-bit (VI): Set by error conditions in arithmetic operations and by shifts.
  156.  
  157. L-bit (VI): Set by an arithmetic or shift operation except IRS, IRX, DRX.
  158. Equal to carry out of the most significant bit (Bit 1) of an arithmetic
  159. operation.  It is valuable for simulating multiple-precision operations and
  160. for performing unsigned comparisons following a CAS or a SUB.
  161.  
  162. Condition code bits (VI): The two condition code bits are designated "EQ" and
  163.  
  164.  
  165.                                  DMSTK Format
  166.  
  167. The DMSTK command traces the sequence of calls and returns by which the user's
  168. process arrived at its current state.  Machine states for internal commands,
  169. condition frames, and fault frames are preserved on the user's command stack.
  170. In addition, the most recent activation of a static mode program or dump on the
  171. terminal or into a COMOUTPUT file.  As it is an internal command, it does not
  172. overwrite the static mode stack, and so does not preclude re-entry into the
  173. faulting program.
  174.  
  175. The DMSTK command has several options.  These options may be used in any order
  176. aout in octal.  The command syntax is as follows:
  177.  
  178.  
  179.  
  180.    Option                       Definition
  181.                 done in full format (since "full format" is the default, there
  182.                 with the most recent condition frame (if there is one) or with
  183.                 vation (ie, frame) that is dumped is to be produced.
  184.  
  185.  
  186. DMSTK lists each stack frame in the following general format (for an explan-
  187. ation of the registers and the rings involved, see the System Architecture
  188. Reference Guide):
  189.  
  190.    (nn) offset: Owner= procname (LB= ownerlb).
  191.           Called from pcl_addr; returns to return_addr.
  192.  
  193. The information is as follows:
  194.  
  195.  
  196.    Argument                     Definition
  197.  
  198.    nn                   Frame index number of the stack frame
  199.    offset               The word number in the current stack segment where
  200.                         this activation's stack frame begins
  201.    procname             The name (if available) of the procedure that owns
  202.                         this stack frame
  203.    ownerlb              The stack value of the LB (linkage base) register
  204.                         belonging to the procedure that owns the stack frame
  205.    pcl_addr             Address of the PCL instruction that caused the
  206.                         procedure to be invoked
  207.    return_addr          The address to which the procedure will return
  208.  
  209.  
  210. If the frame is a fault frame, the following format is used:
  211.  
  212.    (nn) offset: FAULT FRAME; fault type = fault type.
  213.           Fault returns to ret_pb; LB= faulter_lb, keys= faulter_keys.
  214.           Fault code= fcode; fault addr= faddr.
  215.           Registers at time of fault:
  216.                000001 000002 000003 000004 000005 000006
  217.                000007 000010 000011 000012 000013 000014
  218.                000015 000016 000017 000020 000021 000022
  219.                000023 000024 000025 000026 000027 000030
  220.  
  221.  
  222.    Argument                     Definition
  223.  
  224.    fault-type           Location in the fault table of the type of fault
  225.                         that occurred
  226.    ret_pb               Address to which the fault returns
  227.    faulter_lb           LB register belonging to the procedure in which
  228.                         the fault occurred
  229.    faulter_keys         CPU keys at the time of the fault
  230.    register data        If present, a direct dump of the register save area
  231.                         (in the same format as that produced by the CPU RSAV
  232.                         instruction)
  233.    fcode                Fault code generated by this particular fault
  234.    faddr                Fault address generated by this particular fault
  235.  
  236.  
  237. If the activation is a condition frame, the following format is used:
  238.  
  239.    (nn) offset: CONDITION FRAME for "condition_name"; returns to ret_pb.
  240.           Condition raised at sigloc; LB= siglb; keys= sigkeys.
  241.           [(Crawlout to outerpb; LB= outerlb; keys= outerkeys.)]
  242.           [Registers at time of fault in inner ring:
  243.                 Save Mask= ssssss; XB= xb_value
  244.                  000001 000002 000003 000004 000005 000006
  245.                  000007 000010 000011 000012 000013 000014
  246.                  000015 000016 000017 000020 000021 000022
  247.                  000023 000024 000025 000026 000027 000030]
  248.  
  249. The latter two frames are displayed only if the condition was signalled in an
  250. inner ring and subsequently a crawlout to the current ring occurred.
  251.  
  252. If, during the trace, the stack switches to a different segment, DMSTK will
  253. print, "STACK SEGMENT IS xxxx", giving the octal segment number of the new
  254. stack segment.
  255.  
  256.    Note
  257.  
  258. A called-from or return-to value such as 0(0)/0 or 0(0)/177776 usually means
  259. that the stack frame has an invalid return point and can never return.  An
  260. example of such a frame is the first frame set up by SEG in a V-mode Static
  261. Mode program.
  262.  
  263. Downloaded From P-80 Systems 304-744-2253
  264.