Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site cognos.UUCP Path: utzoo!dciem!nrcaer!cognos!brianc From: brianc@cognos.UUCP (Brian Campbell) Newsgroups: comp.sys.ibm.pc Subject: Re: Dos Calls and Interrupts Message-ID: <323@cognos.UUCP> Date: Fri, 23-Jan-87 09:53:28 EST Article-I.D.: cognos.323 Posted: Fri Jan 23 09:53:28 1987 Date-Received: Sat, 24-Jan-87 09:55:06 EST References: <216700005@orstcs.UUCP> <115@interlan.UUCP> <1501@cit-vax.Caltech.Edu> Reply-To: brianc@cognos.UUCP (Brian Campbell) Organization: Cognos Inc., Ottawa, Canada Lines: 40 Summary: In article <1501@cit-vax.Caltech.Edu> tim@tomcat.caltech.edu (Tim Kay) writes: >> >> Calling DOS from an ISR can be done safely; its tricky, and there >> are a number of things to be taken into account. However, you must >> use undocumented DOS calls to do so. >> >> [description of how to do it deleted] > >I wonder if a ^C handler could be written that would kill the current >program even if the program isn't doing any dos calls. > >Currently, if you hit ^Break or ^C, a bit is set. Then when you call >dos, it checks the bit. If set, the ^C handler is called, and your >program (by default) is terminated. The problem is that many programs >don't make dos calls, and they can't be killed. For example, if you >are running a Turbo Pascal program that gets into an infinite loop, >you have to reboot the machine. (I know that there is a {$U+} switch, >but this makes the program run slower, so I would rather not use it. >My C compiler doesn't have the equivalent of {$U+}.) > >Would it be possible to write a TSR program that notices when ^C is >hit and sets a bit. >The next time a clock interrupt happens (as described in the article), >both this bit and the dirty bit are checked. If ^C has been hit, and >it is safe to call dos, then the handler should issue a dos terminate >call to terminate the interrupted program. I believe that there is such a TSR utility. It was presented in one of the earlier issues of PC-Magazine last year. I think it was called UNCRASH. The idea was that hitting Ctrl-Break once would function as always, hitting it twice did something further, and hitting it three times would get you out of just about anything (including a JMP $+0) and terminate the program. I think it was implemented using the keyboard interrupt, but I'm not sure on that. If necessary, I can dig out the issue and either post or email the code (assuming I'm not breaking any copyrights Ziff-Davis may have). Brian Campbell