Article View: comp.os.msdos.programmer
Article #318Re: Saving a file to disk during an interrupt routine
From: Jon K. Salmon
Date: Sat, 08 Aug 1992 08:22
Date: Sat, 08 Aug 1992 08:22
23 lines
1606 bytes
1606 bytes
Sam Shim writes: > I'm doing some C programming using interrupts and I was wondering if > it's possible to have a program save data from within a interrupt > routine or if it is not possible due to the non re-entrant nature of DOS. Oh, it's POSSIBLE all right. It requires that your interrupt handlers take DOS' non-re-entrant nature into account. It is possible to detect in your handlers when DOS is "safe" to be interrupted for disk I/O. You will likely need to look to assembly for help here. I would recommend the article in Microsoft System Journal, v7n1. It covers TEMPLATE.ASM, a DOS-safe TSR by Douglas Boling. Beware: I have found MANY mistakes in the code. However, it is STILL a source of much good information. Alternatively, you might consider a "save" function which is able to save small portions of the data, based on parameters or static data or something, then, say, in an idle loop while waiting for input, this routine could be called to perform the save in parts. This method, of course, may not be feasible depending upon your program flow, etc. -- Jon
Technical Details
Message-ID:
<1992Aug8.082245.14746@news.ysu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!news.ysu.edu!do-not-reply-to-pathShow Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!news.ysu.edu!do-not-reply-to-path From: af458@yfn.ysu.edu (Jon K. Salmon) Subject: Re: Saving a file to disk during an interrupt routine Message-ID: <1992Aug8.082245.14746@news.ysu.edu> Sender: news@news.ysu.edu (Usenet News Admin) Nntp-Posting-Host: yfn Organization: Youngstown State University/Youngstown Free-Net Date: Sat, 8 Aug 1992 08:22:45 GMT Lines: 23