- A computer program that operates or controls a particular type of device that is attached to a computer is called driver.
- Driver provides a software interface to hardware devices, enabling operating systems and other computer programs to access hardware functions without needing to know precise details of hardware being used.
- A driver communicates with the device through the computer bus or communication subsystem to which the hardware connects.
- The main purpose of device drivers is to provide abstraction by acting as translator between a hardware and the applications or operating systems that use it.
Development:
- Apple has an open source framework for developing drivers on Mac OS X called I/O Kit.
- The Microsoft Window .sys files and Linux .ko modules contains loadable device drivers.
- The advantages of loadable drivers is that they can be loaded only when necessary and then unloaded, thus saving kernel memory.
Kernel mode vs User mode:
- On modern Microsoft windows platforms, can run in kernel mode or user mode.
- The primary benefit of running a driver in user mode is improved stability, since a poorly writing user mode device driver can't crash the system by overwrite kernel memory.
- Kernel space can be accessed by user module only through the use of system calls.
- End user programs like Unix shell or other GUI based applications are part of the user space.
Applications:
- Printers
- Video adapters
- Network cards
- Sound cards
- Image scanners
- Digital cameras.....etc
Some more examples:
My notes images: