简体   繁体   English

windows设备驱动程序中pdo和fdo有什么区别?

[英]what is the difference between pdo and fdo in windows device drivers?

I am studying windows device drivers on my own and I find it's very difficult to differentiate between PDO and FDO. 我正在研究自己的Windows设备驱动程序,我发现很难区分PDO和FDO。 Let me tell you the flow that I have in my head correct me if I am wrong !! 让我告诉你,如果我错了,我头脑中的流量会纠正我!

when system boots it loads the root bus driver that will create a FDO. 系统启动时,它会加载将创建FDO的根总线驱动程序。 Now it will enumerates its child devices and i guess some hot plug method of the bus driver will be called, when a new child will be found and that method will notify the PNP manager. 现在它将枚举其子设备,并且我想在将找到一个新的子项并且该方法将通知PNP管理器时将调用总线驱动程序的一些热插拔方法。 PNP manager will call the AddDevice() routine of the root bus driver and that will intern create PDOs for new buses like one for PCI and etc. Please explain the whole flow in detail, this is just my imagination. PNP管理器将调用根总线驱动程序的AddDevice()例程,并将为新总线创建PDO,如PCI等等。请详细解释整个流程,这只是我的想象。 And then it is documented that system will load the functional driver for the PCI bus that will create the FDO ?? 然后记录系统将加载PCI总线的功能驱动程序,这将创建FDO ?? what is this FDO?? 这个FDO是什么? and why would i need that?? 为什么我需要那个? According to me PCI bus driver should also follow the same as done by the root bus, enumerate its child and create PDOs for them, or by this FDO they mean PDO only ?? 根据我的说法PCI总线驱动程序也应该遵循与根总线相同的操作,枚举其子节点并为它们创建PDO,或者通过这个FDO它们仅意味着PDO? I am so much confused :( !! 我很困惑:( !!

What are you actually doing, or are you just trying to learn? 你在做什么,或者你只是想学习? I am just wondering how you ended up this low down in the stack. 我只是想知道你是如何在筹码中结束这个低点的。

PDO = Physical Device Object PDO =物理设备对象

FDO = Functional Device Object FDO =功能设备对象

A PDO acts as a physical device, but it does not necessarily have to be physical. PDO 充当物理设备,但它不一定是物理设备。 It is essentially the interface between a device on a bus, and the bus itself. 它本质上是总线上的设备和总线本身之间的接口。 This is pretty well covered on MSDN. 这在MSDN上已经很好地介绍了。

Here is an example that uses USB sticks and this illustrates the difference quite well. 是一个使用USB记忆棒的例子,这很好地说明了差异。

Here is a more in depth explanation and the important quote 是一个更深入的解释和重要的引用

If your point of reference is the PCI bus, then Pci.sys is the function driver. 如果您的参考点是PCI总线,那么Pci.sys是功能驱动程序。 But if your point of reference is the Proseware Gizmo device, then Pci.sys is the bus driver. 但如果您的参考点是Proseware Gizmo设备,那么Pci.sys就是总线驱动程序。 This dual role is typical in the PnP device tree. 这种双重角色在PnP设备树中是典型的。 A driver that serves as function driver for a bus also serves as bus driver for a child device of the bus. 用作总线的功能驱动器的驱动器也用作总线的子设备的总线驱动器。

You also have filter drivers which allow you to sit between PDO's and FDO's and start doing naughty stuff like hiding files, POC rootkits etc. At this stage you can add extra functionality, or completely prevent access to the PDO. 你也有过滤器驱动程序,它允许你坐在PDO和FDO之间,并开始做顽皮的东西,如隐藏文件,POC rootkit等。在这个阶段,你可以添加额外的功能,或完全阻止访问PDO。

And here is all the MSDN links. 这里是所有MSDN链接。

http://msdn.microsoft.com/en-us/library/windows/hardware/hh439632(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/ff554721(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/hh439643(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/ff554731(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/ff564859(v=vs.85).aspx http://technet.microsoft.com/en-us/library/cc776371(v=ws.10).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/hh439632(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/ ff554721(v = vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/hh439643(v=vs.85).aspx http://msdn.microsoft.com/ en-us / library / windows / hardware / ff554731(v = vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/ff564859(v=vs.85).aspx http://technet.microsoft.com/en-us/library/cc776371(v=ws.10).aspx

If that doesn't clear it up for you, feel free to post back. 如果这不能为您清除,请随时回复。

在Windows驱动程序模型中分层设备对象和驱动程序。

Here is the excerpt form "Programming the Microsoft Windows Driver Model", 2nd edition, Walter One: 以下是“编程Microsoft Windows驱动程序模型”的摘录形式,第2版,Walter One:

- PDO stands for physical device object. The bus driver uses this
   object to represent the connection between the device and  the bus. 
    
 - FDO stands for function device object. The function driver uses
   this object to manage the functionality of the device.   
 - FiDO stands
   for filter device object. A filter driver uses this object as a place
   to store the information it needs to keep  about the hardware and its
   filtering activities. (The early beta releases of the Windows 2000
   DDK used the term FiDO,  and I adopted it then. The DDK no longer
   uses this term because, I guess, it was considered too frivolous.)

Hope this helps you out. 希望这可以帮助你。

According to me PCI bus driver should also follow the same as done by the root bus, enumerate its child and create PDOs for them -- WRONG! According to me PCI bus driver should also follow the same as done by the root bus, enumerate its child and create PDOs for them - WRONG! .

If you are talking about WDM, PnP Manager creates PDOs. 如果您正在谈论WDM,PnP管理器会创建PDO。 Earlier to that, YOU had to create it(after detection of device) in DriverEntry() . 在此之前, YOU必须在DriverEntry()创建它(在检测到设备之后DriverEntry()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM