Re: Is CLI valid for applications in Windows?

From: Neil Bradley (nb_nospam_at_synthcom.com)
Date: 09/17/04


Date: Fri, 17 Sep 2004 10:31:58 -0700


"Robert Wessel" <robertwessel2@yahoo.com> wrote in message
news:bea2590e.0409161817.5df69a6c@posting.google.com...
> no-one@dont-mail-me.com (Robert Scott) wrote in message
> news:<414a0b9c.17213696@news.provide.net>...
>> I need to port some DOS industrial control software to Windows. The
>> application is tolerant of the non-real-time nature of Windows, but in
>> one specific place, I need to execute several consecutive machine
>> instructions without any possibility of being interrupted between
>> them, because they directly start two external hardware processes that
>> need to be nearly synchronous. In DOS I just bracketed my three
>> instructions with a CLI and STI. But will that work in Windows,
>> especially Windows 2000 and Windows XP? Will a CLI be virtualized or
>> something, thus invalidating its use in ensuring that no time elapses
>> between these several instructions?
> In a VDM (aka DOS/real-mode/v86 emulation), you can do a CLI, and
> it'll be virtualized, but only for that DOS box. For a real Win32
> application, it won't be allowed.

Actually, that's not true.

There is something called a Win32 console application which is a Win32
console. You can't tell the difference between them just by looking at them,
but if you're using MSVC V 6.0 or newer, one option you can choose is the
console apps. Also, there are exclusitivity calls you can make to the Win32
kernel (forgot what they are off the top of my head, but it has to do with
thread priority).

But as you said, one cannot access hardware directly. Everything is done
through a virtual device driver, so there won't be direct access to
nonstandards ports, or any ports for tha matter (everything is virtualized).

-->Neil



Relevant Pages

  • Re: Bug/problem with lcc-win
    ... layer or through using a sufficiently old version of win32, ... which is a 16 bit DOS emulation mode (which does ... Who writes a Win32 compiler and is ... unfamiliar with the basic execution modes of Windows? ...
    (comp.lang.c)
  • Re: Help with text adventure
    ... Is there a way to make a Win32 console application? ... no menus, and it's full screen, and basically it looks like a DOS ... DOSBox, but that seems kind of ridiculous because it's the year 2008. ... windowing process of Windows, like it was behind any Windows program. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Does .net replace win32?
    ... > ontop of windows for general applications, ... Windows 3.1 had to go through DOS and BIOS to make it work, ... At this moment it uses Win32 API. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: How invoke hardware port I/O in DLL from Fortran?
    ... Windows protects i/o ports, whereas DOS does not. ...
    (comp.lang.fortran)
  • Re: HAY Herbert, wanna write a legal PE executable ?
    ... Win32 application with only 922 byte (ok, ... run in 32 bit Windows, so it can't be executed for example ... Microsoft COFF Binary File Dumper Version 5.12.8078 ... its done with a DOS stub for a standard PE file. ...
    (alt.lang.asm)