
|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|
| The Source                                       Thu Mar 24 17:12:35 1994 |
|___________________________________________________________________________|


Some legal stuff
----------------

 * PowerVisor source   Copyright © 1994   Jorrit Tyberghein
 *
 * - You may modify this source provided that you DON'T remove this copyright
 *   message
 * - You may use IDEAS from this source in your own programs without even
 *   mentioning where you got the idea from
 * - If you use algorithms and/or literal copies from this source in your
 *   own programs, it would be nice if you would quote me and PowerVisor
 *   somewhere in one of your documents or readme's
 * - When you change and reassemble PowerVisor please don't use exactly the
 *   same name (use something like 'PowerVisor Plus' or
 *   'ExtremelyPowerVisor' :-) and update all the copyright messages to reflect
 *   that you have changed something. The important thing is that the user of
 *   your program must be warned that he or she is not using the original
 *   program. If you think the changes you made are useful it is in fact better
 *   to notify me (the author) so that I can incorporate the changes in the real
 *   PowerVisor
 * - EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
 *   SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR. YOU MAY ASK A
 *   SHAREWARE FEE
 * - In general it is always best to contact me if you want to release
 *   some enhanced version of PowerVisor
 * - This source is mainly provided for people who are interested to see how
 *   PowerVisor works. I make no guarantees that your mind will not be warped
 *   into hyperspace by the complexity of some of these source code
 *   constructions. In fact, I make no guarantees at all, only that you are
 *   now probably looking at this copyright notice :-)
 * - YOU MAY NOT DISTRIBUTE THIS SOURCE CODE WITHOUT ALL OTHER SOURCE FILES
 *   NEEDED TO ASSEMBLE POWERVISOR. YOU MAY DISTRIBUTE THE SOURCE OF
 *   POWERVISOR WITHOUT THE EXECUTABLE AND OTHER FILES. THE ORIGINAL
 *   POWERVISOR DISTRIBUTION AND THIS SOURCE DISTRIBUTION ARE IN FACT TWO
 *   SEPERATE ENTITIES AND MAY BE TREATED AS SUCH


Ok
--

In this distribution you can find the source of PowerVisor V1.50.  In
principle all you need to assemble PowerVisor can be found here (except for
some include files from reqtools.  You can get the reqtools package (© Nico
François) elsewhere (Fish, Aminet, ...)) but have no illusions.
Reassembling PowerVisor won't be easy.  I suppose most people are never
going to try to reassemble PowerVisor.  Most people will only want to read
the source (or bits of it anyway) for educational or other purposes (has my
source any educational value?  :-) Therefore, I will not say much about how
to reassemble PowerVisor except that you need a C compiler and an assembler
that supports the Motorola new syntax (used for the 68020 and higher) and
the assembler should also support the 68020/030/040/881/882/851.  The C
compiler I use is SAS/C (6.0) (but you can just as well use SAS/C 5.10b)
and the assembler is Macro68.

Info
----

The rest of this file is devoted to random bits of information useful to
understand what is happening in the source. Enjoy it :-)

