Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - sysdpy/monrd.doc
There are no other files named monrd.doc in the archive.
                       MONRD%     JSYS 717

The MONRD% jsys is used  by non-privileged program to obtain  information
from the JSB, PSB, a monitor symbol (restricted set of), and fork status.

ACCEPTS IN      AC1:  function code

    AC2 through AC4:  dependent on the function (see description below)

RETURNS     +1:  always

    AC1: zero on success, nonzero on failure

    AC2: usually contains returned value (see description below)

Code  Symbol                         Meaning

  0   .RDTST     The test function is used in order to see if the MONRD%
                 JSYS is  implemented.  If  implemented, the  JSYS  will
                 return in AC2 a value  of .TSTNY (123456 octal) if  the
                 MONRD% JSYS  can be  executed  by anybody,  and  .TSTNN
                 (654321 octal) if the user must have WHEEL or  OPERATOR
                 capabilities enabled.  (AC2 must be zero.)

  1   .RDSYM     The read symbol function will get the  definition  (the
                 address  in  the  monitor) of the SIXBIT symbol in AC1.
                 If successful AC2 will contain the  definition  of  the
                 symbol.

  2   .RDJSB     The read JSB function allows you to read the contents a
                 word  in  the  JSB  (Job  Storage  Block).  The word is
                 referenced by an  offset  (contained  in  AC3)  from  a
                 symbol  (the  SIXBIT  value  of  which is in AC2).  AC4
                 contains the  job  number.   (Symbols  implemented  are
                 listed  below.)  On  successful return AC2 will contain
                 the contents of that word.

  3   .RDPSB     The read  PSB  function  is  the  same  as  the  .RDJSB
                 function except that it allows you to read from the PSB
                 (Proccess Storage Block) and not the JSB.  AC4 contains
                 the system fork number.

  4   .RDSTS     The read fork status function  returns  the  same  fork
                 information  as  the RFSTS JSYS in AC2 (if successful).
                 AC2 (on entry) contains the absolute fork  number  (not
                 relative fork handle) of the fork in question.

  5   .RDMAP     The read fork map function  reads the access of  a user
                 core page,  given a page number  (in AC2)  and a system
                 fork  number  (in AC3).  On a  successful  return,  AC2
		 contains a page pointer:

	0		This page and all further pages are nonexistant
	0,,N		This page nonexistant, next existant page is N
	1XXXXX,,XXXXXX	Private page
	2XXXXX,,Fork	Shared page with given system fork index
	2XXXXX,,-OFN	Shared page with given file ofn
	3XXXXX,,Fork	Indirect page with given fork index
	3XXXXX,,-OFN	Indirect page with given file ofn
  6   .RDFST     The  read  fork status  function,  given  a system fork
                 number (in  AC2), returns  the  FKSTAT  word  for  that
		 fork in AC2.  (This word is  displayed by SYSDPY as the
		 scheduler test.)

  7   .RDPID     The  read  IPCF  header  function reads a word from the
		 header  of a  PID  (given in AC2;  the offset  into the
                 header should be in AC3).

 10   .RDDLL     The read DECNET  function dumps out the DECnet  logical
                 link  blocks  into core.  The right half of AC2  should
                 contain  the  address of a block into which to dump the
                 links,  and the left half should  contain the length of
                 the block.   The size of each link will be  returned in
                 the left half of AC2, and the number  of links will be
                 returned in the right half.

 11   .RDTTY     The read terminal  database  function  gets a word from
		 the TTACTL  data table.   AC2  should contain a  symbol
                 name,  AC3  the offset from  the symbol,  and  AC4  the
                 terminal  number.   The given word in the table will be
                 returned in AC2.

 12   .RDTTS     The  read  TTSTAT  word  function  reads  the  terminal
                 characteristics  word  for a  terminal (number given in
                 AC2) and returns it in AC2.

 13   .RDWSP     The  read  FKWSP  word  function,  given a system  fork
		 number in AC2,  returns the FKWSP word for that fork in
		 AC2. This word contains in the right half the number of
		 physical pages currently assigned to each fork,  and in
		 the  left  half the  preload  size of the fork  when it
		 enters the balance set.

 14   .RDRES     The read system resource status  function,  called with
		 the type of resource in AC2,  returns the initial value
		 of the resource in AC3,  and the  current value in AC2.
		 Defined pools are:

	0    Total free resident blocks
	1    Swappable storage
	2    ENQ blocks
	3    Swappable network (DECnet core)
	4    Number of OFNs
	5    SPT slots
	6    Swapping pages
	7    Pages of user core used
       10    Number of forks used

 15   .RDXRD     Read a block of memory from any section of the monitor.
		 Due to the extreme power of this function,  it requires
		 WHEEL  or  OPERATOR to use even if MONRD% as a whole is
		 not privileged.  Call with AC2 containing the length of
		 the  transfer  in  words,  AC3  containing the  monitor
		 source address, and AC4 containing the user destination
		 address.  Either address may be extended.

Generates illegal instruction interrupt if not implemented.
Quick summary:

Function:  Test MONRD   Read symbol   Read JSB    Read PSB     Fork status
 AC1:       .RDTST       .RDSYM        .RDJSB      .RDPSB       .RDSTS
 AC2:       0            sym-name      sym-name    sym-name     sys-fk-#
 AC3:       --           --            offset      offset       --
 AC4:       --           --            job-#       sys-fork-#   --

Function:  Page map     Read FKSTAT   IPCF Hdr   DECnet        TTY Data
 AC1:       .RDMAP       .RDFST        .RDPID     .RDDLL        .RDTTY
 AC2:       page-#       sys-fork-#    PID        -len,,dest    sym-name
 AC3:       sys-fork-#   --            offset     --            offset
 AC4:       --           --            --         --            tty-#

Function: Term status   Read FKWSP    Resources  Memory peek
 AC1:      .RDTTS        .RDWSP        .RDRES     .RDXRD
 AC2:      tty-#         sys-fork-#    pool       length
 AC3:      --            --            --         source
 AC4:      --            --            --         dest

where:  sym-name    is the SIXBIT value of the symbol to look for
	sys-fork-#  is an absolute (system- rather than job-wide) fork number
	offset	    is the offset (from the symbol  name)
        job-#       is the number of the job to examine the JSB of
	len	    is the size of the buffer to store the information in
	pool	    is the number of a system resource pool
	tty-#	    is a terminal number (not tty designator)
	source	    is the monitor address from which to copy
	dest	    is an address in user space to copy information into


Table of JSB, PSB, etc symbols known by MONRD%:

        CAPENB  CAPMSK  DSKDTB  FILBYN  FILBYT  FILDDN  FILDNM  FILNEN
        FILSTS  FILVER  FILOFN  FILDEV  FKCNT   FKPTRS  FKRT    INTDF
        JOBNO   JSVAR   JSVARZ  KIMUU1  LSTERR  MAXJFN  MLJFN   NUFKS
        PPC     PSVAR   PSVARZ  RESQTL  RSCNBP  SYSFK   TRAPPC  TTFLG1
        TTFLGS  TTICT   TTLINK  TTOCT   UPDL    UTRPCT