www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/07/13:00:18

Xref: news2.mv.net comp.os.msdos.djgpp:6857
From: Sengan Short <Sengan DOT Short AT durham DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: writing hw interrupt handlers.
Date: 5 Aug 1996 12:01:48 GMT
Organization: University of Durham, Durham, UK.
Lines: 22
Message-ID: <4u4nrc$g8o@mercury.dur.ac.uk>
References: <4tuak7$h7m AT news DOT goodnet DOT com> <Pine DOT HPP DOT 3 DOT 91 DOT 960804173423 DOT 12439B-100000 AT santaka DOT sc-uni DOT ktu DOT lt>
NNTP-Posting-Host: whitby.dur.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019