Do I need Synchronization ? Please help!

Hello,

I am writing a Win2K Bus Driver to simulate a novel high-performance
hardware device.

This Bus Driver will be used to develop the actual Device Drivers for
the device until the real hardware is available. The aim of the Bus
Driver is to take control of one of the CPUs (on an MP system), and
behave as the novel device(s).

What the Bus Driver does:
-Simulates the Register Space of the device and communicates the Base
Address of the Register Space to the Function (Device) Driver for the
device.
-Creates a thread:
-sets thread affinity to a particular CPU
-sets thread priority to HIGH_PRIORITY
-this thread continuously monitors the Register Space of device
for any changes and takes appropriate action.

My questions:

  1. Can I run this thread continuously or do I need some way for it
    to block ? (since this is a HIGH_PRIORITY real-time thread ?)

Please remember that this Bus Driver is not for production and
will only be used to develope the actual Funtion Driver]

  1. Type of synchronization mechanism ?
    -I create the thread in my AddDevice() for the Bus Driver
    -In ThreadMain() I need to monitor the Register Spaces of the
    simulated devices (but the simulated devices don’t come into
    existence until the PDOs are created).
    -I store a “list of PDOs created” and “# PDOs currently
    enumerated” in my Bus FDO DevExtn.

So I am thinking that I could block the thread while #PDOs = 0
From my understanding, I can use a Notification Event or Binary
Semaphore for this purpose. But I am not sure which one to use
and how ?

Please help!

Thanks much.
Puja


Get free email and a permanent address at http://www.amexmail.com/?A=1

I have a problem with kernel-mode driver for serial port. I’m unable to make
a interrupt connection for COM2 port with IoConnectInterrupt function. It
returns invalid parameters error. Parameters that I get from
HalGetInterruptVector I send to IoConnectInterrupt.
Parameters that I send to HalGetInterruptVector I take according my
knowledge of the system platform x86. In parameters are:
BusType = Isa,
BusNumber= 0 (as it is the only Isa bus),
BusRelativeVector = ? ,
BusRelativeLevel = ?,

are unknown to me. I can’t get this information from registry (I’m trying to
find them out but I have problems with the key) and I supposed that these
are Port interrupt Vector and port Interrupt level.
Am I right about these assumptions?

Regards,
Neno