Re: How to precisely control timing write I/O to lpt with driver?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Maxim S. Shatskih (maxim_at_storagecraft.com)
Date: 10/11/04


Date: Mon, 11 Oct 2004 14:37:00 +0400


    I don't think such things are possible in Windows at all. You can probably
achieve some results, but not robust enough to make a product based on this.

    Develop the USB hardware and forget the obsolete LPT port. Note that most
new laptops have no LPT.

    Or another way - rely on hardware strobes on LPT port and ECP mode DMA to
transfer the bytes, not on interrupts or host CPU code timings.

-- 
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"lptguy" <lptguy@discussions.microsoft.com> wrote in message
news:EA8A9B71-400B-4F87-B6D7-68072EF83425@microsoft.com...
> can someone tell me how to precisely control timing to write I/O out to Lpt
> with kernel mode driver?
>
> I had compiled and modified a kernel mode parallel port driver, a user mode
> dll to export I/O read and write, and a MFC application that issues I/O read
> and write through the driver to an externel device connected to the parallel
> port. Everything seem like ok, but when i use QueryPerformanceCounter and
> QueryPerformanceFrequency api in the MFC application to obtain accurate
> desired timing delay (in nanosecond accuracy), the application writing out a
> waveform to the Lpt to the external device, may not appear as accurate as
> desired. Sometime the delay appear longer, though most of the time it works
> fine. In some computer it has such delay error appear at every particular
> interval. And it will not produce a desired delay when a CD or music is
> played at the computer.
>
> below is the source code:
>
> do{
>    BOOL bResult = ::QueryPerformanceCounter(&liCurrentCnt);
>    if(liCurrentCnt.QuadPart < liBeginCnt.QuadPart)
>    {
>       AfxMessageBox("Error occured in timing!"); // never happen
>       break;
>    }
> }while(liCurrentCnt.QuadPart < liMaxBoundCnt.QuadPart);
>
> Is there any solution to this problem?
>
> Is there any method in kernel mode driver, that I can hog the CPU processing
> for a certain amount of time?
>
> Or is there any way can I put my application thread or driver service
> routine to the highest priority that no other software can interrupt it?
>
> Can anyone please help?
>


Relevant Pages

  • How to precisely control timing write I/O to lpt with driver?
    ... can someone tell me how to precisely control timing to write I/O out to Lpt ... I had compiled and modified a kernel mode parallel port driver, ... Sometime the delay appear longer, though most of the time it works ... Is there any method in kernel mode driver, that I can hog the CPU processing ...
    (microsoft.public.development.device.drivers)
  • Re: srand() inkernel mode
    ... if you are in Windows 2000+, since rand and srand are not thread safe there. ... Don Burn (MVP, Windows DDK) ... > Does anyone have a suggestion for seeding randin a kernel mode driver? ... > In user mode or application layer, it is common to srand, but> the system time is not available in kernel mode. ...
    (microsoft.public.development.device.drivers)
  • Re: Cryptography in Windows kernel mode.
    ... I have developed a kernel mode driver for Windows XP and now I need to add ... some features to it requiring cryptography support. ...
    (microsoft.public.development.device.drivers)
  • Re: List of available C library functions?
    ... TCHAR doesn't exist b/c a kernel mode driver cannot be recompiled to be ANSI ... > Well HAL or anything else don't contain CRT functions. ... > user-mode counterparts from ntdll in a code written for NT4. ...
    (microsoft.public.win32.programmer.kernel)
  • RE: Why does XP establish HTTP connection when browsing network s hares?
    ... This is the WebDAV mini-redirector that is part of Windows XP. ... It consists of this kernel mode driver, a user mode service, and the ... I've noticed some strange behavior from our IDS. ...
    (Focus-Microsoft)