Date: Mon, 6 Dec 1999 12:25:52 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Prashant TR cc: Gareth Williams , DJGPP Mailing list Subject: Re: Setting a variable's selector? - Clarification - I hope. In-Reply-To: <005a01bf3f4a$248ccbc0$21f838ca@home-computer> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 5 Dec 1999, Prashant TR wrote: > Eli Zaretskii wrote: > > >This probably means that you should use the real-mode interface, since > >mixing 16-bit code with 32-bit code in the DPMI environment is tricky, > >if not impossible. > > Out of curiosity, could you give me a brief idea of how it works? > If I ever need to do this, should I first create a descriptor and then > try changing the access rights, or is it something totally different? I suggest to begin by looking at the DJGPP startup code (crt0.S). It includes some code for the 16-bit setup (required by the DPMI spec and to free the selectors that are used as long as 32-bit code runs). In general, the DPMI 0.9 spec disallows mixing 16-bit and 32-bit DPMI programs in the same virtual machine, so you cannot set up a 16-bit code and data segments and then run 16-bit code that uses them from a normal (i.e. 32-bit) DJGPP program.