Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!b.gp.cs.cmu.edu!Ralf.Brown@B.GP.CS.CMU.EDU From: Ralf.Brown@B.GP.CS.CMU.EDU Newsgroups: comp.sys.ibm.pc Subject: Re: Dos File Access In TSR's Message-ID: <24a2448a@ralf> Date: 23 Jun 89 14:09:14 GMT Sender: ralf@b.gp.cs.cmu.edu Organization: Carnegie Mellon University School of Computer Science Lines: 62 In-Reply-To: <8064@saturn.ucsc.edu> In article <8064@saturn.ucsc.edu>, lance@helios (Lance Bresee) writes: }Isn't there a dos routine which sets the date stamp on a file? Yes. }If so, you can get this vector, and have your tsr execute a far jump.. }and the end of the routine, there will be an iret instruction, so }dos will jump back to the application rather than back to your }tsr..... Doesn't work that way. The DOS function call INT 21h does the following: setup indirect call to actual function handler function executes RET cleanup IRET Besides, DOS is not reentrant, so you couldn't just call or jump to the appropriate routine without first making sure that it is safe to call DOS. If you do that, you might as well just call DOS normally once you are sure it is safe. }Also, I believe that the interrupt hierarchy makes it impossible to }interrupt a disk read...you may want to check on this though..... Nope, disk reads/writes can be interrupted. For a floppy disk or XT hard drive, the basic sequence of events is seek to proper track, if necessary set up floppy controller set up DMA controller clear completion flag start DMA transfer loop until completion flag set loop until completion flag set loop until completion flag set DISK INTERRUPT: handler sets completion flag loop until completion flag set: loop terminates IRET During this entire time, interrupts are enabled (have to be to allow the disk interrupt). The disk interrupt is not even at a very high priority. The floppy interrupt is IRQ6, and the XT hard drive is IRQ5. The only thing with a lower priority is the printer interrupt on IRQ7. For an AT hard drive, the basic sequence of events is seek to proper track, if necessary set up HD controller REP INSW or REP OUTSW <- transfer data using the CPU IRET Again, interrupts are enabled during the process. DESQview 2.2 has no problems task-switching during heavy floppy access, such as a large file copy or format. Previous versions did not task switch during floppy access, but that appears to have been a design decision (there is a poorly-documented flag for DV 2.2 to disable task-switching during disk accesses). -- UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=-=-=- Voice: (412) 268-3053 (school) ARPA: ralf@cs.cmu.edu BIT: ralf%cs.cmu.edu@CMUCCVMA FIDO: Ralf Brown 1:129/46 Disclaimer? I claimed something? "When things start going your way, it's usually because you stopped going the wrong way down a one-way street."