multiport serial device

I am fairly new to driver writing and I am trying to figure out the best
approach to writing a driver for a multiple serial port pci board. It needs
to run on w2k and xp. Can someone help me and verify a few assumtions I am
making?

  • First off, there is no wdm-based serial driver example that I could find
    (at least in DDK) - true?

  • I notice that in the nt ddk serial port example, there is multiport
    support. However, from what I have read, it looks like my driver needs to
    be a function driver (i.e. I can’t implement a filter driver above
    serial.sys, even though the uarts are standard). So, I have to implement a
    separate driver from serial.sys since this driver is directly controlling
    hardware. true?

  • My current approach is to take appropriate chunks of code from the
    NT-based ddk serial driver, and wedge it into a wdm-based pci device driver
    skeleton. Also, to make use of serenum.sys to enumerate COM3-COM10. COM1,2
    also use serenum.sys and are attached to serial.sys. Does this sound right?

any insight into this would be appreciated,
Jeff

The COM port interface is not a WDM interface. Serial.sys is the best example you will have.

The multiport serial support in serial.sys is for ISA devices and for a very limited set of MPS ISA cards. Ignore it, it is not relevant for your device.

If your MPS device is basically N times 16550 UARTs and they are expressed as such (ie 8 1 one byte registers + an interrupt), you can write a bus driver for your device and assign each uart to a PDO and then load serial on top of each PDO. That should work (in theory :).

Otherwise, what I would do is still write a bus driver and create a child for each port. Then, write another driver that will control each child. This driver is probably going to be a 90% wholesale copy of serial.sys. What you would change is

  1. how you get the resources for each port. I would use IRP_MN_QUERY_INTERFACE to ask the bus driver to return to you a set of resources during start device
  2. how you touch these resources if the serial source isn’t doing that properly
  3. if each port is not a true 16550, you might need to change serial source to touch the hardware as appropriate
  4. name the driver something other then serial.sys :slight_smile:
  5. install each child under the Ports class. This will auto assign you the correct COM port number. In the INF you can specify serenum as the upperfilter (see msports.inf on how to do that) and then you get serial enumeration as well.

d


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Larson, Jeffrey
Sent: Friday, June 04, 2004 2:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] multiport serial device

?
I am fairly new to driver writing and I am trying to figure out the best approach to writing a driver for a multiple serial port pci board. It needs to run on w2k and xp.? Can someone help me and verify a few assumtions I am making?
?

  • First off, there is no wdm-based serial driver example that I could find (at least in DDK) - true?
    ?
  • I notice that in the nt ddk serial port example, there is multiport support.? However, from what I have read, it looks like?my driver?needs to be a function driver (i.e. I can’t implement a filter driver above serial.sys, even though the uarts are standard).??So, I have to implement a separate driver from serial.sys since this driver is directly controlling hardware. true?
    ?
  • My current approach is to take?appropriate?chunks of?code?from?the NT-based ddk serial driver, and wedge it into a wdm-based pci device driver skeleton.? Also, to make use of serenum.sys to enumerate COM3-COM10.? COM1,2 also use serenum.sys and are attached to serial.sys.? Does this sound right?
    ?
    any insight into this would be appreciated,
    Jeff
    ?

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Why not use the multifunction support in mf.sys instead of writing a
(massively undocumented) resource-allocating bus driver from sratch? While
the mf documentation is a bit skeletal and cryptic, I happen to know from
experience that mf does work and does allow you to poof up serial ports
without having to write either a serial driver or a bus driver.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, June 04, 2004 6:09 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

The COM port interface is not a WDM interface. Serial.sys is
the best example you will have.

The multiport serial support in serial.sys is for ISA devices
and for a very limited set of MPS ISA cards. Ignore it, it
is not relevant for your device.

If your MPS device is basically N times 16550 UARTs and they
are expressed as such (ie 8 1 one byte registers + an
interrupt), you can write a bus driver for your device and
assign each uart to a PDO and then load serial on top of each
PDO. That should work (in theory :).

Otherwise, what I would do is still write a bus driver and
create a child for each port. Then, write another driver
that will control each child. This driver is probably going
to be a 90% wholesale copy of serial.sys. What you would change is

  1. how you get the resources for each port. I would use
    IRP_MN_QUERY_INTERFACE to ask the bus driver to return to you
    a set of resources during start device
  2. how you touch these resources if the serial source isn’t
    doing that properly
  3. if each port is not a true 16550, you might need to
    change serial source to touch the hardware as appropriate
  4. name the driver something other then serial.sys :slight_smile:
  5. install each child under the Ports class. This will auto
    assign you the correct COM port number. In the INF you can
    specify serenum as the upperfilter (see msports.inf on how to
    do that) and then you get serial enumeration as well.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Larson, Jeffrey
Sent: Friday, June 04, 2004 2:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] multiport serial device

?
I am fairly new to driver writing and I am trying to figure
out the best approach to writing a driver for a multiple
serial port pci board. It needs to run on w2k and xp.? Can
someone help me and verify a few assumtions I am making?
?

  • First off, there is no wdm-based serial driver example that
    I could find (at least in DDK) - true?
    ?
  • I notice that in the nt ddk serial port example, there is
    multiport support.? However, from what I have read, it looks
    like?my driver?needs to be a function driver (i.e. I can’t
    implement a filter driver above serial.sys, even though the
    uarts are standard).??So, I have to implement a separate
    driver from serial.sys since this driver is directly
    controlling hardware. true?
    ?
  • My current approach is to take?appropriate?chunks of?code?
    from?the NT-based ddk serial driver, and wedge it into a wdm-> based pci
    device driver skeleton.? Also, to make use of
    serenum.sys to enumerate COM3-COM10.? COM1,2 also use
    serenum.sys and are attached to serial.sys.? Does this sound right?
    ?
    any insight into this would be appreciated, Jeff
    ?

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

That works too as long as the hw can be parsed by MF. If you go route #2 from my original suggestion, there is no resource arbitration to the children. The PDO knows its resources b/c it is the same driver as the parent. To get the resources from the serial like FDO, you manually query the PDO for the resources. In the end, no resources are “officially” assigned to the PDO as far as NTOS is concertned, but you can still retrieve them from higher in the stack.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Friday, June 04, 2004 4:56 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

Why not use the multifunction support in mf.sys instead of writing a
(massively undocumented) resource-allocating bus driver from sratch? While
the mf documentation is a bit skeletal and cryptic, I happen to know from
experience that mf does work and does allow you to poof up serial ports
without having to write either a serial driver or a bus driver.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, June 04, 2004 6:09 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

The COM port interface is not a WDM interface. Serial.sys is
the best example you will have.

The multiport serial support in serial.sys is for ISA devices
and for a very limited set of MPS ISA cards. Ignore it, it
is not relevant for your device.

If your MPS device is basically N times 16550 UARTs and they
are expressed as such (ie 8 1 one byte registers + an
interrupt), you can write a bus driver for your device and
assign each uart to a PDO and then load serial on top of each
PDO. That should work (in theory :).

Otherwise, what I would do is still write a bus driver and
create a child for each port. Then, write another driver
that will control each child. This driver is probably going
to be a 90% wholesale copy of serial.sys. What you would change is

  1. how you get the resources for each port. I would use
    IRP_MN_QUERY_INTERFACE to ask the bus driver to return to you
    a set of resources during start device
  2. how you touch these resources if the serial source isn’t
    doing that properly
  3. if each port is not a true 16550, you might need to
    change serial source to touch the hardware as appropriate
  4. name the driver something other then serial.sys :slight_smile:
  5. install each child under the Ports class. This will auto
    assign you the correct COM port number. In the INF you can
    specify serenum as the upperfilter (see msports.inf on how to
    do that) and then you get serial enumeration as well.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Larson, Jeffrey
Sent: Friday, June 04, 2004 2:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] multiport serial device

