Device Drivers

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

M.I.E.

T Bhandara
Topic-Device Drivers

Presented by - Faroog Fatma Jafri


Definition
• In computing, a device driver or software driver is
a computer program allowing higher-level computer
programs to interact with a hardware device.
• A device driver simplifies programming by acting as
translator between a hardware device and the
applications or operating system that use it.
Why Do We Need Device Drivers?
• In the early days of computers, programmers wrote
programs that worked directly at the hardware level.
• If the program needed to access information from an
external piece of machinery such as a card reader for
instance, the program had to deal directly with that
card reader in a highly detailed way.
• The same program might not work with a different
card reader, even when running on the same type of
computer, meaning that the program would have to be
rewritten.
Functions

• A device driver processes the request of an


application and then sends the instruction to the
hardware device to produce the output.
• A device driver typically has a configuration
interface that can be accessed so that the user can
make adjustments to the hardware device.
Design
• Device drivers can be abstracted into logical
and physical layers.
• Logical layers process data for a class of devices such
as Ethernet ports or disk drives.
• Physical layers communicate with specific device
instances.
• For example, a serial ports needs to handle standard
communication protocols such as XON/OFF that are
common for all serial port hardware.
The Structure Of A Device Driver

• A device driver by its nature has a very rigid


structure.
• DOS must be able to work properly with any driver,
so all drivers must follow an agreed upon design.
• Every driver is made up of three parts: the device
header, the strategy routine, and the interrupt routine,
and are everything that DOS needs to use the driver.
File Types

• A device driver can have a file type of DLL or EXE


depending on what type or program is being used.
• Many software programs that communicate with a
device use a combination of DLL and EXE files in
order for the device to function properly.
• An example of this would be a TV Tuner card.
Kernel-mode vs user-mode
• Device drivers, particularly on modern Windows
platforms, can run in kernel-mode0 (Ring ) or in user-
mode (Ring 3).
• The primary benefit of running a driver in user mode
is improved stability, since a poorly written user
mode device driver cannot crash the system by
overwriting kernel memory. 
• On the other hand, user/kernel-mode transitions
usually impose a considerable performance overhead,
thereby prohibiting user mode-drivers for low latency
and high throughput requirements.
Applications
Drivers may interface with:
• Printers
• Video adapters
• Network Cards
• Sound Cards
•  Devices such as Hard Disk, CD-ROM and Floppy
Disk buses (ATA, SATA, SCSI)
• Image Scanners
• Digital Cameras etc
Virtual device drivers

• Virtual device drivers represent a particular variant of


device drivers. They are used to emulate a hardware
device, particularly in virtualization environments.
• For example when a DOS program is run on
a Microsoft Windows computer or when a
guest operating system is run on, for example,
a Xen host.
Thank You

You might also like