Short:    Protect free memory. 040/3.x needed.
Author:   Børge Nøst <borgen@icenet.no / bn.f1901.adir@gmail.gar.no>
Uploader: borgen@icenet.no
Type:     dev/debug


Full program name: Guardian Angel Remix.

This program will protect all free pages in memory. It requires a 68040 and
KickStart 3.0/3.1 (versions prior to these will not work - sorry), and also
needs SetPatch and Enforcer to be run before it is started. Only works with
4K page size.

You will not find much use in it unless Enforcer has been started too.
This version will not function properly if you quit Enforcer after GAR has
been started. (Your machine will crash if you do.)
(In short: Start SetPatch, start Enforcer, start GAR.)

To test that it is working you can use a monitor (like Amiga Monitor 1.65 by
Timo Rossi) and do a little memory dump to screen from an address you know to
be free. You should now get Enforcer hits that says memory was read at
somesuch address.

If a program reads or writes to pages in memory that are completely free you
will get a hit message from Enforcer.

Hope you find this utility useful.


The directory names have the following meaning:
No_Write	Writing to free memory shows an Enforcer hit
No_Read		Writing _and_ reading to free memory shows an Enforcer hit
MungMem		Memory is filled with $DEADF00D before Alloc#?() returns
Scratch		Scratch registers are set to $BADBAD00 when the patched OS
		calls return.
Combine these names to see what effect the different binaries gives.
I use the No_Read-MungMem-Scratch combination myself.


Guardian Angel Remix is a ShareWare program as ShareWare was once defined:
You get the complete uncrippled(sp?) program and you're only asked to pay
the author if you find it useful.
I would be happy to receive $5 if you find GAR worth using. If you like you
might send paper notes in your local currency, a box of chocolate, an old
original game for the C= 64 or the Amiga, a registered version of your own
ShareWare program, a nice techno/house/jungle CD, a box of blank disks, a DAT
tape, or an Amiga CD.


(Here follows some comments from the source:)
*******************************************************************************
*******************************************************************************
*******************************************************************************
*******									*******
*******	Guardian Angel Remix						*******
*******									*******
*******	Once upon a time a long long ago, there was this utility called	*******
*******	"Guardian Angel". A few had heard of it, some had seen it, but	*******
*******	none could make it work (or so the story goes). This fabled	*******
*******	program was said to protect your free memory so that you could	*******
*******	trap your nasty errors. As destiny would happen, I got a copy	*******
*******	of this program, and lo and behold, it seemed such a nice idea,	*******
*******	but the implementation left a lot to be desired: It was 68020/	*******
*******	68030 only, used 256 bytes page size, rounded all allocations 	*******
*******	up to a multiple of 256, and allocated the largest free chunk	*******
*******	of memory to be your new memory that could be alloacted from.	*******
*******	Enter the time machine and warp forwards to the year 1994 where	*******
*******	the CyberStorm060 card is released. Because Enforcer doesn't	*******
*******	work with the 68060, the utility "CyberGuard" is shipped with	*******
*******	it. Imagine the surprise when it is discovered to have a	*******
*******	"guard" option. Yes, the Guardian Angel is back in a new	*******
*******	disguise. A new implementation, but it still aims to protect	*******
*******	your free memory. And this time it works! Only oh-so-slowly.	*******
*******	However, some of us (well, at least me) are willing to trade	*******
*******	compatability with solutions that works well enough to be used	*******
*******	today. This is my story of how I stole the OS code and added a	*******
*******	little of my own sparkle. Enjoy (or frustrate as may be if you	*******
*******	find new bugs in your programs :-).				*******
*******									*******
*******	Going with the times I have chosen to call it			*******
*******	"Guardian Angel Remix" and here it is:				*******
*******									*******
*******************************************************************************
*******************************************************************************
*******************************************************************************

;||
;|| Credits:
;||
;|| Thanks must go to Valentin Pepelea for the original Guardin Angel program
;|| and idea.
;|| Thanks also to Ralph Schmidt for implementing the 'guard' option in
;|| CyberGuard that made me think about this again. Thanks for the piece of
;|| code I used too.
;||
;|| Note that much of the patched code is copyright Amiga Technologies.
;|| I hope I can be allowed this as fair use in an example.
;||
;|| All other code, ideas, and implementation issues are my copyright.
;|| This program is allowed to be copied if no money is charged for the
;|| service, or in any other ways the receiver has to pay for it.
;|| AmiNet and Fred Fish have the permission to distribute this in their CD-ROM
;|| compilations.
;|| Commercial parties are encouraged to contact me for distribution rights.
;||
;||
;|| Børge Nøst, Safirveien 5, N-9022 Krokelvdalen, Norway
;|| bn.f1901.adir@gmail.gar.no
;||


;\\\\\\\\\\\\\
;\
;\  Incompatible programs found so far (using DEADLY versjon):
;\
;\  Term 4.5. Crashes on exit. Non-fatal. (Known to crash on exit on other
;\  machines not running GAR.) 'serial.device' stays in use.
;\  MungWall. This was expected and a calculated loss. Fatal.
;\  ARTM (probably). Expected to happen when 4K aligned header is found. Non-fatal.
;\  Virus Checker 7.18. Later versions gave me Enforcer hits anyway, but this
;\  version shows major problems with memory handling.


; allocations that live in parts of a page will not give hits when freed if
; there are other alloactions in the same page.
; this can be fixed by rounding up allocation size to a multiple of the page
; size and align the allocated addresses to page boundaries, but this will
; probably cost a _lot_ of memory

