Computer Engineering; Software Engineering
Device drivers are software interfaces that allow a computer's central processing unit (CPU) to communicate with peripherals such as disk drives, printers, and scanners. Without device drivers, the computer's operating system (OS) would have to come preinstalled with information about all of the devices it could ever need to communicate with. OSs contain some device drivers, but these can also be installed when new devices are added to a computer.
The main strength of device drivers is that they enable programmers to write software that will run on a computer regardless of the type of devices that are connected to that computer. Using device drivers allows the program to simply command the computer to save data to a file on the hard drive. It needs no specific information about what type of hard drive is installed in the computer or connections the hard drive has to other hardware in the computer. The device driver acts as an interface between computer components.
When a program needs to send commands to a peripheral connected to the computer, the program communicates with the device driver. The device driver receives the information about the action that the device is being asked to perform. It translates this information into a format that can be input into the device. The device then performs the task or tasks requested. When it finishes, it may generate output that is communicated to the driver, either as a message or as a simple indication that the task has been completed. The driver then translates this information into a form that the original program can understand. The device driver acts as a kind of translator between the computer and its peripherals, conveying input/ output instructions between the two. Thus, the computer program does not need to include all the low-level commands needed to make the device function. The program only needs to be able to tell the device driver what it wants the device to do. The device driver takes care of translating this into concrete steps.
Writing device drivers is a highly technical undertaking. It is made more challenging by the fact that device drivers can be unforgiving when a mistake is made in their creation. This is because higher-level applications do not often have unlimited access to all of the computer's functionality. Issuing the wrong command with unrestricted privileges can cause serious damage to the computer's operating system (OS) and, in some cases, to the hardware. This is a real possibility with device drivers, which usually need to have unrestricted access to the computer.
Because writing a device driver requires a lot of specialized information, most device drivers are made by software engineers who specialize in driver development and work for hardware manufacturers. Usually the device manufacturer has the most information about the device and what it needs to function properly. The exception to this trend is the impressive amount of driver development accomplished by the open-source movement. Programmers all over the world have volunteered their own time and talent to write drivers for the Linux OS.
Often development is separated into logical and physical device driver development. Logical device driver development tends to be done by the creator of the OS that the computer will use. Physical device driver development, meanwhile, is handled by the device manufacturer. This division of labor makes sense, but it does require coordination and a willingness to share standards and practices among the various parties.
Virtual device drivers are a variation on traditional device drivers. They are used when a computer needs to emulate a piece of hardware. This often occurs when an OS runs a program that was created for a different OS by emulating that operating environment. One example would be a Windows OS running a DOS program. If the DOS program needed to interface with an attached printer, the computer would use a virtual device driver.
Most OSs now include device managers that make it easier for the user to manage device drivers. They allow the user to diagnose problems with devices, troubleshoot issues, and update or install drivers. Using the graphical interface of a device manager is less intimidating than typing in text commands to perform driver-related tasks.
—Scott Zimmer, JD
Corbet, Jonathan, Alessandro Rubini, and Greg Kroah-Hartman. Linux Device Drivers. 3rd ed. Cambridge: O'Reilly, 2005. Print.
McFedries, Paul. Fixing Your Computer: Absolute Beginner's Guide. Indianapolis: Que, 2014. Print.
Mueller, Scott. Upgrading and Repairing PCs. 22nd ed. Indianapolis: Que, 2015. Print.
Noergaard, Tammy. Embedded Systems Architecture: A Comprehensive Guide for Engineers and Programmers. 2nd ed. Boston: Elsevier, 2012. Print.
Orwick, Penny, and Guy Smith. Developing Drivers with the Windows Driver Foundation. Redmond: Microsoft P, 2007. Print.
“What Is a Driver?” Microsoft Developer Network. Microsoft, n.d. Web. 10 Mar. 2016.