Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!newstop!suntops!hatter.Tops.Sun.COM!rdas From: rdas@hatter.Tops.Sun.COM (Robin Das) Newsgroups: comp.sys.ibm.pc Subject: Re: Dos File Access In TSR's Keywords: TSR DOS Message-ID: <637@suntops.Tops.Sun.COM> Date: 24 Jun 89 00:02:55 GMT References: <157@wbcs.UUCP> Sender: news@suntops.Tops.Sun.COM Reply-To: rdas@hatter.tops.sun.com (Robin Das) Organization: Sun Microsystems, Inc. Mt. View, Ca. Lines: 23 In article <157@wbcs.UUCP> chris@wbcs.UUCP (Chris Rott) writes: >I want to write a TSR program that periodically wakes up and accesses a file >(using DOS services). The purpose of accessing the file is to update the >time stamp. I know how to set up the TSR and to set alarm interrupts and all, >but I suspect I will have problems if I just invoke dos services inside this >interrupt. Has anyone had experience writing these kind of TSR's? Are there >flag bytes somewhere that indicate whether or not DOS is in a 'safe' state in >terms of disk i/o. I know that these kind of programs are possible, given that >the print queue manager provides asynchronous i/o, but I cant find any docs on >how to do it. Any help would be greatly appreciated! Please email responses. >Thanks in advance for your help. Before your TSR calls DOS (and don't use the standard library calls -- call the interrupt directly), check the DOS BUSY flag. If it is set, return control to the program running before your TSR got control. If it is not set, you will be all set to make DOS calls. Here is how you get the address of the DOS BUSY flag: mov ah, 34h int 21h es:bx contains the address of the DOS BUSY flag. If it is '0', DOS can be called.