Mail Archives: djgpp/2000/04/26/05:54:54
Richard Dawe wrote:
>
> (*) This array may be too big in total byte-size, but it works. When I
> change it to a short, GPFs are generated. I wonder if this is because INT
> 0x2F, subfunction 0x1684 returns a selector:offset pair in protected mode,
> i.e. 16-bit:32-bit, whereas it returns 16-bit:16-bit in real mode (as
> listed in Ralph Brown's Interrupt List).
No, I think the VxD entry point is always 16:16 bit. The problem is probably
in how the inline assembly and Gas handle a `short' variable. I'm guessing
that the offset somehow get loaded into a 32-bit register, with garbage in
the high 16 bits.
> My first problem is this: binutils 2.8.1 & cross-binutils 2.9.1.0.4 were
> happy with the 'lcall _entrypoint' syntax. binutils 2.9.5.1 beta is OK,
> but warns that without a '*' the address is a relative address.
Yes, this is one of the incompatible changes in the latest versions of
Binutils.
> What syntax should I use? Should this be a far call (i.e. lcall rather
> than call)?
AFAIK, it *must* be a far call, since the address includes a selector.
> Should I instead use a syntax like:
>
> lcall *_entrypoint[1]:_entrypoint[0]
Probably worth trying, but I have no idea how to say this in inline
assembly. Anybody?
> I guess I should I move away from a two-int structure to something like
> this:
>
> struct entrypoint {
> short selector;
> int offset;
> };
I'm not sure. This even can crash and burn, due to padding.
- Raw text -