delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/26/08:48:52

Date: Sun, 26 Sep 1999 08:46:54 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Prashant TR <prashant_news AT yahoo DOT com>
cc: djgpp AT delorie DOT com, nicolas DOT gasnier AT wanadoo DOT fr
Subject: Re: Protected Mode problem (note: Eli Zaretskii)
In-Reply-To: <19990925165811.11399.rocketmail@web1406.mail.yahoo.com>
Message-ID: <Pine.SUN.3.91.990926084120.17688O-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 25 Sep 1999, Prashant TR wrote:

> The program I'm trying to spawn is a 16-bit real mode
> program, not a program written with DJGPP.

Now I'm confused.  In your other message you told that this program 
switches to protected mode.  Now you are telling it's a real-mode
program.  Which is true?

> I'm already
> in MSDOS mode (I have to be if I need to access the
> GDT, etc) and there are no memory managers.

You might be in real mode, but the DPMI server is still active, and so 
you cannot do anything that it won't let you do.

> Why I want to do is because I'm trying to get direct
> access to the extended memory (which may be any
> portion of extended memory; not just the portion of my
> DS). If I did that in DJGPP, my program would crash
> with a SIGSEGV.

You can use the nearptr method to gain access to the entire 4GB address 
space from a DJGPP program.  This seems like an easier way than to mess 
with protected mode from a real-mode program that runs under a DPMI 
server, since you automatically get compatibility with the parent DJGPP 
program and the DPMI host.

> But I don't think merely accessing
> registers like CR0, etc. should affect anything as
> long as I set them back to what they were. I even
> disable interrupts to make sure the control never goes
> to the DPMI.

Privileged instructions trigger exceptions, not interrupts.  Disabling 
interrupts doesn't affect exceptions.  So you will still crash.

> It seems that CWSDPMI reprograms the PICs to
> accomodate IRQ0-7 starting at INT 78-7fh. I'm not sure
> about this and I need clarification.

The CWSDPMI sources should tell.  I don't remember by heart.

- Raw text -


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