Role of device drivers

Updated: April 19, 2023

Device drivers enable publishers to communicate with attached devices by supporting POSIX system calls such as open() and read(). Publishers issue these system calls to drivers to obtain information about the devices that the drivers manage; they then publish the information to PPS objects that applications monitor. Using this information, applications can issue PPS commands to perform actions such as setting the power of a USB hub or ejecting a CD.

Here is a summary of how the device publishers typically interact with their corresponding drivers:
Activity usblauncher_otg mmcsdpub cdpub
Driver startup USB launcher service starts and stops drivers when devices are added or removed Driver launched at system startup and runs continuously Driver launched at system startup and runs continuously
Driver communication

Drivers create entries in /dev for attached USB devices and manage communication with USB-connected devices: mass storage, DVD, SD Card, etc.

The service monitors /dev entries and, when it notices a state change, asks the driver to retrieve device and mount information, which it then publishers through PPS.a

The service also gets event notifications (e.g., device insertions and removals) from the USB server; it then writes these to PPS.

The driver creates entries in /dev for attached devices and manages communication with SD cards.

The service monitors /dev entries and, when it notices a state change, asks the driver to retrieve device and mount information, which it then publishes through PPS.

The driver creates entries in /dev for CD devices and manages communication with DVDs, audio CDs, CD-ROMs, etc.

The service monitors /dev entries and, when it notices a state change, asks driver to retrieve device and mount information, which it then publishes through PPS.

Note: In previous releases, device publishers could use the media content detector, mcd, to automatically mount filesystems on connected USB devices. This functionality formerly provided by mcd is now incorporated into the USB launcher service. To perform filesystem mounting on an SD Card or CD device, you can use the auto-mount capabilities of the appropriate block driver.
a The usblauncher_otg service doesn't perform device-specific actions, such as ejecting the disc in a USB optical drive. Such actions are managed by the other publishers (in this case, cdpub).