0

It occurred to me that I don't actually understand the difference between native port drivers (that is, the native serial/parallel/USB/etc. drivers on each OS) vs. external hardware-specific device drivers.

For instance, if my OS already has a USB driver on it (for communicating with USB devices over the USB interface/port), then why does my shiny new webcam (or printer) come with its own device driver?

Is it that the "port/interface drivers" deal with setting up the electrical connections with external/peripheral devices, and that device drivers use those drivers to give specific I/O commands to the devices? So maybe something like:

enter image description here

Am I correct here or way off base? In other words, in the scenario above, are there actually two drivers being used (one for the device and one for the USB port)?

  • If so, then what is the division of labor between the two drivers?
  • Else, then why do most OSes have native port drivers (serial, USB, etc.), and why do things like keyboard, mice, webcams, printers, etc. have their own device drivers?

1 Answer 1

1

You are not way off base, but not entirely correct either. Every USB device advertise itself as a member of certain pre-defined class of devices - HID, COM, Mass Storage, webcam, etc. As such, these devices indicate to OS that they conform to certain well-defined functionality. The OS will load a generic driver for this class, and you should expect basic functionality from that device.

However, many device manufacturers want differentiate themselves from others, and incorporate some extended functionality, like auto-focus, or special buttons, or extra formats, etc. In this case the manufacturer would provide his own driver, which is VID/PID specific. If this driver is installed, the OS will load it every time, so you will have new shiny functionality from your new device. The way how the custom driver is implemented may differ. It could be a completely custom driver, or it could be some modification of the default driver using a method known as "filter driver" in Microsoft world, something like in your picture. How the product-specific drivers are implemented in Android/Linux, you better ask people in corresponding forums.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .