device drivers

18
Device Drivers Modeling Device Driver Effects in Real-Time Schedulability Analysis: Study of a Network Driver By Lewandowski, M. Stanovich, M.J. Baker, T.P. Gopalan, K. An-I Wang Dept. of Computer. Sci., Florida State Univ., Tallahassee, FL;

Upload: suhas-s-r

Post on 24-May-2015

5.565 views

Category:

Technology


1 download

DESCRIPTION

My Presentation of technical seminar held in college

TRANSCRIPT

Page 1: Device Drivers

Device Drivers

Modeling Device Driver Effects in Real-Time Schedulability Analysis: Study of a Network Driver

ByLewandowski, M. Stanovich, M.J. Baker, T.P.

Gopalan, K. An-I Wang Dept. of Computer. Sci., Florida State Univ.,

Tallahassee, FL;

Page 2: Device Drivers

Presentation overview

Introduction to device drivers

Design of device drivers

Device drivers working

Device drivers in real time

Scheduling process

Case studies

References

Page 3: Device Drivers

What is a device driver?

A device driver or software driver is a computer program allowing higher-level computer programs to interact with a hardware device.

Device drivers are integral components of operating systems.

Page 4: Device Drivers

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.

Page 5: Device Drivers

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.

Why a device driver ? .. [contd.]

Ring 0

Kernel

Ring 1Ring 2

Ring 3

Device Drivers

Device Drivers

Applications

Lest Privileged

Most Privileged

Privilege rings available

Page 6: Device Drivers

Device Driver design

Page 7: Device Drivers

Device Driver Design …[Contd.]

Page 8: Device Drivers

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

How Drivers are accessed ?

Page 9: Device Drivers

Disadvantages of device drivers in real time

Real-time systems need to guarantee that certain workloads can be completed within specified time constraints.

Device drivers have traditionally been a weak spot of most operating systems, especially in terms of accounting and control of the resources consumed by these software components.

Each device driver’s code may run in multiple (possibly concurrent) execution contexts which makes the resource accounting difficult, if not impossible.

Device drivers are scheduled in a hierarchy of ad hoc mechanisms, namely hard interrupt service routines (ISR), softirqs, and process or thread contexts, in decreasing order of execution priorities.

Page 10: Device Drivers

Every device driver interrupt must be handled in real time, i.e. as and when the driver routine is called.

For this there has to be a Schedulability mechanism to do it in real time.

We discuss here the Demand based Schedulability and its analysis on device drivers.

There are two approaches to DBS analysis i) Measure of computational demand ii)Ad-hoc mechanisms to schedule a-periodic tasks

How to overcome it?

Page 11: Device Drivers

What is a demand analysis ?

A job is a schedulable component of computational work with a release time, a deadline, and an execution time.

The computational demand of a job J in a given time interval (a, b) for a given schedule, denoted by demand J(a, b), is defined to be the actual amount of processor time consumed by that job within the interval.

Every job will be completed on time as long as the sum of its own execution time and the interference caused by the execution of other higher priority jobs within the same time window during which the job must be completed add up to no more than the length of the window.

A job Jk released at time rk with deadline rk +dk and execution time ek will be completed by its deadline if ek + ∑i<k demandJi (rk, rk + dk) ≤ dk

Page 12: Device Drivers

What is a demand analysis ?

A task is an abstraction for a collection of possible sequences of jobs.

The notions of computational demand and interference extend naturally to tasks. The function demandmax

Ti(∆) is the maximum of combined demands of all the jobs of Ti in every time interval of length , taken over all possible job sequences of Ti.

That is if S is the collection of all possible job sequences of Ti then demandmax

Ti(∆) = def max S€S ,t>0∑J € S demandJ (t − ∆ , t)

Page 13: Device Drivers

Case Studies

A network interface controller (NIC), is a computer hardware component designed to allow computers to communicate over a computer network.

It is both an OSI layer 1 (physical layer) and layer 2 (data link layer) device, as it provides physical access to a networking medium and provides a low-level addressing system through the use of MAC addresses.

It allows users to connect to each other either by using cables or wirelessly.

Network Interface Controller (NIC),

Page 14: Device Drivers

Network interface device drivers present the biggest challenge for modeling and Schedulability analysis.

The Linux e1000 driver leaves the hardware interrupts for incoming packets disabled as long as there are queued received packets that have not been processed. The device interrupt is only re-enabled when the server thread has polled.

The device-driven workload of the e1000 driver can be viewed as two device-driven tasks: i)Input Processing which includes dequeuing packets that the device has previously received and copied directly into system memory. ii)Output processing, which includes dequeuing packets already sent and the enqueueing of more packets to send.

The Linux e1000 Driver

Page 15: Device Drivers

The hardware preempts the currently executing thread

The driver’s ISR does the minimumamount of work necessary

The softirq handler does the restof the driver’s work

The Linux e1000 Driver

Thread context

Level 3Softriq

Level 2Driver ISR

Level 1Generic ISR

Interrupt Context

Page 16: Device Drivers

www.en.wikipedia.org

www.dlc.sun.com

www.tjdl.uh.edu/articles/1/lectures/tables.cfm

www.macsoft-firmware.com

Modeling device driver effects in real-time schedulability analysis:Study of a network driver (IEEE paper)

Papers

Websites

References

Linux Device Drivers

Books

By Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Page 17: Device Drivers

Thank you

Page 18: Device Drivers

Questions….????