Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!cbatt!cwruecmp!bammi
From: bammi@cwruecmp.UUCP (Jwahar R. Bammi)
Newsgroups: comp.sys.atari.st
Subject: Re: Two questions about TOS
Message-ID: <1817@cwruecmp.UUCP>
Date: Tue, 13-Jan-87 02:51:50 EST
Article-I.D.: cwruecmp.1817
Posted: Tue Jan 13 02:51:50 1987
Date-Received: Wed, 14-Jan-87 00:54:37 EST
References: <1973@batcomputer.tn.cornell.edu>
Reply-To: bammi@cwruecmp.UUCP (Jwahar R. Bammi)
Organization: CWRU Dept. Comp. Eng., Cleveland OH
Lines: 45

In article <1973@batcomputer.tn.cornell.edu> braner@batcomputer.UUCP (braner) writes:
>[]
>
>Two questions about TOS/GEM/???
>
>A program I am writing reads and writes disk sectors using the BIOS call
>Rwabs().  It is a .TOS program: no GEM graphics.  I am using a 1040ST with
>its one disk drive.  I am accessing both "logical" drives A and B.
>I ran the same program from micro-C-Shell and from the desktop.  In the
>first case, GEM dialog boxes appeared, asking me to "insert disk B in
>drive A" and such.  In the second case they did not, and I got NO WARNING
>from the system about when to insert which disk.
>
>The question: Since GEM is supposed to call GEMDOS, and not the other
>way around (says my brand new Balma and Fitler book), where do those
>dialog boxes come from?  Are they due to some initiative of mCS?  It
>seems paradoxical that from the desktop (a GEM environment) they are
>absent (in this case) while in mCS (a TOS text-only environment) they
>appear.  How can I make them appear, or in any other way get automatic
>disk-swap user-directives?

	Those dialog boxes are certainly coming from mCsh. Internally,
Gemdos generates a "insert-disk" critical error whenever you address
the 'other' logical drive on a 1 drive system. The Gemdos error number for
"insert disk" is -17. Critical errors invoke the critical error handler
(at vector 0x101). The first word on the stack (at 4(sp)) is the error
number (in this case -17)) and additional info about the error are
stacked  on words on top of that (6(sp) and up). In the case of the
"insert-disk" critical error, the word at 6(sp) contains the virtual device
number (0 or 1). The critical error handler must return with one of the
following in D0.L

 0x00010000  to retry operation that caused crit error
 0x00000000  to ignore the error
 0xffffffXX  to abort with an error

As usual, the handle must preserve the C non-volatile registers (D3/D7,A3-A6).

	The default handler is obviously just aborting the condition, and that
why you don't get the dialog or some kind of warning.
-- 
usenet: .....!decvax!cwruecmp!bammi		jwahar r. bammi
csnet:       bammi@case
arpa:        bammi%case@csnet-relay
compuServe:  71515,155