Date: Tue, 8 Jul 1997 09:49:27 +0300 (IDT) From: Eli Zaretskii To: Johan Karlsson cc: djgpp AT delorie DOT com Subject: Re: Protected mode In-Reply-To: <33C098E4.2F1CF0FB@sm.luth.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.