home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 50 / af050sub.adf / Enforcer / Enforcer.doc < prev    next >
Text File  |  1993-06-25  |  26KB  |  521 lines

  1. TABLE OF CONTENTS
  2.  
  3. Enforcer
  4. LawBreaker
  5. Move4K
  6. Enforcer                                                             Enforcer
  7.  
  8.    NAME
  9.     Enforcer V37 - An advanced version of Enforcer - Requires V37
  10.  
  11.    SYNOPSIS
  12.     Enforcer - A tool to watch for illegal memory accesses
  13.  
  14.    FUNCTION
  15.     Enforcer will use the MMU in the advanced 680x0 processors
  16.     to set up MMU tables to watch for illegal accesses to memory
  17.     such as the low-page and non-existent pages.
  18.  
  19.     To use, run Enforcer (plus any options you may wish)
  20.     If you wish to detach, just use RUN >NIL: <NIL: to start it.
  21.     You can also start it from the Workbench.  When started from Workbench,
  22.     Enforcer will read the tooltypes of its icon or selected project icon
  23.     for its options.  (See the sample project icons)
  24.  
  25.     Enforcer should only be run *after* SetPatch.
  26.  
  27.    INPUTS
  28.     The options for Enforcer are as follows:
  29.  
  30.     QUIET/S        - This tells Enforcer to not complain about any invalid
  31.                      access and to just build MMU tables for cache setting
  32.                      reasons -- mainly used in conjunction with an
  33.                      Amiga BridgeBoard in a 68030 environment so that
  34.                      the system can run with the data cache turned on.
  35.                      In this case,
  36.                                     RUN >NIL: Enforcer QUIET
  37.                      should be placed into the startup-sequence right
  38.                      after SetPatch.
  39.  
  40.     TINY/S         - This tells Enforcer to output a minimal hit.  The
  41.                      output is basically the first line of the Enforcer
  42.                      hit.  (see below)
  43.  
  44.     SMALL/S        - This tells Enforcer to output the hit line, the
  45.                      USP: line, and the Name: line.  (This means that
  46.                      no register or stack display will be output)
  47.  
  48.     SHOWPC/S       - This tells Enforcer to also output the two lines
  49.                      that contain the memory area around the PC where
  50.                      the hit happened.  Useful for disassembly.
  51.                      This option will not do anything if QUIET, SMALL or
  52.                      TINY output modes are selected.
  53.  
  54.     STACKLINES/K/N - This lets you pick the number of lines of stack
  55.                      backtrace to display.  The default is 2.  If set
  56.                      to 0, no stack backtrace will be displayed.  There
  57.                      is no enforced limit on the number of lines.
  58.  
  59.     DEADLY/S       - This makes Enforcer be a bit more nasty.  Normally,
  60.                      when an illegal read happens, Enforcer returns 0
  61.                      as the result of this read.  With this option,
  62.                      Enforcer will return $ABADFEED as the read data.
  63.                      This option can make programs with Enforcer hits
  64.                      cause even more hits.
  65.  
  66.     FSPACE/S       - This option will make the special $00F00000 address
  67.                      space available for writing to.  This is useful for
  68.                      those people with $00F00000 boards.  Mainly Commodore
  69.                      internal development work -- should only be used
  70.                      in that enviroment.
  71.  
  72.     VERBOSE/S      - This option will make Enforcer display information
  73.                      as to the mapping of the I/O boards and other
  74.                      technical information.  This information maybe useful
  75.                      in specialized debugging.
  76.  
  77.     PARALLEL/S     - This option will make Enforcer use the parallel port
  78.                      hardware rather than the serial port for output.
  79.  
  80.     RAWIO/S        - This option will make Enforcer stuff the hit report
  81.     (special IO)     into an internal buffer and then from the main
  82.                      Enforcer process output the results via the
  83.                      RawPutChar() EXEC debugging LVO.  Since the output
  84.                      happens on the Enforcer task it is possible for a
  85.                      hit that ends in a system crash to not be able to
  86.                      be reported.  This option is here such that tools
  87.                      which can redirect debugging output can redirect
  88.                      the Enforcer output too.
  89.  
  90.     FILE/K         - This option will make Enforcer output the hit report
  91.     (special IO)     but to a file insted of sending it to the hardware
  92.                      directly or using the RAWIO LVO.  A good example of
  93.                      such a file is CON:0/0/640/100/HIT/AUTO/WAIT.
  94.                      Another thing that can be done is to have a program
  95.                      sit on a named pipe and have Enforcer output to it.
  96.                      This program can then do whatever it feels like with
  97.                      the Enforcer hits.  (Such as decode them, etc.)
  98.                      *NOTE*  It is not a good idea to have Enforcer hits
  99.                      go to a file on a disk as if the system crashes
  100.                      during/after the Enforcer hit, the disk may
  101.                      become corrupt.
  102.  
  103.     STDIO/S        - This option will make Enforcer output the hit report
  104.     (special IO)     to STDOUT.  This option only works from the CLI as it
  105.                      requires STDOUT.  It is best used with redirection or
  106.                      pipes.
  107.  
  108.     BUFFERSIZE/K/N - This lets you set Enforcer's internal output buffer
  109.                      for the special I/O options.  This option is only
  110.                      valid with the RAWIO, FILE, or STDIO options.
  111.                      The minimum setting is 8000.  The default is 8000.
  112.                      Having the right amount of buffer is rather
  113.                      important for the special I/O modes.  The reason
  114.                      is due to the fact that no operating system calls
  115.                      can be made from a bus error.  Thus, in the
  116.                      special I/O mode, Enforcer must store the output
  117.                      in this buffer and, via some special magic,
  118.                      wake up the Enforcer task to read the buffer and
  119.                      write it out as needed.  However, if a task is
  120.                      in Forbid() or Disable() when the Enforcer hit
  121.                      happens, the Enforcer task will not be able to
  122.                      output the results of the hit.  This buffer lets
  123.                      a number of hits happen even if the Enforcer task
  124.                      was unable to do the I/O.  If the number of
  125.                      hits that happen before the I/O was able to
  126.                      run gets too large, the last few hits will either
  127.                      be cut off completely or contain only partial
  128.                      information.
  129.  
  130.     INTRO/K        - This optional introduction string will be output
  131.                      at the start of every Enforcer hit.  For example:
  132.                      INTRO="*NBad Program!"   The default is no string.
  133.  
  134.     PRIORITY/K/N   - This lets you set Enforcer's I/O task priority.
  135.                      The default for this priority is 99.  In some
  136.                      special cases, you may wish to adjust this.
  137.                      It is, however, recommended that if you are using
  138.                      one of the special I/O options (RAWIO, FILE, or
  139.                      STDIO) that you keep the priority rather high.
  140.                      The value is not checked for valid priority range.
  141.  
  142.     ON/S           - Mainly for completeness.  If not specified, it
  143.                      is assumed you want to turn ON Enforcer.
  144.  
  145.     QUIT=OFF/S     - Tells Enforcer to turn off.  Enforcer can also be
  146.                      stopped by sending a CTRL-C to its process.
  147.  
  148.    RESULTS
  149.     When running, a set of MMU tables that map addresses that are not
  150.     in the system's address map as invalid such that any access to them
  151.     will cause an access fault.  Enforcer will then display this fact
  152.     and generate a diagnostic message as to what the illegal access
  153.     was.  The first memory page (the one starting at location 0) is
  154.     also marked as invalid as many programming errors cause invalid
  155.     access to these addresses.  These addresses are completely off
  156.     limits to applications.
  157.  
  158.     When an    access violation happens, a report such as the following
  159.     is output.
  160.  
  161. WORD-WRITE to  00000000        data=4444       PC: 07895CA4
  162. USP:  078D692C SR: 0000 SW: 0729  (U0)(-)(-)  TCB: 078A2690
  163. Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  164. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  165. Stck: 00000000 07848E1C 00009C40 078A30B4 BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  166. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 078E9048 00011DA8 DEADBEEF
  167. PC-8: AAAA1111 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C40000
  168. PC *: 522E0127 201433FC 400000DF F09A522E 012611C7 00CE4EAE FF7642B8 0324532E
  169. Name: "New_Shell"  CLI: "lawbreaker"  Hunk 0000 Offset 0000007C
  170.  
  171. LONG-READ from AAAA4444                        PC: 07895CA8
  172. USP:  078D692C SR: 0015 SW: 0749  (U0)(F)(-)  TCB: 078A2690
  173. Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  174. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  175. Stck: 00000000 07848E1C 00009C40 078A30B4 BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  176. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 078E9048 00011DA8 DEADBEEF
  177. PC-8: 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C40000 522E0127
  178. PC *: 201433FC 400000DF F09A522E 012611C7 00CE4EAE FF7642B8 0324532E 01266C08
  179. Name: "New_Shell"  CLI: "lawbreaker"  Hunk 0000 Offset 00000080
  180.  
  181.     Here is a breakdown of what these reports are saying:
  182.  
  183.     The first line of each report describes the access violation
  184.     and where it happened from.  In the case of a WRITE, the data
  185.     that was being written will be displayed as well.  If an instruction
  186.     mode access caused the fault, there will be an (INST) in the line.
  187.  
  188.     The first line may also contain the BUS ERROR message.  This will
  189.     be displayed when an address that is valid in the system lists
  190.     causes a physical bus fault during the access.  This usually
  191.     will happen with plug-in cards or when a hardware problem causes
  192.     some form of system fault.  Watch out, if this does show up, your
  193.     system may be unstable and/or unreliable.
  194.  
  195.     The second line (starts USP:) displays the USER stack pointer (USP),
  196.     the status register (SR:), the special status word (SW:).  It then
  197.     displays the supervisor/user state and the interrupt level.  This
  198.     will be from (U0) to (U7) or (S0) to (S7)  (S=Supervisor)  Next
  199.     is the forbid state (F=forbid, -=not) and the disable state (D or -)
  200.     of the task that was running when the access fault took place.
  201.     Finally, the task control block address is displayed (TCB:)
  202.  
  203.     The next two lines contain the data and address register dumps from
  204.     when the access fault happened.  Note that A7 is not listed here.
  205.     It is the stack pointer and is listed as USP: in the line above.
  206.  
  207.     Then come the lines of stack backtrace.  These lines show the
  208.     data on the stack.  If the stack is in invalid memory, Enforcer will
  209.     display a message to that fact.
  210.  
  211.     Next, optionally, comes the data around the program counter when the
  212.     access fault happened.  The first line (PC-8:) is the 8 long-words
  213.     before the program counter.  The second line starts at the program
  214.     counter and goes for 8 long words.
  215.  
  216.     The last line displays the name of the task that was running when
  217.     the access fault took place.  If the task was a CLI, it will display
  218.     the name of the CLI command that was running.  If the access fault
  219.     was found to have happened within the seglist of a loaded program,
  220.     the segment number and the offset from the start of the segment will
  221.     be displayed.  (Note that this works for any LoadSeg()'ed process)
  222.  
  223.    WARNING
  224.     Enforcer is for software testing.  In this role it is vital.
  225.     Software that causes Enforcer hits may well not be able to run on
  226.     newer hardware.  (Enforcer hits of high addresses on systems not
  227.     running Enforcer but with a 68040 will most likely crash the system)
  228.     Future systems and hardware will make this even more important.  The
  229.     system can NOT survive software that causes Enforcer hits.
  230.  
  231.     However, Enforcer is NOT a system protector.  As a side effect, it
  232.     may well keep a system from crashing when Enforcer hits happen, but
  233.     it may just as well make the software crash earlier.  Enforcer is
  234.     mainly a development and testing tool.
  235.  
  236.     Enforcer causes    no ill effects if no software causes an Enforcer hit.
  237.  
  238.    NOTES
  239.     This new Enforcer is a completely new program.  Bryce Nesbitt came
  240.     up with the original "Enforcer" that has been instrumental to the
  241.     improvement in the quality of software on the Amiga.  The Amiga
  242.     users and developers owe him a great deal for this.  Thank you Bryce!
  243.  
  244.     This Enforcer came about due to a number of needs.  These included
  245.     the need for more output options and better performance.  It also
  246.     marks the removal of all kludges that were in the older versions.
  247.     Also, some future plans required some of these changes...
  248.  
  249.     In addition, the complete redesign was needed in order to also
  250.     support the 68040.  The internal design of Enforcer is now set up
  251.     such that CPU/MMU specific code can be cleanly accessed from the
  252.     general house keeping aspect of the code.  The MMU bus error
  253.     handling is, however, 100% CPU specific.
  254.  
  255.     Since AbsExecBase is in low memory, reads of this address are slower
  256.     with Enforcer running.  Caching AbsExecBase locally is highly
  257.     recommended since it is in CHIP memory and on systems with FAST
  258.     memory, it will be faster to access the local cached value. (In
  259.     addition to the performance increase when running Enforcer) Note
  260.     that doing many reads of location 4 will hurt interrupt performance.
  261.  
  262.     When the Amiga produces an ALERT, EXEC places some magic numbers
  263.     into some special locations in low memory.  The exact pattern
  264.     changes between versions of the operating system.
  265.  
  266.     Enforcer will patch the EXEC function ColdReboot() in an attempt to
  267.     "get out of the way" when someone tries to reboot the system.
  268.     Enforcer will clean up as much as possible the MMU tables and then
  269.     call the original LVO.  When Enforcer is asked to quit, it will
  270.     check to make sure it can remove itself from this LVO. If it can
  271.     not, it will not quit at that time.  If run from the shell, it will
  272.     display a message saying that it tried but could not exit.  Enforcer
  273.     will continue to be active and you can try later to deactivate it.
  274.  
  275.    68020 NOTES
  276.     The 68020 does not have a built-in MMU but has a co-processor
  277.     feature that lets an external MMU be connected.  Enforcer MMU code
  278.     is designed for use with 68851 MMU.  This is the some-what 68030
  279.     compatible MMU by Motorola.  Enforcer uses the same code for both
  280.     the 68030 and the 68020/68851.  For this reason, 68020/68851 users
  281.     should see the 68030 NOTES section.
  282.  
  283.    68030 NOTES
  284.     The 68030 uses cycle/instruction continuation and will
  285.     supply the data on reads and ignore writes during an access
  286.     fault rather than let the real bus cycle happen.  This means
  287.     that on a fault caused by MMU tables, no bus cycle to the
  288.     fault address will be generated.  (For those of you with analyzers)
  289.  
  290.     In some cases, the 68030 will have advanced the Program Counter
  291.     past the instruction by the time the access fault happens.
  292.     This is usually only on WRITE faults.  For this reason, the PC
  293.     may either point at the instruction that caused the fault or
  294.     just after the instruction that caused the fault.  (Which could
  295.     mean that it is pointing to the middle of the instruction
  296.     that caused the fault.)
  297.  
  298.     Note that there is a processor called 68EC030.  This processor
  299.     has a disabled or defective MMU.  However, it may function well
  300.     enough for Enforcer to think it has a fully functional MMU and
  301.     thus Enforcer will attempt to run.  However, even if it looks like
  302.     the MMU is functioning, it is not fully operational and thus may
  303.     cause strange system activity and even crashes.  Do not assume
  304.     that Enforcer is safe to use on 68EC030 systems.
  305.  
  306.    68040 NOTES
  307.     Enforcer, on the 68040, *requires* that the 68040.library be
  308.     installed and it requires an MMU 68040 CPU.  The 68EC040 does not
  309.     have a MMU.  The 68LC040 does have an MMU and is supported. Enforcer
  310.     will work best in a system with the 68040.library 37.10 or better
  311.     but it does know how to deal with systems that do not have that
  312.     version.
  313.  
  314.     Due to the design of the 68040, Enforcer is required to do a number
  315.     of things differently.  For example, the MMU page size can only be
  316.     either 8K or 4K.  This means that to protect the low 1K of memory,
  317.     Enforcer will end up having to mark the first 4K of memory as
  318.     invalid and emulate the access to the 3K of that memory that is
  319.     valid. For this reason Enforcer moves a number of possible
  320.     structures from the first 4K of memory to higher addresses.  This
  321.     means that the system will continue to run at a reasonable speed.
  322.     The first time Enforcer is run it may need to allocate memory for
  323.     these structures that it will move.  Enforcer can never return this
  324.     memory to the system.
  325.  
  326.     In addition to the fact that the 68040 MMU table size is different,
  327.     the address fault handling is also different.  Namely, the 68040 can
  328.     only rerun the cycle and not continue it like the 68030. This means
  329.     that on a 68040, the page must be made available first and then made
  330.     unavailable.  Make this work, Enforcer will switch the instruction
  331.     that caused the error into trace mode and let it run with a special
  332.     MMU setup.  When the trace exception comes in, the MMU is set up
  333.     back to the way it was.  Enforcer does its best to keep debuggers
  334.     working.  Note, however, that the interrupt level during a trace of
  335.     a READ will end up being set to 7.  This is to prevent interrupts
  336.     from changing the order of trace/MMU table execution.  The level
  337.     will be restored to the original state before continuing.  Since T0
  338.     mode tracing is also supported, there are also some changes in the
  339.     way it operates.  T0 mode tracing is defined, on the 68040, to cause
  340.     a trace whenever the instruction pipeline needed to be reloaded.
  341.     While on the 68020/030 processors this was normally only for the
  342.     branch instructions, in the 68040 this includes a large number of
  343.     other instructions.  (Including NOP!)  Anyway, if an Enforcer hit
  344.     happens while in T0 tracing mode, the trace will happen even on
  345.     instructions that normally would not cause a T0 mode trace.  Since
  346.     this may actually help in debugging and because it was not possible
  347.     to do anything else, this method of operation is deemed acceptable.
  348.  
  349.     Another issue with the 68040 is that WRITE faults happen *after* the
  350.     instruction has executed.  (Except for MOVEM)  In fact, it is common
  351.     for the 68040 to execute one or more extra instructions before the
  352.     WRITE fault is executed.  This design makes the 68040 much faster,
  353.     but it also makes the Program Counter value that Enforcer can report
  354.     for the fault much less likely to be pointing to the instruction
  355.     that caused it.  The worst cases are sequences such as a write fault
  356.     followed by a branch instruction.  In these cases, the branch is
  357.     usually already executed before the write fault happens and thus the
  358.     PC will be pointing to the target of the branch.  There is nothing
  359.     that can be done within Enforcer to help out here.  You will just
  360.     need to be aware of this and deal with it as best as possible.
  361.  
  362.     Along with the above issue, is the fact that since a write fault may
  363.     be delayed, a read fault may happen before the write fault shows up.
  364.     Internally, enforcer does not do special processing for these and
  365.     they will not show up.  Since another hit was happening anyway, it
  366.     is felt that it is best to just not report the hit.  Along the same
  367.     lines, the hit generated from a MOVEM instruction may only show as a
  368.     single hit rather than 1 for each register moved.
  369.  
  370.     On the Amiga, MOVE16 is not supported 100%.  Causing an Enforcer hit
  371.     with a MOVE16 will cause major problems and maybe cause Enforcer or
  372.     your task to lock.  Since MOVE16 is not supported, this is not a
  373.     major issue.  Just watch out if you are using this 68040
  374.     instruction.  (Also, watch out for the 68040 CPU bug with MOVE16)
  375.  
  376.     The functions CachePreDMA(), CachePostDMA(), and CacheControl() are
  377.     patched when the 68040 MMU is turned on by Enforcer.  These
  378.     functions are patched such the issues with DMA and the 68040
  379.     COPYBACK data caches are addressed.  The 68040.library normally
  380.     deals with this, however since Enforcer turns on the MMU, the method
  381.     of dealing with it in the 68040.library will not work. For this
  382.     reason, Enforcer will patch these and implement the required fix for
  383.     when the MMU is on.  When Enforcer is asked to exit, it will check
  384.     if it can remove itself from these functions.  If it can not, it
  385.     will ignore the request to exit.  If Enforcer was run from the CLI,
  386.     it will print a message saying that it can not exit when the attempt
  387.     is made.
  388.  
  389.    SEE ALSO
  390.     "A master's secrets are only as good as the
  391.      master's ability to explain them to others."  -  Michael Sinz
  392.  
  393.    BUGS
  394.     None?
  395.  
  396. LawBreaker                                                         LawBreaker
  397.  
  398.    NAME
  399.     LawBreaker - A quicky test of Enforcer
  400.  
  401.    SYNOPSIS
  402.     This is a quick test of Enforcer and its reporting abilities.
  403.  
  404.    FUNCTION
  405.     This program is used to make sure that Enforcer is correctly
  406.     installed and operating.  LawBreaker works from either the CLI
  407.     or Workbench.  It will try to read and write certain memory
  408.     areas that will cause an Enforcer hit or four.
  409.  
  410.    INPUTS
  411.     Just run it...
  412.  
  413.    RESULTS
  414.     When running Enforcer, you will see some output from Enforcer.
  415.     Output on a 68030 machine would look something like this:
  416.  
  417. WORD-WRITE to  00000000        data=0000       PC: 0783AC6A
  418. USP:  078CAAEC SR: 0004 SW: 0729  (U0)(-)(-)  TCB: 078AADF8
  419. Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  420. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  421. Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  422. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  423. PC-8: AAAA1111 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C00000
  424. PC *: 522E0127 201433FC 400000DF F09A522E 012611C1 01004EAE FF7621C0 0104532E
  425. Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 0000007A
  426.  
  427. LONG-READ from AAAA4444                        PC: 0783AC6E
  428. USP:  078CAAEC SR: 0015 SW: 0749  (U0)(F)(-)  TCB: 078AADF8
  429. Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  430. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  431. Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  432. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  433. PC-8: 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C00000 522E0127
  434. PC *: 201433FC 400000DF F09A522E 012611C1 01004EAE FF7621C0 0104532E 01266C08
  435. Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 0000007E
  436.  
  437. BYTE-WRITE to  00000100        data=11         PC: 0783AC80
  438. USP:  078CAAEC SR: 0010 SW: 0711  (U0)(F)(D)  TCB: 078AADF8
  439. Data: 00000000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  440. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  441. Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  442. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  443. PC-8: 2A7CAAAA 555531C0 0000522E 01272014 33FC4000 00DFF09A 522E0126 11C10100
  444. PC *: 4EAEFF76 21C00104 532E0126 6C0833FC C00000DF F09A201F 66024E75 22404EEE
  445. Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 00000090
  446.  
  447. LONG-WRITE to  00000104        data=00000000   PC: 0783AC88
  448. USP:  078CAAEC SR: 0014 SW: 0709  (U0)(-)(D)  TCB: 078AADF8
  449. Data: 00000000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  450. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  451. Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  452. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  453. PC-8: 0000522E 01272014 33FC4000 00DFF09A 522E0126 11C10100 4EAEFF76 21C00104
  454. PC *: 532E0126 6C0833FC C00000DF F09A201F 66024E75 22404EEE FE860024 5645523A
  455. Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 00000098
  456.  
  457.    NOTES
  458.     If enforcer is not running, the program should not cause the
  459.     system to crash.  It will, however, write to certain areas
  460.     of low memory.  Also, it will cause read access of some
  461.     addresses that may not exist.  This may cause bus faults.
  462.  
  463.    SEE ALSO
  464.     "Quantum Physics:  The Dreams that Stuff is made of." - Michael Sinz
  465.  
  466.    BUGS
  467.     There are 4 known Enforcer hits in this code, however, they
  468.     will not be fixed.  ;^)
  469.  
  470. Move4K                                                                 Move4K
  471.  
  472.    NAME
  473.     Move4K - Moves as much out of the lower 4K of RAM as possible
  474.  
  475.    SYNOPSIS
  476.     On 68040 systems, as much of the lower 4K of CHIP RAM is removed
  477.     from system use.
  478.  
  479.    FUNCTION
  480.     On 68040 systems the MMU page sizes are 4K and 8K.  Enforcer
  481.     uses the 4K page size.  Since watching for hits of low memory
  482.     is a vital part of Enforcer, this means that the first 4K
  483.     of RAM will be marked invalid.  On current systems, only
  484.     the first 1K of RAM is invalid and thus 3K of RAM in that
  485.     first 4K will end up needing to be emulated in Enforcer.
  486.     In order to reduce the overhead that this causes (and the
  487.     major performance loss) this program will try to move as much
  488.     from that first 4K as possible and make any of the free
  489.     memory within the first 4K inaccessible.
  490.  
  491.     Enforcer itself also has this logic, but it may be useful
  492.     to be able to run this program as the first program in
  493.     the Startup-Sequence (*AFTER* SetPatch) to try to limit
  494.     the number of things that may use the lower 4K of RAM.
  495.  
  496.    INPUTS
  497.     Just run it...  Can be run from CLI or Workbench
  498.  
  499.    RESULTS
  500.     Any available memory in the lower 4K of CHIP RAM is removed
  501.     plus a special graphics buffer is moved if it needs to be.
  502.     After running this program you may have a bit less CHIP RAM
  503.     than before.  You can run this program as many times as you
  504.     wish since it only moves things if it needs to.
  505.  
  506.    NOTES
  507.     This program will do nothing on systems without a 68040.
  508.     It does not, however, check for the MMU and thus it will
  509.     move the lower 4K even if the CPU is not able to run Enforcer.
  510.  
  511.     V39 of the operating system already does have the lowest
  512.     MMU page empty and thus this program will effectively do
  513.     nothing under V39.
  514.  
  515.    SEE ALSO
  516.     "Eloquence is vehement simplicity"
  517.  
  518.    BUGS
  519.     None.
  520.  
  521.