Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

And now: int 0x21 in hw interrupt handler? (Developers)

posted by bretjohn Homepage E-mail, Rio Rancho, NM, 17.12.2012, 18:08

> > You want to check the INDOS flag to see if int21
> > is already busy. Also you want to check if your
> > own handler is already busy and you may want to
> > enable IRQ at some point, normally they are off
> > until your IRQ handler finishes. But there are
> > many howtos about such things on the web :-)

The InDOS flag is one of a few different checks you need to make to test whether DOS is already doing something or not. The problem is, what do you do if it's not safe? Your only option is to wait until it is safe, and that can never happen until you exit the IRQ handler. So, you need to have another process to download the data anyway, so you might as well just do it that way from the beginning.

Another possibility would be to do the checking in the IRQ and, if it's safe, to download way more data than you need (in case during the next IRQ it is not safe). The problem with that, though, is what happens if it is not safe and the correct data has not been downloaded yet? You in the same boat as above, and still need a separate process.

> Another "option" might be to wrap all my int 0x21 calls with CLI/STI but
> I'm not sure that's a good idea either.

That won't help, since the INT 21h handle will issue STI/CLI combinations at various times itself.

> For now the question is: what do I want to do while the PCM data is being
> fed to the Sound Blaster. If nothing, I can busy wait - something that
> might be a good idea as a "first try."

I've never done any sound stuff myself, so don't know for sure how it works. But, I assume that when you tell the sound blaster to play something, it does it, and then generates an IRQ when it is done. Inside the IRQ handler you can tell it what to do next, after which it will generate another IRQ. And so on.

IOW, you can do anything you want to in the foreground (screen animations or whatever) while the sound is processed in the background with the hardware/IRQ process. It could be difficult to maintain synchronization with the different processes, though.

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum