Date: Tue, 7 Dec 1999 12:16:15 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Peter Johnson cc: djgpp-workers AT delorie DOT com, Charles Sandmann Subject: Re: NT4 DPMI BUG (303h, Allocate Real-Mode Callback) In-Reply-To: <4.2.1.19991206190011.00af0210@ews.uiuc.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk I cc: the developers' list and Charles Sandmann, since I think this is something that should be discussed. A summary of this issue is attached below, for those who didn't read this thread on c.o.m.d. On Mon, 6 Dec 1999, Peter Johnson wrote: > Another question/problem: I'm going to have to not use the > __dpmi_allocate_real_mode_callback function in the new versions of the > _go32_* functions because __dpmi_allocate_real_mode_callback always passes > the selector for the data structure as ds, and I need to have it be the > custom allocated selector. > > Ideas? How about adding a new function, called, say, __dpmi_allocate_real_mode_callback_with_selector, which can be passed the selector as an additional argument? (Btw, __dpmi_allocate_real_mode_callback uses CS, not DS, since DS might be invalid when the real-mode callback is called, e.g. due to some pending signal.) One other issue about the solution proposed by Peter: it sets the limit of the additional selector to 32h (since it only spans the real-mode registers' data structure. This makes the segment be byte-granular (as opposed to page granularity used by DJGPP for all other selectors). Can this cause any problems? Is it safer to define a page-granular segment? Summary for those who didn't read this thread: Peter is working on changing _go32_dpmi_allocate_real_mode_callback_* functions to work around a bug on NT whereby only the lower 16 bits of the offset of the callback address are used; NT ignores (or garbles) the upper 16 bits. For this to work, Peter allocates an extra descriptor whose base address is such that the offset is zero, and passes the selector of that descriptor to the DPMI host. I asked Peter to make this special code be executed only when the program actually runs on NT, to minimize possible adverse effects on other platforms (shortage of selectors, etc.).