And now: int 0x21 in hw interrupt handler? (Developers)
> Thank you Japheth.
>
> And now I have a different question: What issues will or can I run into
> when calling int 0x21 inside my interrupt handler?
Calling DOS from inside a hardware interrupt handler is usually not a good idea. Although, if your program is to work in DOSBox only, this strategy may work without problems.
> In this case, I'm thinking of using it to load PCM data from a file to the
> DMA buffer. This means ah = 0x3f; int 0x21. I assume there might be two
> issues: reentrancy and time (loading from a file can take while I
> suppose).
Yes.
> I read somewhere that int 0x21 are not reentrant so using it inside IRQ 7
> might be a bad idea since it can be flagged while DOS is already servicing
> 0x21, right?
>
> The only thing I can think of is busy waiting for a flag toggled in the IRQ
> handler. Is there anything else I can do?
I suggest to read the PCM data into a large XMS buffer when it is safe to read files. During interrupt time it's ok to access XMS data.
---
MS-DOS forever!
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