Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!emory!hubcap!ncrcae!usceast!reed From: reed@usceast.UUCP (Patrick Reed) Newsgroups: comp.lang.c Subject: Re: Help:Test if drive is ready in Turbo C Keywords: c, turbo, help, drive, floppy, disk, ready, function Message-ID: <3265@usceast.UUCP> Date: 27 May 90 04:44:41 GMT References: <265ccb97-287comp.lang.c@vpnet.chi.il.us> Organization: University of South Carolina, Columbia Lines: 35 In article <265ccb97-287comp.lang.c@vpnet.chi.il.us> kji@vpnet.chi.il.us (Ken Isacson) writes: > >Can anyone out there suggest some code in TURBO C that would do the >following: > > 1. Detect if drive is ready with a disk. > [ stuff deleted about int 13 failing to handle the problem ] I have been faced with this problem in the past using Turbo C 1.5. What you need is to establish your own hardware interrupt handler. Turbo C provides some routines that may help: harderr - establish a hardware error handler hardresume - return to DOS from error handler hardretn - return to application form error handler Look in your reference manual for an example that covers this very problem. It's been several years since I worked in this area, but from what I remember there are a few problems: 1. From within your error handler routine, you can only use dos calls 1 through 0x0c, which means printf and the like are out. This may be ok for you if all you want to do is print a message in a box or something and you are sending your output to the video RAM (ie. not using the ROM BIOS calls). 2. I seem to remember having some portability problems. Having made the program detect the door being open on my machine and then testing it on some other machines, there seemed to be some inconsistent results. Let me know if any of this helps. Pat Reed reed@usceast.cs.scarolina.edu