home *** CD-ROM | disk | FTP | other *** search
/ Hacker Chronicles 1 / HACKER1.ISO / hack / morprime.txt < prev    next >
Text File  |  1992-09-07  |  11KB  |  259 lines

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