Mail Archives: djgpp/1996/08/07/13:00:18
: Phew... I hope I'll be able to explain all the pitfalls in the HW interrupts
: chapter of the DJGPP book, which I am working on (the chapter, not the
: book :)
: Cheers!
: Martynas
Well it's relatively simple as long as you understand the reasons for it:
DOS is non-reentrant. Say an interrupt occurs, while you are in DOS. If your
interrupt has not locked all the stuff it uses, it will need to page stuff
in. To do this it may use the DOS file accessing commands. Here is the place
for the "BUT!" BUT! DOS is not reentrant. Since you were in DOS at the program
level, using any DOS commands during the interrupt messes up DOS' internal
scratch pad, so to speak, hence is highly likely to break the interrupted
program. Moral of the story, if you want your program to run under all DPMI
servers, you should lock all stuff touched by the int handler. (DPMI servers
that swap directly to disk through the hardware rather than DOS can ignore
locking calls if they want)
Sengan
- Raw text -