delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/06/09:08:43

X-Authentication-Warning: new-smtp1.ihug.com.au: Host p46-tnt4.syd.ihug.com.au [203.173.134.46] claimed to be acceleron
Message-ID: <00bf01c11e6a$f39e5090$0a02a8c0@acceleron>
From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
To: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Cc: <djgpp-workers AT delorie DOT com>, <sandmann AT clio DOT rice DOT edu>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010805154530 DOT 12002B-100000 AT is> <001601c11db0$313103f0$0a02a8c0 AT acceleron> <9003-Sun05Aug2001181019+0300-eliz AT is DOT elta DOT co DOT il>
Subject: Re: Windows 2000 utime query
Date: Mon, 6 Aug 2001 21:28:41 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Reply-To: djgpp-workers AT delorie DOT com

----- 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, &regs, &regs);
>
> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019