Can't read from COM-Port using WDM driver

I have to read timecritical data from com1 and depending on the receiced
data send an answer within 3ms. So I decided to build an own wdm driver
(generic function driver) for 2000/XP. I have created my own driver’s
class. The ressources needed (IRQ and port-range) are described using the
inf’s LogConfig statement. After installing my driver it seems everything
to be OK: the hardware manager shows my driver in an extra section and the
needed ressources are OK. But it seems the driver has NO access to the
com-port. each port I read gets FF. What is wrong? Do I need to handle
some PnP IRP’s? Even when I use the windbg’s command “ib 3fa” I get FF.
???

Hi!

Seems to me you forgot to power up com port (in case we are speaking about
mb
embedded port). Please check out the thread “How to deal with ACPI”.

S.Y.
Igor.

“Christian Busch” wrote in message
news:xxxxx@ntdev…
>
> I have to read timecritical data from com1 and depending on the receiced
> data send an answer within 3ms. So I decided to build an own wdm driver
> (generic function driver) for 2000/XP. I have created my own driver’s
> class. The ressources needed (IRQ and port-range) are described using the
> inf’s LogConfig statement. After installing my driver it seems everything
> to be OK: the hardware manager shows my driver in an extra section and the
> needed ressources are OK. But it seems the driver has NO access to the
> com-port. each port I read gets FF. What is wrong? Do I need to handle
> some PnP IRP’s? Even when I use the windbg’s command “ib 3fa” I get FF.
> ???
>
>

Also, on Win2k/etc., the most “approved” way to use a serial port is to
interface with serial.sys…

This might not be appropriate for your situation (you should be able to
get pretty good latency out of this on a modern machine), but if it is,
it can save you a tremendous amount of headaches in dealing with all the
zillions of subtly different serial ports out there in the world
(various UARTs have various quirks to them).

BTW, don’t do anything “mission critical” this way. Nothing that you do
can guarantee that windows will always allow you to respond within 3ms
100% of the time. It’s not a real-time OS.

Igor Slewsarev wrote:

Hi!

Seems to me you forgot to power up com port (in case we are speaking about
mb
embedded port). Please check out the thread “How to deal with ACPI”.

S.Y.
Igor.

“Christian Busch” wrote in message
> news:xxxxx@ntdev…
>
>>I have to read timecritical data from com1 and depending on the receiced
>>data send an answer within 3ms. So I decided to build an own wdm driver
>>(generic function driver) for 2000/XP. I have created my own driver’s
>>class. The ressources needed (IRQ and port-range) are described using the
>>inf’s LogConfig statement. After installing my driver it seems everything
>>to be OK: the hardware manager shows my driver in an extra section and the
>>needed ressources are OK. But it seems the driver has NO access to the
>>com-port. each port I read gets FF. What is wrong? Do I need to handle
>>some PnP IRP’s? Even when I use the windbg’s command “ib 3fa” I get FF.
>>???
>>
>>
>
>
>
>
>


…/ray..

if ib 3ba does not work then I would but in READ_PORT_UCHAR() for 3ba and
trace thru the code. If you still do not get the correct data then your
hardware is not initialized correctly - may the PCI configuration
registers have turned off all io access to the board?

10 ms is common for a kernel thread to be scheduled to run. Note if you
are interrupt driven then that is a different story.