[comp.sys.atari.st] RAM locations for safe use

uace0@uhnix2.UUCP (Univ ATARI Comp Enthusiasts) (05/18/87)

In response to Moshe Braner's questions concerning a safe place in memory, I can
only think of one location that is safe.  Actually, it is a series of a few
longwords that are only safe until the system crashes.  That's right, the 
register save area used after a crash.  As far as I know, these memory locations
are only used on a system crash, so should be free to use while the system is
operating normally.

- Mike

-- 
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<
+  And to think, I don't get paid for this!   +
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<

apratt@atari.UUCP (05/26/87)

in article <381@uhnix2.UUCP>, uace0@uhnix2.UUCP (Univ ATARI Comp
Enthusiasts) says:
> 
> In response to Moshe Braner's questions concerning a safe place in
> memory, I can only think of one location that is safe.  Actually, it is
> a series of a few longwords that are only safe until the system crashes. 
> That's right, the register save area used after a crash.  As far as I
> know, these memory locations are only used on a system crash, so should
> be free to use while the system is operating normally. 
> 
> - Mike

This turns out not to be the case.

The "bomb handler" gets control from a bus error, address error, etc.
It puts bombs on the screen, DUMPS INFO INTO THE REGISTER SAVE AREA,
then attempts a Pterm0() for the current process.  This often
works: a simple program dereferencing a null (zero) pointer will
give bombs and terminate normally.  

The times when bombs combine with a total system crash are times when a
Pterm0() can't get rid of the offending program: for instance, a rogue
interrupt handler, or trashed internal GEMDOS state. 

In any case, the register save area of memory is overwritten by
any bombs, not just the ones resulting in a total crash.  If you
want a safe place in memory, use your own BSS and execute Ptermres()
to leave your program.  If you want someplace that'll survive a reset,
I can't think of a reliable one.

/----------------------------------------------\
| Opinions expressed above do not necessarily  |  -- Allan Pratt, Atari Corp.
| reflect those of Atari Corp. or anyone else. |     ...lll-lcc!atari!apratt
\----------------------------------------------/

jack@mcvax.UUCP (05/28/87)

I've been using the unused vectors at location $100 or thereabout
(sorry, don't have the code handy. They're just above the critical
error vector) as 'safe' location.

From the HHG, I understood that these weren't used.

Is this correct, or not?
-- 
	Jack Jansen, jack@cwi.nl (or jack@mcvax.uucp)
	The shell is my oyster.

uace0@uhnix2.UUCP (05/30/87)

In article <738@atari.UUCP>, apratt@atari.UUCP (Allan Pratt) writes:
> in article <381@uhnix2.UUCP>, uace0@uhnix2.UUCP (Univ ATARI Comp
> Enthusiasts) says:
> > 
> > In response to Moshe Braner's questions concerning a safe place in
> > memory, I can only think of one location that is safe.  Actually, it is
> > a series of a few longwords that are only safe until the system crashes. 
> > That's right, the register save area used after a crash.  As far as I
> > know, these memory locations are only used on a system crash, so should
> > be free to use while the system is operating normally. 
> > 
> > - Mike
> 
> This turns out not to be the case.
> 
> In any case, the register save area of memory is overwritten by
> any bombs, not just the ones resulting in a total crash.  If you
> want a safe place in memory, use your own BSS and execute Ptermres()
> to leave your program.  If you want someplace that'll survive a reset,
> I can't think of a reliable one.

True, but consider this:

If the application you are running is communicating to another process, and it
dies (bombs out) can you consider that the info it writes is valid?  I would
think not.  If you are able to start the process up again, then it will write
over the bomb info and then the location works.  If the system does not crash,
(why should it :-)) then they will work, and remain untouched.  If something
bombs, I would think that the protocol is not working anyway, right?

I imagine it really depends on whether or not the communicating processes know
when the other is active.  And given that the person can write programs that do
not bomb, then I think the locations would work, without taking up any more ram.


The opinions expressed do not necessarily reflect those of Allan Pratt.
But then why should they?  :-)
I hate disclaimers... (I disclaim that)

- Mike Vederman


>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<
+  And to think, I don't get paid for this!   +
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<
-- 
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<
+  And to think, I don't get paid for this!   +
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<