?
I am fairly new to driver writing and I am trying to figure
out the best approach to writing a driver for a multiple
serial port pci board. It needs to run on w2k and xp.? Can
someone help me and verify a few assumtions I am making?
?

  • First off, there is no wdm-based serial driver example that
    I could find (at least in DDK) - true?
    ?
  • I notice that in the nt ddk serial port example, there is
    multiport support.? However, from what I have read, it looks
    like?my driver?needs to be a function driver (i.e. I can’t
    implement a filter driver above serial.sys, even though the
    uarts are standard).??So, I have to implement a separate
    driver from serial.sys since this driver is directly
    controlling hardware. true?
    ?
  • My current approach is to take?appropriate?chunks of?code?
    from?the NT-based ddk serial driver, and wedge it into a wdm-> based pci
    device driver skeleton.? Also, to make use of
    serenum.sys to enumerate COM3-COM10.? COM1,2 also use
    serenum.sys and are attached to serial.sys.? Does this sound right?
    ?
    any insight into this would be appreciated, Jeff
    ?

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

It not only ‘works too’, but the source code effort is reduced to just
writing an inf file. The only reason for not using mf.sys in this case is
that your resource partitioning doesn’t match what mf.sys can handle. So
really, the OP should go with the mf solution first, and then only if he
cannot use mf should he go after the other solutions. No driver is the best
driver of all.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, June 04, 2004 8:51 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

That works too as long as the hw can be parsed by MF. If you
go route #2 from my original suggestion, there is no resource
arbitration to the children. The PDO knows its resources b/c
it is the same driver as the parent. To get the resources
from the serial like FDO, you manually query the PDO for the
resources. In the end, no resources are “officially”
assigned to the PDO as far as NTOS is concertned, but you can
still retrieve them from higher in the stack.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Friday, June 04, 2004 4:56 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

Why not use the multifunction support in mf.sys instead of
writing a (massively undocumented) resource-allocating bus
driver from sratch? While the mf documentation is a bit
skeletal and cryptic, I happen to know from experience that
mf does work and does allow you to poof up serial ports
without having to write either a serial driver or a bus driver.

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Friday, June 04, 2004 6:09 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] multiport serial device
>
> The COM port interface is not a WDM interface. Serial.sys
is the best
> example you will have.
>
> The multiport serial support in serial.sys is for ISA
devices and for
> a very limited set of MPS ISA cards. Ignore it, it is not relevant
> for your device.
>
> If your MPS device is basically N times 16550 UARTs and they are
> expressed as such (ie 8 1 one byte registers + an
interrupt), you can
> write a bus driver for your device and assign each uart to
a PDO and
> then load serial on top of each PDO. That should work (in
theory :).
>
> Otherwise, what I would do is still write a bus driver and create a
> child for each port. Then, write another driver that will control
> each child. This driver is probably going to be a 90%
wholesale copy
> of serial.sys. What you would change is
> 1) how you get the resources for each port. I would use
> IRP_MN_QUERY_INTERFACE to ask the bus driver to return to
you a set of
> resources during start device
> 2) how you touch these resources if the serial source isn’t doing
> that properly
> 3) if each port is not a true 16550, you might need to
change serial
> source to touch the hardware as appropriate
> 4) name the driver something other then serial.sys :slight_smile:
> 5) install each child under the Ports class. This will
auto assign
> you the correct COM port number. In the INF you can
specify serenum
> as the upperfilter (see msports.inf on how to do that) and then you
> get serial enumeration as well.
>
> d
>
> ________________________________________
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
Larson, Jeffrey
> Sent: Friday, June 04, 2004 2:58 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] multiport serial device
>
> ?
> I am fairly new to driver writing and I am trying to figure out the
> best approach to writing a driver for a multiple serial port pci
> board. It needs to run on w2k and xp.? Can someone help me
and verify
> a few assumtions I am making?
> ?
> - First off, there is no wdm-based serial driver example
that I could
> find (at least in DDK) - true?
> ?
> - I notice that in the nt ddk serial port example, there is
multiport
> support.? However, from what I have read, it looks like?my driver?
> needs to be a function driver (i.e. I can’t implement a
filter driver
> above serial.sys, even though the uarts are standard).??So,
I have to
> implement a separate driver from serial.sys since this driver is
> directly controlling hardware. true?
> ?
> - My current approach is to take?appropriate?chunks of?code
from?the NT-based ddk serial driver, and wedge it into a
wdm-> based pci device driver skeleton.? Also, to make use of
> serenum.sys to enumerate COM3-COM10.? COM1,2 also use
serenum.sys and
> are attached to serial.sys.? Does this sound right?
> ?
> any insight into this would be appreciated, Jeff
> ?
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@windows.microsoft.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@hollistech.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

