• Timing is everything

    From Jonathan de Boyne Pollard@2:257/609.3 to David Noon on Wed May 17 02:04:18 2000
    Timur's driver uses Timer 0 and is named TIMER0.SYS.

    I do wonder how what Timur does interacts with the system heartbeat, which I assume is also driven off the same timer.

    » JdeBP «

    --- FleetStreet 1.22 NR
    * Origin: JdeBP's point, using Squish <yuk!> (2:257/609.3)
  • From Jonathan de Boyne Pollard@2:257/609.3 to David Noon on Wed May 17 02:05:44 2000
    However, the driver I am writing needs to be able to run without interrupts, so it uses Timer 2 and polls the port; the polling makes it
    a little [as in totally] CPU-bound.

    I'm curious. Why are you not able to use interrupts ?

    » JdeBP «

    --- FleetStreet 1.22 NR
    * Origin: JdeBP's point, using Squish <yuk!> (2:257/609.3)
  • From David Noon@2:257/609.5 to Jonathan de Boyne Pollard on Wed Jun 7 13:20:10 2000
    Hi Jonathan,

    Replying to a message of Jonathan de Boyne Pollard to David Noon:

    However, the driver I am writing needs to be able to run without
    interrupts, so it uses Timer 2 and polls the port; the polling makes
    it a little [as in totally] CPU-bound.

    JdBP> I'm curious. Why are you not able to use interrupts ?

    The Timer 2 port has no IRQ associated with it. Only Timer 0 generates the clock IRQ.

    The way Timer 2 works is that it counts down from its starting value by decrementing a 16-bit counter every 838 nanoseconds (the base "tick" for Intel hardware). It keeps decrementing and wraps around at zero until it is stopped. To determine the number of ticks elapsed the program latches and reads the port.

    Regards

    Dave
    <Team PL/I>

    --- FleetStreet 1.25.1
    * Origin: The man who broke the bank at Monte Carlo (2:257/609.5)
  • From David Noon@2:257/609.5 to Jonathan de Boyne Pollard on Wed Jun 7 13:22:08 2000
    Hi Jonathan,

    Replying to a message of Jonathan de Boyne Pollard to David Noon:

    Timur's driver uses Timer 0 and is named TIMER0.SYS.

    JdBP> I do wonder how what Timur does interacts with the system heartbeat,
    JdBP> which I assume is also driven off the same timer.

    Since he uses an IDC interface to CLOCK01.SYS to switch off that timer, and so requires a CLOCK01.SYS more recent than Warp 3 GA (fixpak 17 or later, IIRC), I
    expect he trashes it completely. This is a frequent design paradigm in IBM software. The major requirement is usually to restore the previous state after you're finished.

    Timur documents that his driver always programs the PIT to "tick" every millisecond (actually every .999849142 milliseconds) regardless of the interval
    required by the caller. If the caller requests, say, 10 millisecond updates, the caller's callback routine is only called every 10 IRQ's.

    During this time, use of CLOCK01.SYS facilities is compromised.

    Regards

    Dave
    <Team PL/I>

    --- FleetStreet 1.25.1
    * Origin: The man who broke the bank at Monte Carlo (2:257/609.5)