                               SysMon v. 0.91
                               --------------
                                
    These programs are Copyright  1990, Gribnif Software. They may be
    distributed freely, provided that this document file is included,
    and neither it nor the programs have been modified in any way.
    

This is a BETA version of this software. Comments and suggestions about
SysMon are greatly appreciated, however please be aware of the following:

o  Support for the display of VDI calls is not included yet.
o  The Register Dump option is not included.
o  The current version should work with all versions of TOS, however it
   will not work with CPU's other than a 68000.
o  Output to the screen will currently overwrite anything that is already
   there. The final version will use the buffer to maintain a second
   screen with the output that can be flipped back and forth with a keypress.
   I would also like to write it so that if you are using a second monitor
   (like the Moniterm), you can get the output on the monitor you are not
   using for GEM.
o  Using SysMon to display Line F calls in conjunction with any other type
   of call may crash in the present version.
o  I would like to include an option to generate an "illegal" instruction
   so that SysMon can immediately activate Templemon (what? never heard of
   Templemon? FIND IT!!) when it sees one of the calls it is configured to
   look for.
   

Changes From v. 0.9
-------------------

  SysMon
  ------
  
  o  An AES function that should not have a return value doesn't.
  o  The format for the return for appl_write() was fixed.
  o  All AES functions should give the right return values (very few did
     before [oops!]).
  o  The name of XBIOS function #64 has been changed to "Blitmode" to be
     more consistent with what documentation I could find on this.
  o  The version number presented when SysMon first runs is correct.
  o  Any longword values are displayed with 8 digits and any word values
     with 4. This takes more room in the buffer (or more paper) but it's
     more readable.
  o  The contents of the returned message buffer for evnt_multi() or 
     evnt_mesag() is displayed after the return for the call (if possible).
     
  SysMon Config
  -------------
  
  o  You can now select which functions to enable/disable by clicking on
     the name of the function. No more numbers (except for Line F)!
  o  The main dialog should look better in high resolution.
  o  The "Display Memory" feature takes into account screen wrap-around
     when deciding where to put the "<More>" prompt. It is also resolution
     independant.
  o  Added "Clear Memory" and "Save Memory" buttons.



SysMon is one of those programs that you start working on but never seem to
have the time to finish. Then, when you realize just how much you really
need it, you go back to work on it. For SysMon, this began about six months 
ago. Hopefully it won't take as long to get the final version out, now that
I have come this far.

SysMon will intercept all calls done through the CPU's trap vectors and
display meaningful information about what parameters are being passed and
what values are returned to the caller. Since all programs use one of the
system's trap calls at one time or another, this can prove to be very
valuable for debugging programs for which no source is available. It can
also help to point out possible conflicts between exisiting programs and
and the one being tested.

SysMon consists of two programs. SYSMON.PRG is the main program. It installs
itself in memory and then quits. SYSMNCFG is the configuration program. It
can be run as either a program (with the .PRG filename extension) or as a
desk accessory (with the .ACC extension.) SYSMNCFG requires that its resource
file (SYSMNCFG.RSC) be in the same location as wherever it is run from.


Modes of Operation
------------------

  SYSMON.PRG can be either run as a program directly from the desktop, or it
  can be placed in the AUTO folder. Which method you choose depends on what
  is most convenient, and when you actually need SysMon to be active. If you
  need to view what a particular AUTO folder program or desk accessory is
  doing, then you should configure a copy of SYSMON.PRG and place it into
  the AUTO folder.

  If you run SYSMON.PRG a second time, the new copy will install itself
  in place of the old one in such a manner that SYSMNCFG will look at the
  new copy. It will also de-activate any options that were turned on in
  the previous copy. Doing this requires more memory for the second copy
  and may slow the system slightly, so you may want to consider re-booting 
  first instead.
  
  The AUTO folder method has one drawback, however. Many desk accessories and
  AUTO folder programs that can become resident after SysMon has run will
  intercept the same traps that SysMon has already intercepted. Under these
  circumstances, SysMon may not be able to display all the calls you would
  like it to because one of the other utilities in the chain of vectors does
  not let control flow through to SysMon.
  
  For this reason, the "Wait" feature was added. If SYSMON.PRG has been
  configured with this option on, then it will wait for you to run
  SYSMNCFG before intercepting the system traps. This means that it will
  be the first program in the chain of vectors and should be able to display
  all the calls you want it to.


