[net.micro.pc] DOS PROMPT command and disk drive

andrew@alberta.UUCP (Andrew Folkins) (06/14/85)

I was trying out the fancy prompt distributed on the net a while ago and
found something a bit unusual.  Normally, when changing disk drives (in
my case from hard disk c: to floppy a:) the only noticeable change is the
prompt, the floppy drive itself is not activated.  This occurs with 
the prompt set to '$e33;40m$n$g'.
 
The problem showed up with the prompt : 
 
  $e[33;40m$e[s$e[0;0H$p    $d    $t$e[K$e[u$n$g
 
  set color|save cursor position|home|display directory, date, time|erase
  to end of line|restore cursor position|display drive>
 
With this prompt, the command 'a:' activates the floppy drive.  When, by
mistake, I did this with no floppy in the drive, the cursor homed, and the
'drive not ready' message printed. Upon entering 'a' for abort, the cursor
homed again while the drive spun some more, then the 'drive not ready'
message was repeated.  The only way to get out of the loop was to
reset the machine. 
 
I understand the disk access, the prompt requires the current directory.
But why doesn't the abort work when the drive is not ready? It seems that
the drive error routine that produces this message only takes one character
from the keyboard, so how is the prompt screwing this up? This is inside a
DOS routine, the prompt shouldn't have anything to do with it! Is ansi.sys
doing weird things?

-- 
Andrew Folkins
ihnp4!alberta!andrew
 
Underlying Principle of Socio-Genetics : 
       Superiority is recessive.

roy@gitpyr.UUCP (Roy Mongiovi) (06/14/85)

> With this prompt, the command 'a:' activates the floppy drive.  When, by
> mistake, I did this with no floppy in the drive, the cursor homed, and the
> 'drive not ready' message printed. Upon entering 'a' for abort, the cursor
> homed again while the drive spun some more, then the 'drive not ready'
> message was repeated.  The only way to get out of the loop was to
> reset the machine. 

The problem is indeed caused by DOS trying to determine the current directory.
Since IBM in its infinite wisdom decided not to put a door sensor on the PC or
the XT, DOS cannot determine if the media has been changed.  When DOS tries to
determine the current directory string, the device driver return an indication
that it doesn't know if the media has been changed or not, so DOS has to go
read the drive to see if the current directory still exists.  This causes your
disk access and the associated problems.  Hitting the "a" key to abort tries
immediately to generate another prompt, and the cycle repeats.  To get around
the problem without rebooting the machine (and this works ONLY on PC-DOS, the
generic MS-DOS seems to blow it, at least on the Victor 9000) use the "i" key
to ignore the error.  DOS will think that the current directory no longer
exists (I.E. the media has changed), and will put you back in the root
directory and give you your prompt.  On a Victor 9000, the cycle continues
even though the error is ignored, and you HAVE to put a diskette in the
drive.  This may be caused by the Victor 9000 drivers having knowledge of
media being changed since they had the wisdom to put in drive door sensors.
-- 
Roy J. Mongiovi.	Office of Computing Services.		User Services.
Georgia Institute of Technology.	Atlanta GA  30332.	(404) 894-6163
 ...!{akgua, allegra, amd, hplabs, ihnp4, masscomp, ut-ngp}!gatech!gitpyr!roy

			The Map is Not the Territory

jmsellens@watmath.UUCP (John M Sellens) (06/15/85)

Question was: why does my prompt loop when it can't get the drive for my
prompt and force me to reset ... (well, you get the general idea).

Think: What does DOS do after you answer 'a' for abort when it can't
access a disk?  It displays your prompt, right?  And what does it have
to do to display your prompt?  It has to access the disk ...

metcalf@ucbmiro.ARPA (Chris Metcalf) (06/15/85)

In article <547@alberta.UUCP> andrew@alberta.UUCP (Andrew Folkins) writes:
>I was trying out the fancy prompt distributed on the net a while ago and
>found something a bit unusual.  ... The problem showed up with the prompt :
> 
>  set color|save cursor position|home|display directory, date, time|erase
>  to end of line|restore cursor position|display drive>
> 
>With this prompt, the command 'a:' activates the floppy drive.  When, by
>mistake, I did this with no floppy in the drive, the cursor homed, and the
>'drive not ready' message printed. Upon entering 'a' for abort, the cursor
>homed again while the drive spun some more, then the 'drive not ready'
>message was repeated.  The only way to get out of the loop was to
>reset the machine. 

The problem is one you can always encounter with MS-DOS prompting with
the current directory.  When there's no disk in the drive, MS-DOS (obviously)
can't find the current directory.  When you abort from the error message,
what is the first thing MS-DOS does?  It gives you the prompt.  But you're
prompting with the current directory, so MS-DOS reports an error ... 
(continue ad nauseum).

This is not a problem unique to ANSI.SYS or even MS-DOS.  As far as I know,
the easiest way out of such a problem is to stick a disk in the drive.

	Chris Metcalf
	ARPA: metcalf@ucbmiro.BERKELEY
	USENET: ...!ucbvax!ucbmiro!metcalf

cck@cucca.UUCP (Charlie C. Kim) (06/17/85)

Do "ignore" instead of "abort".

Charlie C. Kim
User Services

rsellens@watdcsu.UUCP (Rick Sellens - Mech. Eng.) (06/17/85)

In article <547@alberta.UUCP> andrew@alberta.UUCP (Andrew Folkins) writes:

>With this prompt, the command 'a:' activates the floppy drive.  When, by
>mistake, I did this with no floppy in the drive, the cursor homed, and the
>'drive not ready' message printed. Upon entering 'a' for abort, the cursor
>homed again while the drive spun some more, then the 'drive not ready'
>message was repeated.  The only way to get out of the loop was to
>reset the machine. 
> 

It seems to me that when you abort, DOS quits the current operation and
returns you to the command line........which requires that the prompt be
run again...and again...and again............


Rick Sellens
UUCP:  watmath!watdcsu!rsellens
CSNET: rsellens%watdcsu@waterloo.csnet
ARPA:  rsellens%watdcsu%waterloo.csnet@csnet-relay.arpa

pier@ur-univax.UUCP (06/17/85)

I am the one who posted the fancy prompt. It is true that if you switch to A:  
you run into problem if drive A: is empty. Any response to the prompt "Abort
Retry, Ignore " won't do. The only thing to do is to stick a diskette in the drive. 


Pierre Darmon
Univerity of Rochester

{allegra|decvax|seismo}!rochester!ur-univax!pier

cck@columbia.UUCP (Charlie C. Kim) (06/17/85)

If you type "ignore" to the "Abort, Retry, or Ignore?" prompt, DOS will
replace the current drive with the message "Current drive is no longer
valid".  It doesn't seem to be stupid enough to try to find the
directory after it finds that the drive is invalid.  At this point, you
can switch to a valid drive.

Charlie C. Kim
User Services
Center for Computing Activities