I agree.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Saturday, June 05, 2004 4:52 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

It not only ‘works too’, but the source code effort is reduced to just
writing an inf file. The only reason for not using mf.sys in this case is
that your resource partitioning doesn’t match what mf.sys can handle. So
really, the OP should go with the mf solution first, and then only if he
cannot use mf should he go after the other solutions. No driver is the best
driver of all.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, June 04, 2004 8:51 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

That works too as long as the hw can be parsed by MF. If you
go route #2 from my original suggestion, there is no resource
arbitration to the children. The PDO knows its resources b/c
it is the same driver as the parent. To get the resources
from the serial like FDO, you manually query the PDO for the
resources. In the end, no resources are “officially”
assigned to the PDO as far as NTOS is concertned, but you can
still retrieve them from higher in the stack.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Friday, June 04, 2004 4:56 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

Why not use the multifunction support in mf.sys instead of
writing a (massively undocumented) resource-allocating bus
driver from sratch? While the mf documentation is a bit
skeletal and cryptic, I happen to know from experience that
mf does work and does allow you to poof up serial ports
without having to write either a serial driver or a bus driver.

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Friday, June 04, 2004 6:09 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] multiport serial device
>
> The COM port interface is not a WDM interface. Serial.sys
is the best
> example you will have.
>
> The multiport serial support in serial.sys is for ISA
devices and for
> a very limited set of MPS ISA cards. Ignore it, it is not relevant
> for your device.
>
> If your MPS device is basically N times 16550 UARTs and they are
> expressed as such (ie 8 1 one byte registers + an
interrupt), you can
> write a bus driver for your device and assign each uart to
a PDO and
> then load serial on top of each PDO. That should work (in
theory :).
>
> Otherwise, what I would do is still write a bus driver and create a
> child for each port. Then, write another driver that will control
> each child. This driver is probably going to be a 90%
wholesale copy
> of serial.sys. What you would change is
> 1) how you get the resources for each port. I would use
> IRP_MN_QUERY_INTERFACE to ask the bus driver to return to
you a set of
> resources during start device
> 2) how you touch these resources if the serial source isn’t doing
> that properly
> 3) if each port is not a true 16550, you might need to
change serial
> source to touch the hardware as appropriate
> 4) name the driver something other then serial.sys :slight_smile:
> 5) install each child under the Ports class. This will
auto assign
> you the correct COM port number. In the INF you can
specify serenum
> as the upperfilter (see msports.inf on how to do that) and then you
> get serial enumeration as well.
>
> d
>
> ________________________________________
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
Larson, Jeffrey
> Sent: Friday, June 04, 2004 2:58 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] multiport serial device
>
> ?
> I am fairly new to driver writing and I am trying to figure out the
> best approach to writing a driver for a multiple serial port pci
> board. It needs to run on w2k and xp.? Can someone help me
and verify
> a few assumtions I am making?
> ?
> - First off, there is no wdm-based serial driver example
that I could
> find (at least in DDK) - true?
> ?
> - I notice that in the nt ddk serial port example, there is
multiport
> support.? However, from what I have read, it looks like?my driver?
> needs to be a function driver (i.e. I can’t implement a
filter driver
> above serial.sys, even though the uarts are standard).??So,
I have to
> implement a separate driver from serial.sys since this driver is
> directly controlling hardware. true?
> ?
> - My current approach is to take?appropriate?chunks of?code
from?the NT-based ddk serial driver, and wedge it into a
wdm-> based pci device driver skeleton.? Also, to make use of
> serenum.sys to enumerate COM3-COM10.? COM1,2 also use
serenum.sys and
> are attached to serial.sys.? Does this sound right?
> ?
> any insight into this would be appreciated, Jeff
> ?
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@windows.microsoft.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@hollistech.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Oh I see we are in violent agreement again. How boring :slight_smile:

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Saturday, June 05, 2004 11:51 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