1) Directory structure
----------------------

   The following three files are made and updated by 'bumprev'. This
   program (© Commodore) is useful to control version and revision
   numbers for a large project. 'bumprev' is called from the makefile

         PowerVisor.h
         PowerVisor.i
         PowerVisor.rev

   The following files are the real source files for PowerVisor

      This is the 'main' source file. PowerVisor starts here. The following
      things are in this source :
      - the initializing module
      - the reading and writing of the config file
      - error handling
      - initial parsing of the commandline
      - the PowerVisor main input loop
      - alias handling
      - the 'pvcall' command
      - script handling routines
      - key attaching routines
      - refresh routines
      - preferences ('mode' and 'prefs')
      - history buffer routines
      - input handler and PowerVisor task
      - various other little utilities (32 bit multiply, CreatePort, ...)
         pv_main.asm

      This file contains the routine to detach PowerVisor (only for
      AmigaDOS 2.0 version)
         pv_detach.asm

      This file contains all routines for the debugger
      - tracing, breakpoints
      - exception handling routines
      - very technical debugging routines
      - fullscreen debugger routines
         pv_debug.asm

      The filehandling routines
      - the 'to' and 'log' commands
      - the 'help' and template routines
      - buffer file IO
         pv_file.asm

      All routines for 'list' and 'info' handling
      - 'addstruct' and equivalent commands
      - 'gadgets' lister
      - 'list', 'llist' and 'info' commands
      - 'owner' and 'for' commands
      - many routines to control the various lists
         pv_list.asm

      The expression evaluater and other things for the parser
      - routines for group operator {}
      - everything for variables, constants and functions
      - string handling functions
      - conversion routines (int to ascii and ascii to int)
      - flexible search routine ('SearchWord')
      - assignment handling
      - expression evaluator and all needed routines
         pv_eval.asm

      All the routines for MMU and 68020 or higher
      - routines to flush the cache
      - MMU commands
      - 'specregs'
      - The memory protection system
         pv_mmu.asm

      Various specialized PowerVisor commands and constructions
      - exception handling and crash trapping
      - fd-file handling
      - function monitor handling ('addfunc' command)
      - resource tracker ('track' command
      - various routines to remove various things ('kill', 'remhand', ...)
      - stack checker
      - device commands ('opendev', ...)
      - floating point register show ('fregs')
      - register show ('regs')
      - resident programs
      - various other general commands ('taskpri', 'hunks', ...)
      - exception handler for crash trapping
      - patch for Alert exec function
         pv_general.asm

      Various PowerVisor related ARexx things (the real ARexx port is
      in 'myminrexx.c')
      - 'clip', 'string', 'remclip', 'hide', 'unhide', 'sync', 'async', ...
      - ARexx dispatcher
         pv_arexx.asm

      The PowerVisor screen and windows
      - the logical window system
      - the physical window system
      - the global system
      - the box system
      - menu handling
      - various screen related commands ('colrow', 'fit', ...)
      - main routine to wait for user input (string gadget handling)
        this routine also dispatches various other things (like ARexx,
        trapped crashes, portprint messages, ...)
      - use of reqtools requesters
         pv_screen.asm

      Memory handling routines
      - resident segment handling ('resident' command)
      - memory viewing routines ('view', 'unasm', 'memory', ...)
      - tag system
      - various disassembler routines
      - various commands ('search', 'fill', ...)
      - PowerVisor memory allocation systems
      - virtual print routines (print to memory instead of screen)
         pv_memory.asm

      The file including the PowerVisor.i file for the revision number
         pv_revision.asm

      The source of the disassembler. This source is Copyright © Andre
      Pelckmans
         mondis.c

      The ARexx port. This is minrexx.c adapted to my own purposes
      - added support for clips
         myminrexx.c

      Source for the heapsort function
         heapsort.c

   The following files are include files needed by PowerVisor

      This file contains all important definitions and macros useful
      for all source files. It also contains a debugging system
         pv.i

         pv.debug.i
         pv.arexx.i
         pv.list.i
         pv.errors.i
         pv.lib.i
         pv.eval.i
         pv.main.i
         pv.mmu.i
         pv.screen.i
         pv.general.i
         pv.memory.i
         pv.minrexx.i
         pv.file.i
         TileWindows.i
         minrexx.h

   The following files are the source for the 'mstruct' utility and other
   utilities

         Arg.Asm
         Arg13.Asm      (for AmigaDOS 1.3)
         MStruct.c
         MStruct13.c    (for AmigaDOS 1.3)

   The following files are useful to construct PowerVisor

      Script to make PowerVisor. This script uses 'makefile'
         makepv

      Script to make PowerVisor for AmigaDOS 1.3
         makepv13

      Script to make PowerVisor with debug information
         makepvd

      Script to make PowerVisor for AmigaDOS 1.3 with debug information
         makepvd13

      The makefile. Using this makefile you can make PowerVisor,
      MStruct and the powervisor.library
         makefile
         SCOPTIONS

   The source for powervisor.library

         pvLib.asm

   Some files to read

         pv.bugs
         PVSource.Readme


2) AmigaDOS 2.0 and 1.3
-----------------------

'D20' is used in the source to distinguish between AmigaDOS 2.0 or
AmigaDOS 1.3 code. For example :

   IFD D20
      <AmigaDOS 2.0 code>
   ENDC
   IFND D20
      <AmigaDOS 1.3 code>
   ENDC

This assembler flag is given to the assembler with '-D D13'. The pv.i include
file automatically converts this D13 to D20.


3) Precompiled include files
----------------------------

I use precompiled include files with Macro68. If you do not want to do this,
you must include the correct files in 'pv.i'. Note that PowerVisor needs
the AmigaDOS 2.0 include files (even the AmigaDOS 1.3 version).


4) Debugging levels
-------------------

The following constants defined in 'pv.i' control debugging :

   DEBUGNORM : when true the following commands work :
               DEBUGP, DEBUGI, DEBUGL, DEBUGS
   DEBUGSUSP : suspicion macro with CHECK
   DEBUGMEM  : memory corruption checks with MEMCHECK and MEMWATCH
   DEBUGFOUR : DEBUGPC check for easy 4 character keywords

If you want to use any of these debugging tools, you must set DEBUGGING
to true.

Note that this debugging system is not completely ready and functional.


5) Library calling macros
-------------------------

Each CALLxxx macro expects the name of the function to be called. Note that
these macros corrupt A6 (they do not restore it).
The following library calling macros are defined :

   CALLEXEC    exec
   CALLDF      diskfont
   CALLINP     input device
   CALLPV      powervisor
   CALLGT      gadtools
   CALLUTIL    utility
   CALLLAY     layers
   CALLGRAF    graphics
   CALLDOS     dos
   CALLINT     intuition
   CALLARP     arp
   CALLMATD    mathieeedoubbas

Use CALL if you are sure that A6 already contains the correct library for
the function.