Output Format
-------------

  All output from SysMon begins with a timestamp in the first column which
  is obtained from the system's 200 Hz timer. This is present for
  comparison purposes only and does not relate to "real world" time at all.
  
  The remaining information varies depending on which type of call is
  being displayed. For GEMDOS, BIOS, XBIOS, and AES you will always get the
  trap number, followed by the function number, the name and parameters
  of the call (if known), and any values returned to the caller (if
  possible, see below).

  Any longword parameters are displayed as 8 hexadecimal digits. Word-sized
  parameters are displayed as 4 hex digits.
  
  For AES functions, you may get one or more parameters for the call that
  have a lowercase letter "r". This is to indicate that SysMon cannot
  display the parameter because it is known only to the program making
  the call. In this case, SysMon will display the value returned into
  that address when the AES call returns.
  
  Sometimes you may not get a return value from a function. This will
  happen whenever another call that SysMon needs to display is done before
  the previous one returns. A good example of this is the GEMDOS Fwrite()
  function, for which TOS makes several BIOS calls before returning to
  the program that did the Fwrite(). If you must see the return value from
  a particular function, then you should change SYSMON's configuration so
  that it will not display the intermediate calls.

  
Configuration Options
---------------------

  When you run SYSMNCFG it checks to see if SysMon has already been run or
  not. If it has not, then you get an alert message. You can still, however,
  load and save configurations using SYSMNCFG.
  
  If SYSMON has already been run, then any calls that SYSMON would normally
  display are not displayed while SYSMNCFG is active.
  
  If SYSMON has already been run and the "Wait" option was used, then an
  alert will appear asking if you want to have SYSMON install its trap
  handlers.

  If SYSMON has already been run, then any changes made in SYSMNCFG go into
  effect immediately if you Select the "Ok!" button to exit SYSMNCFG. If
  you select the "Cancel" button instead, then SYSMON will continue with
  its previous settings.
  
  The following configuration options are available under the current version
  of SYSMON:
  
    Output:  

             Here you select where SysMon will display its information about
             what calls are made. If Printer is selected, then you must make
             sure that your printer is connected through the parallel port
             and that it is turned on. SysMon will also work with the Atari
             SLM804 Diablo Emulator.
             
             If output is sent to the RS-232 port, then you must make sure
             that you have the ST's serial port connected to a modem or
             another computer with a null modem cable. If you are using
             another computer or a terminal, then you should also set the
             RS-232 configuration on both machines before using this option.
             
             Output sent to the screen will currently overwrite anything
             that is already there. This should change for the final
             version of SysMon.
             
             In order to send output to Memory, you must first save a
             configuration to SYSMON.PRG that has a non-zero value for the
             Memory Size, described below.
             
    Registers:  

             This feature is not available in the present version.
    
    Memory Size:
    
             This option is an editable field which tells SYSMON how much
             memory to reserve as a buffer when it first runs. You cannot
             change the buffer size for a copy of SYSMON that has already
             been run and is resident; you must first Save a configuration
             into the SYSMON.PRG file and then run that newly-modified
             program.
             
    GEMDOS:
    
             If this button is highlighted, then GEMDOS calls will be
             displayed. You should also select the "Functions" button to
             the right of the button in order to select which GEMDOS
             functions to include.
             
             You can scroll up and down in the list with the arrow boxes
             and scroll bar. Select a particular function by simply
             clicking on it; if it is black then it will be displayed
             by SysMon.
             
             You can use "Select All" to select all the functions in the
             list. If all the functions are already selected, then
             pressing this button will cause them all to be de-selected.
             
             The "Unknowns" option tells SysMon whether or not you want
             it to display functions that are not in the list and, therefore,
             are unknown to SysMon.
             
    BIOS:

             If this button is selected, then SYSMON will display calls done
             by way of trap 13, the BIOS. You should also set the 
             "Functions" list, as described for the GEMDOS option.
             
    XBIOS:

             If this button is selected, then SYSMON will display calls done
             by way of trap 14, the XBIOS. You should also set the
             "Functions" list, as described for the GEMDOS option.
             
    AES:
    
             If this button is selected, then SYSMON will display calls done
             by way of trap 2, that are designated for the AES portion of
             GEM. You should also set the "Functions" list, as described
             for the GEMDOS option.
             
    VDI:
    
             This feature is not supported in the current version.
             
    Line A:
    
             If this button is selected, then SYSMON will display calls done
             by way of the Line A emulator, which is used for low-level
             graphics. You should also set the "Functions" list, as 
             described for the GEMDOS option.
             
    Line F:
    
             If this button is selected, then SYSMON will display calls done
             by way of the Line F emulator, which is used by GEM at its
             lowest level.
             
             Since the Line F functions are not documented by Atari and
             have changed for every ROM revision so far, SYSMON cannot
             give any information about the meaning of a particular call
             other than its number. For this reason, the "Functions" list
             only lets you enter up to ten Line F functions to Include
             or Exclude. If you choose the "Include Only" button, then only
             the functions you choose will be displayed; if you select
             "Exclude", then all Line F functions NOT in the list will
             be displayed.
             
             The current version of SYSMON may crash if this type of call
             is displayed along with any other type. Also, you may notice
             some weird behavior with mouse movement if too many of the
             Line F calls are being displayed by SYSMON.
             
     Display Memory:
     
             This button is available if SYSMON.PRG is resident and has a
             non-empty buffer configured.
             
             When output is sent to Memory, it is written into a circular
             buffer, where the oldest information is the first to be
             overwritten. Selecting the "Display Memory" button will first
             tell you the location of the buffer in memory, the current
             location of the write pointer, and where the high point in
             the buffer is. If the high point is equal to the current write
             pointer, then the buffer has most likely not begun to
             overwrite itself yet.
             
             After the buffer information is displayed, the actual contents
             of the buffer itself are listed. You can press Esc or Q to
             end the list, Control-S or Control-Q to start and stop the
             list, and Control-Z to toggle the display between the normal
             mode (which displays one page of information at a time) and
             the second mode, which continues listing without stopping.

    Clear Memory:
    
             By selecting this option and selecting "Clear" at the warning
             alert, the memory buffer used by SysMon is reset. This makes
             it easier to find the calls that immediately follow when you
             exit SysMon Config.
             
    Save Memory:
    
             This option presents you with an item selector. If you
             provide a filename and select "Ok", then a file with this
             name will be created with the contents of the memory buffer.
             
    Load Config:
    
             This option is used in order to load files saved with the
             "Save Config" option, described below. A configuration file
             typically ends in the ".SMN" filename extension and contains
             all the information necessary for every option available in
             SYSMNCFG.
             
    Save Config:
    
             This option allows you to save the current configuration of
             SYSMNCFG to either a configuration file (ending in ".SMN") or
             to a copy of SYSMON.PRG. If you Save Config to SYSMON.PRG and
             then run that same copy of SYSMON.PRG, the new configuration
             will be used.
             
    Ok!:
    
             If SYSMON is installed, then selecting this exit button will
             change the configuration of the installed copy of SYSMON to
             whatever the current settings of SYSMNCFG are.
             
    Cancel:
    
             Exit SYSMNCFG without changing the settings of the installed
             SYSMON, if any.
             