I agree.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Saturday, June 05, 2004 4:52 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

It not only ‘works too’, but the source code effort is
reduced to just writing an inf file. The only reason for not
using mf.sys in this case is that your resource partitioning
doesn’t match what mf.sys can handle. So really, the OP
should go with the mf solution first, and then only if he
cannot use mf should he go after the other solutions. No
driver is the best driver of all.

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Friday, June 04, 2004 8:51 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] multiport serial device
>
> That works too as long as the hw can be parsed by MF. If
you go route
> #2 from my original suggestion, there is no resource arbitration to
> the children. The PDO knows its resources b/c it is the
same driver
> as the parent. To get the resources from the serial like FDO, you
> manually query the PDO for the resources. In the end, no resources
> are “officially”
> assigned to the PDO as far as NTOS is concertned, but you can still
> retrieve them from higher in the stack.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
> Sent: Friday, June 04, 2004 4:56 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] multiport serial device
>
> Why not use the multifunction support in mf.sys instead of
writing a
> (massively undocumented) resource-allocating bus driver
from sratch?
> While the mf documentation is a bit skeletal and cryptic, I
happen to
> know from experience that mf does work and does allow you
to poof up
> serial ports without having to write either a serial driver
or a bus
> driver.
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
> > Sent: Friday, June 04, 2004 6:09 PM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] multiport serial device
> >
> > The COM port interface is not a WDM interface. Serial.sys
> is the best
> > example you will have.
> >
> > The multiport serial support in serial.sys is for ISA
> devices and for
> > a very limited set of MPS ISA cards. Ignore it, it is
not relevant
> > for your device.
> >
> > If your MPS device is basically N times 16550 UARTs and they are
> > expressed as such (ie 8 1 one byte registers + an
> interrupt), you can
> > write a bus driver for your device and assign each uart to
> a PDO and
> > then load serial on top of each PDO. That should work (in
> theory :).
> >
> > Otherwise, what I would do is still write a bus driver
and create a
> > child for each port. Then, write another driver that
will control
> > each child. This driver is probably going to be a 90%
> wholesale copy
> > of serial.sys. What you would change is
> > 1) how you get the resources for each port. I would use
> > IRP_MN_QUERY_INTERFACE to ask the bus driver to return to
> you a set of
> > resources during start device
> > 2) how you touch these resources if the serial source
isn’t doing
> > that properly
> > 3) if each port is not a true 16550, you might need to
> change serial
> > source to touch the hardware as appropriate
> > 4) name the driver something other then serial.sys :slight_smile:
> > 5) install each child under the Ports class. This will
> auto assign
> > you the correct COM port number. In the INF you can
> specify serenum
> > as the upperfilter (see msports.inf on how to do that)
and then you
> > get serial enumeration as well.
> >
> > d
> >
> > ________________________________________
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> Larson, Jeffrey
> > Sent: Friday, June 04, 2004 2:58 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] multiport serial device
> >
> > ?
> > I am fairly new to driver writing and I am trying to
figure out the
> > best approach to writing a driver for a multiple serial port pci
> > board. It needs to run on w2k and xp.? Can someone help me
> and verify
> > a few assumtions I am making?
> > ?
> > - First off, there is no wdm-based serial driver example
> that I could
> > find (at least in DDK) - true?
> > ?
> > - I notice that in the nt ddk serial port example, there is
> multiport
> > support.? However, from what I have read, it looks like?my driver
> > needs to be a function driver (i.e. I can’t implement a
> filter driver
> > above serial.sys, even though the uarts are standard).??So,
> I have to
> > implement a separate driver from serial.sys since this driver is
> > directly controlling hardware. true?
> > ?
> > - My current approach is to take?appropriate?chunks of?code
> from?the NT-based ddk serial driver, and wedge it into a
> wdm-> based pci device driver skeleton.? Also, to make use of
> > serenum.sys to enumerate COM3-COM10.? COM1,2 also use
> serenum.sys and
> > are attached to serial.sys.? Does this sound right?
> > ?
> > any insight into this would be appreciated, Jeff
> > ?
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@windows.microsoft.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@hollistech.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@windows.microsoft.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@hollistech.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

