device driver presented by: syed zulfiqar ali qurat ul ain aslam samina kanwal sana zahid presented...

19
Device Driver Presented By: Syed Zulfiqar Ali Qurat Ul Ain Aslam Samina Kanwal Sana Zahid Presented To: Miss Madiha Zafar

Upload: octavia-ray

Post on 22-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Device DriverPresented By: Syed Zulfiqar Ali

Qurat Ul Ain Aslam

Samina Kanwal

Sana Zahid

Presented To: Miss Madiha Zafar

What is a device driver?

• A device driver is a system program or application that controls a particular type of device that is connected to your computer.• A device driver or software driver is a computer

program, application allowing higher-level computer programs to interact with a hardware device.• A device driver essentially converts the more generic

input/output instructions of your operating system to message that the device type can understand and interpret.

Continue…

Why a device driver ?

• A device driver simplifies programming by acting as an abstraction layer between a hardware device and the applications or operating systems that use it• The higher-level application code can be written independently of

whatever specific hardware device it will ultimately control, as it can interface with it in a standard way, regardless of the underlying hardware.• The device-driver accepts the generic high-level commands and breaks

them into a series of low-level device-specific commands as required by the device being driven.

Why a device driver ? .. [contd.]

• Device Drivers can provide a level of security as they can run in kernel-mode, thereby protecting the operating system from applications running in user-mode.

Ring 0

Kernel

Ring 1Ring 2

Ring 3

Device Drivers

Device Drivers

Applications

Lest Privileged

Most Privileged

Privilege rings available

Does every hardware or a device connected to pc requires device driver?

• No when you buy an operating system many device drivers are built in into operating system itself.

• however 3-6 months down the line if you attach a device which your operating system doesnot understand then device driver is required

How does a driver communicates with hardware?

• A device driver typically communicates with the device through the computer bus or communications subsystem to which the hardware is connected

Device Driver design

Logical LayerLogical layers process data

for a class of devices such as ethernet ports or disk drives

A serial port needs to handle standard communication protocols such as XON/XOFF . This is managed by a

serial port logical layer.

Device Driver Design …[Contd.]

OS

Logical layer

Physical layer

Hardware request

Development

• Writing a device driver requires an in-depth understanding of how the hardware and the software works for a given platform function.

• Because drivers require low-level access to hardware functions in order to operate, drivers typically operate in a highly privileged environment and can cause disaster if they get things wrong.

• In contrast, most user-level software on modern operating systems can be stopped without greatly affecting the rest of the system.

• Even drivers executing in user mode can crash a system if the device is erroneously programmed.

• These factors make it more difficult and dangerous to diagnose problems.

Kernel mode vs. user mode

• Device drivers, particularly on modern Microsoft Windows platforms, can run in kernel-mode (Ring 0 on x86 CPUs) or in user-mode (Ring 3 on x86 CPUs).

• 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.

How Drivers are accessed ?

• System initialization• System calls from user processes • User-level requests• Device interrupts• Bus reset

Application

• Because of the diversity of modern hardware and operating systems, drivers operate in many different environments.Drivers may interface with:

• printers• video adapters• Network cards• Sound cards• Local buses of various sorts—in particular, for bus mastering on modern

systems• Low-bandwidth I/O buses of various sorts (for pointing devices such as mice

, keyboards, USB, etc.)• Computer storage devices such as hard disk, CD-ROM, and floppy disk

 buses (ATA, SATA, SCSI)• Implementing support for different file systems• Image scanners• Digital cameras

Are there any types in device driver?

Yes there are two types

• A: Open Driver file usually has a file name suffix of dll or exe

• B: A virtual device driver with suffix VXD.

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,linux iis running virtually under windows.

• Instead of enabling the guest operating system to dialog with hardware, virtual device drivers take the opposite role and emulate a piece of hardware, so that the guest operating system and its drivers running inside a virtual machine can have the illusion of accessing real hardware.

• There are several variants of virtual device drivers, such as VxDs, VLMs, VDDs.

Device Drivers List Installed On A System…

Sound Driver Detail And Files Detail…

Questions???

That’s All…