www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/08/02:50:01

Date: Tue, 8 Jul 1997 09:49:27 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Johan Karlsson <k AT sm DOT luth DOT se>
cc: djgpp AT delorie DOT com
Subject: Re: Protected mode
In-Reply-To: <33C098E4.2F1CF0FB@sm.luth.se>
Message-ID: <Pine.SUN.3.91.970708094829.13048G-100000@is>
MIME-Version: 1.0

On Mon, 7 Jul 1997, Johan Karlsson wrote:

> I tried to use the dpmi interrupt 2fH ax = 1686H
> see: http://www.delorie.com/djgpp/doc/dpmi/ch5.g.html
> to get the CPU mode, but it return that the program runs in Real Mode.
> Is there some problem with this code part:
> __dpmi_regs r;
> r.x.ax = 0x1686;
> __dpmi_int(0x2f, &r)
> 
> Now if (r.x.ax == 0) then Protected mode else Real Mode.
> And r.x.ax is not 0 when __dpmi_int returns.

You need to understand what `__dpmi_int' does.  It actually calls a
DPMI service that switches the processor to real mode, fills the
registers with the contents of `__dpmi_regs' and reissues the
interrupt.  Since the processor is in real mode when the interrupt is
reissued, what else do you expect r.x.ax to return?

If you need an interrupt to be issued in protected mode, use `int86'
or `int86x', whatever is appropriate, but you need to make sure that
the interrupt you are calling is supported by the DPMI host, or your
program will crash.

> The DPMI host running is qdpmi from qemm, dpmi version 0.9
> (I have also installed cwsdpmi, but ist not running. Should I use this
> one instead?)

You can try, but a well-written program should work with both.

> I have a memory board on the ISA Bus which I want to access.
> The memory is in the address range 0x00400000 to 0x0047fffe
> 
> I have tried some different ways but nothing seems to work.

Have you tried the way that's explained in the DJGPP FAQ list (section
18.7)?  If not, please try it.  If you did and it failed, please tell
what went wrong.

- Raw text -


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