A faced a similar problem 6 months ago. Here is what I did:
First I tried to use mf.sys and the standard serial driver (see Doron’s
advice). This is the best approach, if you can make it work. It did’t work
for me, the description of the problems is in the “VaryingResourceMap and
mf.sys problem” thread on microsoft.public.development.device.drivers.

Then I wrote a bus driver for my pci device (actually generated code from
Compuware’s DriverStudio). The driver creates an FDO for the card and PDO’s
for each port. For each such PDO Device Manager will call the Found New
Hardware Wizard that asks for an inf file. A null inf file is provided in
the distribution that tells XP that no separate driver for port devices is
needed. For this to work, you need to set deviceCapabilities->RawDeviceOK =
TRUE in the IRP_MN_QUERY_CAPABILITIES handler. You may want to look at
http://groups.google.com/groups?q=eliyas+virtual+com+port+group:comp.os.ms-w
indows.programmer.nt.kernel-mode+group:comp.os.ms-windows.programmer.nt.kern
el-mode&hl=en&selm=vNBj7.20948%24MK5.13372145%40news1.sttln1.wa.home.com&rnu
m=1 for info on null inf file. I put all the serial - specific functionality
from the DDK’s serial sample in the PDOs. The resulting driver consists of
one binary.

Slawomir

“Larson, Jeffrey” wrote in message
news:xxxxx@ntdev…

I am fairly new to driver writing and I am trying to figure out the best
approach to writing a driver for a multiple serial port pci board. It needs
to run on w2k and xp. Can someone help me and verify a few assumtions I am
making?

- First off, there is no wdm-based serial driver example that I could find
(at least in DDK) - true?

- I notice that in the nt ddk serial port example, there is multiport
support. However, from what I have read, it looks like my driver needs to
be a function driver (i.e. I can’t implement a filter driver above
serial.sys, even though the uarts are standard). So, I have to implement a
separate driver from serial.sys since this driver is directly controlling
hardware. true?

- My current approach is to take appropriate chunks of code from the
NT-based ddk serial driver, and wedge it into a wdm-based pci device driver
skeleton. Also, to make use of serenum.sys to enumerate COM3-COM10. COM1,2
also use serenum.sys and are attached to serial.sys. Does this sound right?

any insight into this would be appreciated,
Jeff

The NULL should be in the PORTS class so that the ports class installer
runs and assigns you a COM port name. (You should not be guessing at
the name or assigning yourself a name, let the system assign it to you).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Slawek
Sent: Monday, June 07, 2004 9:40 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] multiport serial device

A faced a similar problem 6 months ago. Here is what I did:
First I tried to use mf.sys and the standard serial driver (see Doron’s
advice). This is the best approach, if you can make it work. It did’t
work
for me, the description of the problems is in the “VaryingResourceMap
and
mf.sys problem” thread on microsoft.public.development.device.drivers.

Then I wrote a bus driver for my pci device (actually generated code
from
Compuware’s DriverStudio). The driver creates an FDO for the card and
PDO’s
for each port. For each such PDO Device Manager will call the Found New
Hardware Wizard that asks for an inf file. A null inf file is provided
in
the distribution that tells XP that no separate driver for port devices
is
needed. For this to work, you need to set
deviceCapabilities->RawDeviceOK =
TRUE in the IRP_MN_QUERY_CAPABILITIES handler. You may want to look at
http://groups.google.com/groups?q=eliyas+virtual+com+port+group:comp.os.
ms-w
indows.programmer.nt.kernel-mode+group:comp.os.ms-windows.programmer.nt.
kern
el-mode&hl=en&selm=vNBj7.20948%24MK5.13372145%40news1.sttln1.wa.home.com
&rnu
m=1 for info on null inf file. I put all the serial - specific
functionality
from the DDK’s serial sample in the PDOs. The resulting driver consists
of
one binary.