Function Numbers
----------------

  Trap 1 (GEMDOS)
  ---------------
  
    00:  Pterm0
    01:  Cconin
    02:  Cconout
    03:  Cauxin
    04:  Cauxout
    05:  Cprnout
    06:  Crawio
    07:  Crawcin
    08:  Cnecin
    09:  Cconws
    0a:  Cconrs
    0b:  Cconis
    0e:  Dsetdrv
    10:  Cconos
    11:  Cprnos
    12:  Cauxis
    13:  Cauxos
    19:  Dgetdrv
    1a:  Fsetdta
    20:  Super
    2a:  Tgetdate
    2b:  Tsetdate
    2c:  Tgettime
    2d:  Tsettime
    2f:  Fgetdta
    30:  Sversion
    31:  Ptermres
    36:  Dfree
    39:  Dcreate
    3a:  Ddelete
    3b:  Dsetpath
    3c:  Fcreate
    3d:  Fopen
    3e:  Fclose
    3f:  Fread
    40:  Fwrite
    41:  Fdelete
    42:  Fseek
    43:  Fattrib
    45:  Fdup
    46:  Fforce
    47:  Dgetpath
    48:  Malloc
    49:  Mfree
    4a:  Mshrink
    4b:  Pexec
    4c:  Pterm
    4e:  Fsfirst
    4f:  Fsnext
    56:  Frename
    57:  Fdatime

  Trap 13 (BIOS)
  --------------
  
    00:   Getmpb
    01:   Bconstat
    02:   Bconin
    03:   Bconout
    04:   Rwabs
    05:   Setexc
    06:   Tickcal
    07:   Getbpb
    08:   Bcostat
    09:   Mediach
    0a:   Drvmap
    0b:   Getshift      (sometimes called Kbshift)
    
  Trap 14 (XBIOS)
  ---------------
  
    00:  Initmous
    02:  Physbase
    03:  Logbase
    04:  Getrez
    05:  Setscreen
    06:  Setpallete
    07:  Setcolor
    08:  Floprd
    09:  Flopwr
    0a:  Flopfmt
    0c:  Midiws
    0d:  Mfpint
    0e:  Iorec
    0f:  Rsconf
    10:  Keytbl
    11:  Random
    12:  Protobt
    13:  Flopver
    14:  Scrdmp
    15:  Cursconf
    16:  Settime
    17:  Gettime
    18:  Bioskeys
    19:  Ikbdws
    1a:  Jdisint
    1b:  Jenabint
    1c:  Giaccess
    1d:  Offgibit
    1e:  Ongibit
    2f:  Xbtimer
    20:  Dosound
    21:  Setprt
    22:  Kbdvbase
    23:  Kbrate
    24:  Prtblk
    25:  Vsync
    26:  Supexec
    27:  Puntaes
    29:  Floprate
    40:  Blitmode
    
  Line A
  ------
  
    a000:  Init
    a001:  Draw Pixel
    a002:  Get Pixel
    a003:  Line
    a004:  Horiz. Line
    a005:  Filled Rect  
    a006:  Filled Polygon
    a007:  BitBlit
    a008:  TextBlit 
    a009:  Showmouse
    a00a:  Hidemouse
    a00b:  Change Mouse
    a00c:  Undraw Sprite
    a00d:  Draw Sprite
    a00e:  Copy Raster
    a00f:  Seed Fill

  AES
  ---
  
    0a:  appl_init
    0b:  appl_read
    0c:  appl_write
    0d:  appl_find
    0e:  appl_tplay
    0f:  appl_trecord
    13:  appl_exit
    14:  evnt_keybd
    15:  evnt_button
    16:  evnt_mouse
    17:  evnt_mesag
    18:  evnt_timer
    19:  evnt_multi
    1a:  evnt_dclick
    1e:  menu_bar
    1f:  menu_check
    20:  menu_ienable
    21:  menu_tnormal
    22:  menu_text
    23:  menu_register
    28:  objc_add
    29:  objc_delete
    2a:  objc_draw
    2b:  objc_find
    2c:  objc_offset
    2d:  objc_order
    2e:  objc_edit
    2f:  objc_change
    32:  form_do
    33:  form_dial
    34:  form_alert
    35:  form_error
    36:  form_center
    37:  form_keybd
    38:  form_button
    46:  graf_rubberbox
    47:  graf_dragbox
    48:  graf_movebox
    49:  graf_growbox
    4a:  graf_shrinkbox
    4b:  graf_watchbox
    4c:  graf_slidebox
    4d:  graf_handle
    4e:  graf_mouse
    4f:  graf_mkstate
    50:  scrp_read
    51:  scrp_write
    5a:  fsel_input
    5b:  fsel_exinput
    64:  wind_create
    65:  wind_open
    66:  wind_close
    67:  wind_delete
    68:  wind_get
    69:  wind_set
    6a:  wind_find
    6b:  wind_update
    6c:  wind_calc
    6d:  wind_new
    6e:  rsrc_load
    6f:  rsrc_free
    70:  rsrc_gaddr
    71:  rsrc_saddr
    72:  rsrc_obfix
    78:  shel_read
    79:  shel_write
    7a:  shel_get
    7b:  shel_put
    7c:  shel_find
    7d:  shel_envrn



If you have any comments or questions about this program, you can address
them to one of the following:

  GEnie:  GRIBNIF
  Bitnet: gribnif@UMASS
  
  Gribnif Software
  P.O. Box 350
  Hadley, MA  01035
  
