Help: confused about the Root bus driver

Hello,

I have an device hanging off an unintelligent bus. Some have suggested that I

associate my device (and its bus) with the Root bus driver. Is this just a matter of

  1. writing a .INF file for my driver

  2. have the PnP (WDM) dispatch routines like Add Device, etc. in my driver ??

Another question: if I install the above-mentioned .INF file in \winnt\inf, will the PnP

manager process it and load my driver?

Thank you and regards, Vasili


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Vasili,

In order to understand how to handle your situation, you must understand
how devices are enumerated on 2000 and later Operating Systems.
Essentially, every device in the system is enumerated by some bus driver.
For instance the PCI bus driver enumerates (reports the existance and
hardware IDs to the OS), every PCI device in the system. For this to
work, every device must be enumerable by some bus. For PCI, USB, 1394,
and some others this is straightforward as these buses are truly
Plug-and-Play. That is, the bus drivers can interrogate the hardware
devices directly. But what happens with devices that the system cannot
interrogate such as ISA devices, or software only virtual devices? Well
it turns out the ROOT bus was created just for this purpose.

When a bus driver is enumerating its bus it seeks to get the hardware
identifier for each device on the bus. So, for example, the PCI bus
driver will walk the PCI configuration space and attempt to get the Vendor
and Device IDs for every PCI device on the PCI bus. For each hardware ID
found, the bus driver creates a DeviceObject, called a Physical Device
Object or PDO in this case, and reports this DeviceObject to the PnP
manager. This reports the existance of the device to the PnP manager.
The PnP manager subsequently will query the bus driver for the hardware
IDs related to the PDO it has received. The PnP manager will take a given
hardware ID received from the bus driver and attempt to locate an INF file
with this hardware ID specified in it. For instance, if the PCI bus
driver were to report a device with Vendor ID 0x1234 and Device ID 0x5678,
the PnP manager will attempt to find an INF file with something like the
following:

%DeviceDesc%=PlxDriver_DDI, PCI\VEN_1234&DEV_5678

Once found the INF is used to force a load of the functional driver
(device driver) for this particular PCI device. The device driver in turn
creates a new DeviceObject called a Functional Device Object or FDO which
is attached on top of the PDO previously created by the bus driver.

For non-PnP devices, be they real or virtual, there is no bus driver that
can go and interrogate the device to get a hardware ID directly. So, in
this case the driver writer can let the system know that it needs to
create a device with a particular ID by specifying that the device sit on
the ROOT bus. This can be done simply by specifying an ID in the INF file
like this:

%BogusDevice%=Bogus_DDI, root\bogus

This tells the PnP manager that no bus will ever find this device on its
own, and that the root bus needs to handle enumerating this device. For
something like an ISA device, the INF can go on to specify resources for
the device in a LogConfig section, as again the device cannot be
interrogated.

As for copying your INF file to the %windows%\system32\inf directory,
don’t ever do this directly. If the PnP manager does not find an INF for
a particular PnP device, it will prompt the user for a disk. For root
enumerated devices in which the INF provides the info necessary for
enumeration, you can install the device using DeviceManager or the Add
Hardware Wizard, or programmatically using the SetupDI API provided in the
Platform SDK. For an example of using this API see the DevCon sample in
the DDK.

Hope this helps.

Bill McKenzie

–0-571525515-1042505758=:94166
Content-Type: text/plain; charset=us-ascii

Hello,

I have an device hanging off an unintelligent bus. Some have suggested that I

associate my device (and its bus) with the Root bus driver. Is this just a matter of

  1. writing a .INF file for my driver

  2. have the PnP (WDM) dispatch routines like Add Device, etc. in my driver ??

Another question: if I install the above-mentioned .INF file in \winnt\inf, will the PnP

manager process it and load my driver?

Thank you and regards, Vasili


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
–0-571525515-1042505758=:94166
Content-Type: text/html; charset=us-ascii

Hello,

     I have an device hanging off an unintelligent bus. Some have suggested that I

associate my device (and its bus) with the Root bus driver. Is this just a matter of

  1. writing a .INF file for my driver
  1. have the PnP (WDM) dispatch routines like Add Device, etc. in my driver ??

Another question: if I install the above-mentioned .INF file in \winnt\inf, will the PnP

manager process it and load my driver?

 

Thank you and regards, Vasili


Do you Yahoo!?

Yahoo! Mail Plus - Powerful. Affordable. Sign up now
–0-571525515-1042505758=:94166–