Mail Archives: djgpp-workers/2001/08/06/09:08:43
----- Original Message -----
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
To: <acottrel AT ihug DOT com DOT au>
Cc: <djgpp-workers AT delorie DOT com>; <sandmann AT clio DOT rice DOT edu>
Sent: Monday, August 06, 2001 1:10 AM
Subject: Re: Windows 2000 utime query
> > 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)?
Test on Win2K, same app with LFN = y then =n. In both cases they are all
zero.
DJGPP_204 D:\dj204\contrib\touch>ls -la new.txt
-rw-r--r-- 1 AC root 4 Aug 8 2001 new.txt
DJGPP_204 D:\dj204\contrib\touch>touch new.txt
fildes = 5
__dpmi_int_ss= 0x0000 __dpmi_int_sp= 0x0000 __dpmi_int_flags= 0x0000
dostime (cx)= 0xB80D dosdate (dx)= 0x2B08
r.x.flags = 0x0002 r.x.ax = 0x5700
fildes = 5
__dpmi_int_ss= 0x0000 __dpmi_int_sp= 0x0000 __dpmi_int_flags= 0x0000
NEW dosdate (dx)= 0x2B09
dostime (cx)= 0xB80D dosdate (dx)= 0x2B09
r.x.flags = 0x0003 r.x.ax = 0x0001
fildes = 5
__dpmi_int_ss= 0x0000 __dpmi_int_sp= 0x0000 __dpmi_int_flags= 0x0000
====================================================
DJGPP_204 D:\dj204\contrib\touch>set lfn=n
====================================================
DJGPP_204 D:\dj204\contrib\touch>ls -la new.txt
-rw-r--r-- 1 AC root 4 Aug 8 2001 new.txt
DJGPP_204 D:\dj204\contrib\touch>touch new.txt
fildes = 5
__dpmi_int_ss= 0x0000 __dpmi_int_sp= 0x0000 __dpmi_int_flags= 0x0000
dostime (cx)= 0xB80D dosdate (dx)= 0x2B08
r.x.flags = 0x0002 r.x.ax = 0x5700
fildes = 5
__dpmi_int_ss= 0x0000 __dpmi_int_sp= 0x0000 __dpmi_int_flags= 0x0000
NEW dosdate (dx)= 0x2B09
dostime (cx)= 0xB80D dosdate (dx)= 0x2B09
r.x.flags = 0x0002 r.x.ax = 0x5701
fildes = 5
__dpmi_int_ss= 0x0000 __dpmi_int_sp= 0x0000 __dpmi_int_flags= 0x0000
DJGPP_204 D:\dj204\contrib\touch>ls -la new.txt
-rw-r--r-- 1 AC root 4 Aug 9 2001 new.txt
DJGPP_204 D:\dj204\contrib\touch>
> 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).
Added this to the example program. Works if LFN=N, but does nothing if
LFN=Y.
Andrew
- Raw text -