www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/12/03:04:36

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Thu, 11 May 1995 13:54:42 BST
Subject: Re: Checking for disk in drive

  Charles Sandmann <sandmann AT praline DOT no DOT NeoSoft DOT com> suggested (Subject: Re:
Checking for disk in drive):-
> Hook the RM Int 24 with a RM procedure which sets AL=3 and does an IRET. Or
> run under DPMI, it automatically does this. Or use the event library from
> libgrx - it automatically turns on this feature inside of GO32.

  Simply making int24 always set AL=3 and exit, would put a pickaxe handle
through much useful default non-disk error handling, e.g. it would stop the PC
from telling you that the printer is out of paper. A book on PC system
programming that I have says that when int24 is called:-
  bit 7 of AH = 0 for "it was a disk/hard disk error", 1 for "it wasn't".
  DI = :-                   0 disk write protected  1 access on unknown device
 2 drive not ready          3 invalid command          4 CRC error
 5 bad request structure length  6 seek error          7 unknown device type
 8 sector not found         9 printer out of paper    10 write error
11 read error              12 general failure
  It should exit with IRET, with AL = : 0 = ignore error, 1 = repeat the
operation, 2 = terminate program with int23, 3 = fail system call. It can only
access AH=1 to AH=0xc functions of int21.
  (1) What is a CRC error?
  (2) My source says that "the error routine restores the SS SP DS ES BX CX DX
registers to the same values that they contained during the call.". Does that
mean that I must make sure that (any int24 routine that I wrote myself) does
not alter those registers?
  (3) What is needed is a way to give the existing int24 routine a prefix,
e.g.:-
     if(DI == 0) {moan that the floppy is write-protected}
     else if(DI==10 ?: DI==11) {moan about bad or missing floppy}
     else {go on to the default int24 routine}
  (4) On floppies, <is> there a track 0 sector 0?
  (5) On floppies, is there a quick way to distinguish PC floppy from Mac
floppy from unformatted floppy?
  (6) At a pinch I can put up with a messed-up screen display (I can usually
rewrite the screen if I have to), but what is absolutely needed is a way of
telling it to abort the failed floppy operation so that control returns to
somewhere in the program and not with an error crash out to DOS.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019