Drivers are group of files that enable one or more hardware device to communicate with the computer's operating system.
Without drivers the computer not be able to send and receive data correctly to the hardware devices such as printer.
If appropriate driver is not installed, the device may not perform properly.
A driver communicates with the device through the computer bus or communications subsystem to which the hardware connects.
Working process
The driver, which was written by the same company that designed and manufactured the device.
So that it knows how to communicate with the device hardware to get the data.
After the driver gets the data from the device, it returns the data to the operating system, which returns it to the application.
Not all drivers communicate directly with a device.
They just manipulate the request and pass the request along to drivers that are lower in the stack.
Types
Block device driver
Block device drivers support devices that handle fixed rather than variable amounts of data and access physically addressable storage media or support file system access.
Hard disks and flash memory are common types of block devices.
Character device driver
A character device typically transfers data to and from a user application.
They behave like pipes or serial ports, instantly reading or writing the byte data in a character-by-character stream.
Line printers, interactive terminals, and graphics displays are character device.
Network device driver
A network device driver is a device driver that enables a network device to communicate between the computer and operating system as well as with other network computers and network devices.
It receive and transmit data packets on hardware interface that connect to external systems, and provide a uniform interface that network protocols can access.
Network adapter are network devices.
Pseudo device driver
Not all device drivers control physical hardware, such type of drivers are called pseudo driver.
These drivers do not operate on a bus.
Pseudo drivers are pty terminal drivers are used in remote login.
Advantages
It simplifies the programming by acting as a layer between hardware device and application or operating system.
A higher level application code can be written for a specific hardware device.
It accept generic high level commands and break them into low level device specific command according to device.
It gives security to protect the operating system running at user level.
Disadvantages
Real time system need to guarantee that certain workloads should be complete a specific time.
Direct memory is not possible.
Each device driver's code may be run on different execution context which make the resource counting difficult.
No comments: