[net.micro.pc] Non-pausing disk IO

kvetter@dartvax.UUCP (Keith Vetter) (06/28/85)

I'm new to using a PC and am writing an application where it
would be nice to do disk IO without pausing.  [Set aside a buffer
area, initiate the read and return control and get interrupted when
a character is ready to be read.]
 
I don't know enough of the PC interrupts yet to do this.  Can someone
else out there enlighten me?  Thanks
 
     Keith Vetter
     Dartmouth Colleget

andy@sdcarl.UUCP (Andrew Voelkel) (06/28/85)

I too have wondered about this and have had success with the following
experiment:
	I have a Midi processing box that interrupts the host if told to
do so. The service routine does a bunch of parsing and then calls a C
routine which increments a global variable. This is a fair amount of
overhead. What I have done is fire up a fprintf loop out to a file
and then let the hardware interrupts fire away. My initial experiment
worked, but I don't know if I am playing with fire. My experiment was
writing to hard disk. Anyone know anything more about this?


-- 
	Andrew Voelkel
	{ucbvax,ihnp4,akgua,hplabs,sdcsvax}!sdcarl!andy

johnl@ima.UUCP (06/30/85)

> /* Written  6:36 pm  Jun 27, 1985 by kvetter@dartvax in ima:net.micro.pc */
> I'm new to using a PC and am writing an application where it
> would be nice to do disk IO without pausing.  [Set aside a buffer
> area, initiate the read and return control and get interrupted when
> a character is ready to be read.]

Unless you're in the mood for some serious programming you are out of luck.
The BIOS provided in ROM in the PC doesn't use interrupts at all.  It sits
there in a wait loop.  If you want to drive the disk under interrupts, you
have to program the hardware yourself, and simulate what DOS does for file
access.  That's a lot of work.

If you have a PC AT, you're in slightly better shape because the BIOS has
some hooks in it that let you get control when DOS is about to go into a
wait loop.  Causing the interrupt is still your problem (i.e., you have to
turn on the disk interrupt.)  Ugh.

By the time you've done all that work, you're probably better off saving
up your pennies and buying PC/IX or Xenix.

John Levine, ima!johnl

hamilton@uiucuxc.Uiuc.ARPA (07/04/85)

DOS 3+ has hooks for replacing BIOS busy waits with a wait/post scheme.
(i haven't tried it tho).
	wayne ({decvax,ucbvax}!pur-ee!uiucdcs!uiucuxc!)hamilton