Mail Archives: djgpp-workers/2001/08/05/11:11:05
> From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
> Date: Sun, 5 Aug 2001 23:11:45 +1000
> >
> > It might be that function 5701 fails from protected mode, but not from
> > real mode. (Crazy, I know; but so is the failure itself.)
> >
> Looks like you are not crazy. I downloaded the FreeDOS touch source code and
> it was in assembler, bit it worked. I then downloaded PACIFIC C and wrote a
> small test app below for DJGPP and PACIFIC C. I hope the examples are not
> to big, but I thought they may be useful for analysis of the problem. The
> app does the same interrupt calls.
>
> Real mode works in Pacific C and protected mode in DJGPP fails. I thought I
> was going crazy. The sample works fine on Win 98.
Could it be that W2K clobbers some of the registers on the way from
DPMI's function 0300h to its DOS function dispatch code?
And just to relieve my conscience: could you please look at the value
of the global variables __dpmi_int_flags, __dpmi_int_ss, and
__dpmi_int_sp, both before and after the call to __dpmi_int, and see
what are they (should all be zeroes)?
Anyway, if crazy does it, let's get crazier. Or, in the words of a
poet:
Yeah let's do something crazy,
something absolutely wrong
while we're waiting
for the miracle, for the miracle to come.
Leonard Cohen
To wit: try invoking function 5701h via INT 21h in protected mode,
like this:
union REGS regs;
regs.d.eax = 0x5701;
regs.d.ebx = filedesc;
regs.d.ecx = dostime;
regs.d.edx = dosdate;
_int86 (0x21, ®s, ®s);
Note that I make a point of using the 32-bit registers, to avoid
leaving random garbage in the upper 16 bits. Don't know if this
matters (it could even be wrong).
- Raw text -