[comp.sys.atari.st] Fix for ETERNAL to work on Mega STs

VBRANDT@DBNUAMA1.BITNET (05/11/88)

I recently posted an enquiry to this newsgroup concerning my problems running
Turtle and TurboDOS om my Mega ST 4. As an aside, I mentioned that I was able
to fix ETERNAL to run with 4 MB.

Several (in fact, two ;-) people emailed me asking what the fix for ETERNAL
was. Since this might be interesting for other people also, I decided to post
it here. Please do not hesitate to correct me if I'm wrong. Here's my view of
what happens:

One of the few differences in hardware between the 'regular ST' and the 'Mega'
is the behavior of the system when a non-existant memory location is read.
Remember that the ST 'MMU' can handle up to 4 MB RAM. Trying to read a non-
existing memory location that is below 4 MB merely returned garbage data (I
think it was a constant but I don't remember which) on the 'old' ST. Doing this
on a Mega gives you a bus error (two bombs).

The system variable '_phystop' points to the first non-existant memory location
(on a 1040 ST, to $10000 = 1 MB). This value is decreased by ETERNAL to protect
the RAM disk area. The RAM disk effectively pretends to 'just not be there'.
Therefore, after installing ETERNAL,  _phystop points to the first word of the
RAM disk area. This word is the start of the RAM disk BPB and contains $200
(sector length in bytes).

When starting ETERNAL, the program determines if it is already installed by
simply reading the first non-existant memory word and checking if that turns
out to be $200. If it doesn't, ETERNAL installs itself. If it does, ETERNAL
just tweaks the three hard disk vectors to point to the RAM disk driver which
it assumes to be there.

On a Mega ST, the attempt to determine if ETERNAL is resident results in --
you guessed it -- a bus error. What I've done is to check if _phystop is
exactly 4 MB -- ETERNAL can't be installed then, right ?   This makes my
version of ETERNAL work with the old STs and with a Mega 4. I'm not sure what
to do about a Mega 2. Checking for exactly 2 MB won't do: suppose you have
a resident utility using up exactly 2 MB on a Mega 4. What should ETERNAL do
in that case ?

I've also changed the installation procedure:  my configuration utility now
modifies the executable directly, thus eliminating the need for a separate
read-in of the data file ("\AUTO\RAMDISK.DAT") and speeding up the boot process
a little. A possible solution would be to add an option to the configuration
program allowing Mega users to specify their memory size (2 or 4 MB) that
_phystop is checked against.

Other improvements I'm planning to add are:

   - displaying a message stating drive identifer and disk size, and whether
     it's a first-time installation or a restart
   - setting up a complete boot sector so that disk editors, unerase utilities
     and the like have a better chance to work on the RAM disk
   - incorporating the resident driver into the boot sector, thus saving the
     grand total of 512 bytes (wow!)

If anyone's interested in my ETERNAL, email me. If there are enough people
who want it, I'll post it (the improvements will take a while yet ;-).

Bitnet:  VBRANDT@DBNUAMA1                              Volker A. Brandt
UUCP:    ...!unido!DBNUAMA1.bitnet!vbrandt (?)         Angewandte Mathematik
ARPAnet: VBRANDT%DBNUAMA1@CUNYVM.CUNY.EDU (?)          (Bonn, West Germany)

R_Tim_Coslet@cup.portal.com (05/13/88)

In message: <8805101853.AA24225@ucbvax.Berkeley.EDU> 
	VBRANDT@DBNUAMA1.BITNET writes:
>I recently posted an enquiry to this newsgroup concerning my problems running
>Turtle and TurboDOS om my Mega ST 4. As an aside, I mentioned that I was able
>to fix ETERNAL to run with 4 MB.
	[...]
>On a Mega ST, the attempt to determine if ETERNAL is resident results in --
>you guessed it -- a bus error. What I've done is to check if _phystop is
>exactly 4 MB -- ETERNAL can't be installed then, right ?   This makes my
>version of ETERNAL work with the old STs and with a Mega 4. I'm not sure what
>to do about a Mega 2. Checking for exactly 2 MB won't do: suppose you have
>a resident utility using up exactly 2 MB on a Mega 4. What should ETERNAL do
>in that case ?
	[...]

I am running ETERNAL right now (and have been running it for > 3 months)
on a MEGA ST2 with no problems. I don't think you need to worry about
"fixing" ETERNAL on the Mega 2.

					R. Tim Coslet

Usenet:	R_Tim_Coslet@cup.portal.com
BIX:	r.tim_coslet

uace0@uhnix2.uh.edu (Michael B. Vederman) (05/16/88)

Actually, the only problem for the Megas is with the Mega 4.  Since the ST can
only address up to 4 meg, if you try to access above that, you get a bomb.  On
a Mega 2, you are not breaking that limit, so you can safely test above 2 meg
and not get a bomb.  The simple test for exactly 4 meg is the proper solution.

- Mike
-- 
for (;;)                              : Use ATARINET, send an interactive
        do_it(c_programmers);         : message such as:
                                      : Tell UH-INFO at UHUPVM1 ATARINET HELP
University Atari Computer Enthusiasts : University of Houston UACE