Slawomir

“Larson, Jeffrey” wrote in message
news:xxxxx@ntdev…

I am fairly new to driver writing and I am trying to figure out the best
approach to writing a driver for a multiple serial port pci board. It
needs
to run on w2k and xp. Can someone help me and verify a few assumtions I
am
making?

- First off, there is no wdm-based serial driver example that I could
find
(at least in DDK) - true?

- I notice that in the nt ddk serial port example, there is multiport
support. However, from what I have read, it looks like my driver needs
to
be a function driver (i.e. I can’t implement a filter driver above
serial.sys, even though the uarts are standard). So, I have to
implement a
separate driver from serial.sys since this driver is directly
controlling
hardware. true?

- My current approach is to take appropriate chunks of code from the
NT-based ddk serial driver, and wedge it into a wdm-based pci device
driver
skeleton. Also, to make use of serenum.sys to enumerate COM3-COM10.
COM1,2
also use serenum.sys and are attached to serial.sys. Does this sound
right?

any insight into this would be appreciated,
Jeff


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks for the suggestions. I have another question. Serenum is a bus
driver, says the documentation, so can I use serenum.sys to sit on top of
serial.sys without creating my own driver?

(background: I am writing a w2k/xp driver for a multiport serial device on
pci bus)

thanks,
Jeff

serenum is for enumerating devices attached to serial ports. You need a bus
driver that instead enumerates serial ports themselves. Use Mf.sys or roll
your own.


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Larson, Jeffrey
Sent: Friday, June 11, 2004 11:44 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] multiport serial device

Thanks for the suggestions. I have another question. Serenum is a bus
driver, says the documentation, so can I use serenum.sys to sit on top of
serial.sys without creating my own driver?

(background: I am writing a w2k/xp driver for a multiport serial device on
pci bus)

thanks,
Jeff


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

One the ports are individually enumerated, placing serenum.sys as a device upper filter will then enable enumeration on the ports themselves of serial devices. Unless you are using msports.inf to install serial.sys, you will need to explicitly install serenum.sys on top of your serial port driver.

d


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Friday, June 11, 2004 9:12 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] multiport serial device

serenum is for enumerating devices attached to serial ports. You need a bus driver that instead enumerates serial ports themselves. Use Mf.sys or roll your own.


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Larson, Jeffrey
Sent: Friday, June 11, 2004 11:44 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] multiport serial device
?
Thanks for the suggestions. I have another question.? Serenum is a bus driver, says the documentation,?so can I use serenum.sys to sit on top of serial.sys without creating my own driver??
?
(background: I am writing a w2k/xp driver for a multiport serial device on pci bus)
?
thanks,
Jeff
?
?

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Serenum’s goal is to do auto-detection of mice or other serial-attached PnP hardware.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Larson, Jeffrey
To: Windows System Software Devs Interest List
Sent: Friday, June 11, 2004 7:43 PM
Subject: RE:[ntdev] multiport serial device

Thanks for the suggestions. I have another question. Serenum is a bus driver, says the documentation, so can I use serenum.sys to sit on top of serial.sys without creating my own driver?

(background: I am writing a w2k/xp driver for a multiport serial device on pci bus)

thanks,
Jeff


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

That is correct. It is and UpperFilter in the register for the Serial FDOs. It is a very good example adding functionality in this case PnP detection to a FDO. The source code for serenum is in the DDK too.
“Maxim S. Shatskih” wrote in message news:xxxxx@ntdev…
Serenum’s goal is to do auto-detection of mice or other serial-attached PnP hardware.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Larson, Jeffrey
To: Windows System Software Devs Interest List
Sent: Friday, June 11, 2004 7:43 PM
Subject: RE:[ntdev] multiport serial device

Thanks for the suggestions. I have another question. Serenum is a bus driver, says the documentation, so can I use serenum.sys to sit on top of serial.sys without creating my own driver?

(background: I am writing a w2k/xp driver for a multiport serial device on pci bus)

thanks,
Jeff


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com