delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/07/21/12:36:25

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10207211637.AA15567@clio.rice.edu>
Subject: Re: Emacs CVS and Windows NT 4
To: djgpp-workers AT delorie DOT com
Date: Sun, 21 Jul 2002 11:37:38 -0500 (CDT)
Cc: rich AT phekda DOT freeserve DOT co DOT uk
In-Reply-To: <3D3A740A.55604E14@phekda.freeserve.co.uk> from "Richard Dawe" at Jul 21, 2002 09:42:50 AM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > Try the program I provided in email dated 19 May 2002 15:36 - small and
> > easy to debug.  The upstroke keyboard interrupt is very easy to cause an
> > interrupt in the sbrk and cause a crash.
> 
> It seems to crash in the same way with and without the cli fix. I tried:
> 
>     <program name> 100 500 1000 10000 100
> 
> and it crashed every time after five key presses irrespective of how fast I
> press the keys.

If the cli fix doesn't work then that means good old NT 4 doesn't even
virtualize the cli, it just ignores it ...

Does this version crash?  It disables the keyboard hooking.  This might
be a long term fix.  But in the meantime, it seems that unixy sbrk under
NT 4.0 is just badly broken, thanks to MS bugz

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <crt0.h>
#include <sys/nearptr.h>
#include <dpmi.h>

int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;

int main(int argc, char** argv) {
 int i,j;

 __djgpp_exception_toggle();
 printf("My starting base address is 0x%8.8x, istate=%d\n",
   __djgpp_base_address,__dpmi_get_virtual_interrupt_state());

 for(i=1;i<argc;i++) {
   j = 1024*atoi(argv[i]);
   if(j > 0) {
     printf("sbrk(%d)...(press a key)\n",j);
     getkey();
     j = (int)sbrk(j);
     printf("returned 0x%8.8x, new base is 0x%8.8x, istate=%d\n",j,
       __djgpp_base_address,__dpmi_get_virtual_interrupt_state());
   }
 }
 return 0;
}

Thanks for looking at this

- Raw text -


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