GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
Diese Seite auf deutsch

Mail #6346

Back to main page of archive

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  

From: levi@localhost.nc3a.nato.int
Subject: Bug in Delay
Date: 23 Apr 2001, 20:48:11

> Date: Mon, 23 Apr 2001 17:27:16 +0200
> From: Frank Heckenbach <frank@g-n-u.de>
> > 
> > You could use delay() on plain DOS and usleep() on Windows and OS/2.
> 
> So, how to distinguish them? -- I suppose that's in the FAQ or
> something, so perhaps some other DJGPP user can tell me how to do it
> or send me some code.

Function 1600h of Int 2Fh returns info that can be used to see if you
are running on Windows (and on what version of Windows).  Ralf Brown's
Interrupt List has all the details.  Here's a working code fragment
(from the Emacs distribution's dosfns.c file) that is used in the
DJGPP port of Emacs to set the Lisp variable dos-windows-version:

  /* If we are running from DOS box on MS-Windows, get Windows version.  */
  dpmiregs.x.ax = 0x1600;	/* enhanced mode installation check */
  dpmiregs.x.ss = dpmiregs.x.sp = dpmiregs.x.flags = 0;
  _go32_dpmi_simulate_int (0x2f, &dpmiregs);
  /* We only support Windows-specific features when we run on Windows 9X
     or on Windows 3.X/enhanced mode.

     Int 2Fh/AX=1600h returns:

     AL = 00:  no Windows at all;
     AL = 01:  Windows/386 2.x;
     AL = 80h: Windows 3.x in mode other than enhanced;
     AL = FFh: Windows/386 2.x

     We also check AH > 0 (Windows 3.1 or later), in case AL tricks us.  */
  if (dpmiregs.h.al > 2 && dpmiregs.h.al != 0x80 && dpmiregs.h.al != 0xff
      && (dpmiregs.h.al > 3 || dpmiregs.h.ah > 0))
    {
      dos_windows_version = dpmiregs.x.ax;
      Vdos_windows_version =
	Fcons (make_number (dpmiregs.h.al), make_number (dpmiregs.h.ah));

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  


In reply to

Author Subject Date
Eli Zaretskii Bug in Delay 29 Mar 2001, 12:12:30
Frank Heckenbach Bug in Delay 31 Mar 2001, 03:29:22
Eli Zaretskii Bug in Delay 31 Mar 2001, 11:55:42
Frank Heckenbach Bug in Delay 23 Apr 2001, 17:27:16

Back to main page of archive


Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.

Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.


This page was created by Crystal 0.999 (Linux 2.4.27/i686).