[comp.sys.apple] GS: Restarting from RAM; StdFile problems

AWCTTYPA@UIAMVS.BITNET ("David A. Lyons") (10/18/88)

>Date:         Mon, 17 Oct 88 18:53:04 GMT
>From:         Andy McFadden
>              <agate!web-3d.berkeley.edu!c60c-3aw@LABREA.STANFORD.EDU>
>Subject:      ProDOS 16 & SHRConvert 2.1

>1. (the familiar outline format) I tried using SHRConvert v2.1 yesterday.
>   Everything seemed normal; I exited SHRConv, returned to the launcher (I
>   don't like to wait for the finder), and then restarted SHRConvert.
>
>   It had been saved in memory.  The disk wasn't accessed; it just started
>   back up, with the options right where they had been.  [...]
>
>   This raises some interesting questions like:
>   a. How was it retained?

The System Loader (toolset number $11, documented in the ProDOS 16 and GS/OS
manuals) takes care of it.  When an application quits, there are two options
it may specify.  One of them is "you can restart me from memory if you want."
In this case the Loader does appropriate housekeeping to leave the program's
code segments in memory but purgable.  (The other option is "return to ME
when the next application quits", and this is used in combination with a
pathname specifying the next program to run.  Programs like Finder, Launcher,
APW, ECP16, and Davex 16 [under development] use this option when appropriate.)

>   b. What is the purge level of the allocated memory?

Three.  This purge level is reserved for use by the Loader.

>   c. How did ProDOS 16 v1.6 know that it was still in memory?

ProDOS didn't, but the Loader did.  The ProDOS QUIT call (which was used by
the Finder to request that SHRCONVERT be the next application launched) called
PQUIT (the ProDOS Quit handler), which then [in essense if not in detail]
asked the Loader to Restart the application from memory.  If this attempt to
restart had failed, PQUIT would have proceeded to InitialLoad the program
from disk.

If you have a utility like Nifty List (Shareware, by me, $15), you can type
0i to see a list of all the allocated memory blocks along with their
attributes (including purge levels) and their pathnames (when known to the
Loader).

>2. Here's a possible bug in ProDOS/Standard File Operations toolset:
>
>   While I was running SHRConvert above, I let it load, switched disks, and
>   hit the "load" button.  I was then allowed to select shaded items from
>   the file list, but was forced to skip over some files (including a couple
>   of subdirectories).

Since Standard File does *not* normally do that, my first guess is that
the Standard File toolset (RAM based, by the way) had been garbled by some
other program (*possibly* SHRCONVERT; possibly a desk accessory; possibly
some other bug in something).  Or, maybe there is a legit. bug in Standard
file that shows up, for example, under low-memory conditions.  (Any idea
how much RAM was free at the time?  I can send you a Free RAM desk accessory
if it will help.)

>fadden@zen.berkeley.edu [crashed]
>c60c-3aw@widow.berkeley.edu (Andy McFadden)

--David A. Lyons              bitnet: awcttypa@uiamvs
  DAL Systems                 CompuServe:  72177,3233
  P.O. Box 287                GEnie mail:    D.LYONS2
  North Liberty, IA 52317     AppleLinkPE: Dave Lyons