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 Japheth Homepage, Germany (South), 14.12.2012, 06:10

> 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:

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