delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/28/03:38:23

Date: Tue, 28 Oct 1997 10:37:56 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Michael Mauch <michael DOT mauch AT gmx DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: PCTIME13
In-Reply-To: <3454a78b.5869285@news.uni-duisburg.de>
Message-ID: <Pine.SUN.3.91.971028103732.22947D-100000@is>
MIME-Version: 1.0

On Mon, 27 Oct 1997, Michael Mauch wrote:

> > I can get PCTIME running at the right speed by removing this line from
> > pm_new8h():
> >   ++ticks_8h;
> > 
> > So it would seem that under Windows, both the protected mode and real
> > mode handlers get called with every timer tick, and under DOS only the
> > real mode handler gets called.
> 
> On my machine I get illegal instruction message boxes from Win95
> when/after using test8.exe, so it seems to be not very safe anyways. I
> don't know in which case which of the handlers (real mode or protected
> mode) is called,

In DPMI, there's usually no need to install the real-mode handler at
all, since all hardware interrupts are always reflected to the
protected-mode handler first, even if they happen while the processor
is in real mode (e.g., in the middle of a DOS call).  See section 18.9
of the DJGPP FAQ list for details.

What happens if you do hook the timer interrupt in both RM and PM,
depends on the DPMI server (Windows vs CWSDPMI, I guess, although the
original poster didn't tell whether CWSDPMI is used on DOS), and on
the order in which they were hooked.  Again, see the FAQ for more on
this.  If you want to play safe, you need some kind of semaphore
variable that the two handlers could use so that they don't increment
the counter twice for the same interrupt.

- Raw text -


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