And now: int 0x21 in hw interrupt handler? (Developers)
> > 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:
- Basics of interrupt chaining? - myrkraverk, 13.12.2012, 19:39 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Basics of interrupt chaining? - myrkraverk, 13.12.2012, 20:19
- Basics of interrupt chaining? - Japheth, 13.12.2012, 21:31
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 14.12.2012, 02:58
- And now: int 0x21 in hw interrupt handler? - Japheth, 14.12.2012, 06:10
- And now: int 0x21 in hw interrupt handler? - tom, 14.12.2012, 18:25
- And now: int 0x21 in hw interrupt handler? - bretjohn, 15.12.2012, 01:29
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 15.12.2012, 15:52
- And now: int 0x21 in hw interrupt handler? - bretjohn, 17.12.2012, 18:08
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 18.12.2012, 20:16
- And now: int 0x21 in hw interrupt handler? - tom, 19.12.2012, 15:54
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 18.12.2012, 20:16
- And now: int 0x21 in hw interrupt handler? - bretjohn, 17.12.2012, 18:08
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 15.12.2012, 15:52
- And now: int 0x21 in hw interrupt handler? - myrkraverk, 14.12.2012, 02:58
- Basics of interrupt chaining? - bretjohn, 14.12.2012, 19:43
Mix view