Device Drivers


Published on

My Presentation of technical seminar held in college

Published in: Technology
  • cheat users
    Are you sure you want to  Yes  No
    Your message goes here
  • fake site
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Device Drivers

    1. 1. 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;
    2. 2. Presentation overview <ul><li>Introduction to device drivers </li></ul><ul><li>Design of device drivers </li></ul><ul><li>Device drivers working </li></ul><ul><li>Device drivers in real time </li></ul><ul><li>Scheduling process </li></ul><ul><li>Case studies </li></ul><ul><li>References </li></ul>
    3. 3. What is a device driver? <ul><li>A device driver or software driver is a computer program </li></ul><ul><li>allowing higher-level computer programs to interact with a </li></ul><ul><li>hardware device. </li></ul><ul><li>Device drivers are integral components of operating </li></ul><ul><li>systems. </li></ul>
    4. 4. 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.
    5. 5. 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 1 Ring 2 Ring 3 Device Drivers Device Drivers Applications Lest Privileged Most Privileged Privilege rings available
    6. 6. Device Driver design
    7. 7. Device Driver Design …[Contd.]
    8. 8. <ul><li>System initialization </li></ul><ul><li>System calls from user processes </li></ul><ul><li>User-level requests </li></ul><ul><li>Device interrupts </li></ul><ul><li>Bus reset </li></ul>How Drivers are accessed ?
    9. 9. Disadvantages of device drivers in real time <ul><li>Real-time systems need to guarantee that certain workloads </li></ul><ul><li>can be completed within specified time constraints. </li></ul><ul><li>Device drivers have traditionally been a weak spot of most </li></ul><ul><li>operating systems, especially in terms of accounting and control of </li></ul><ul><li>the resources consumed by these software components. </li></ul><ul><li>Each device driver’s code may run in multiple (possibly concurrent) </li></ul><ul><li>execution contexts which makes the resource accounting difficult, if </li></ul><ul><li>not impossible. </li></ul><ul><li>Device drivers are scheduled in a hierarchy of ad hoc mechanisms, </li></ul><ul><li>namely hard interrupt service routines (ISR), softirqs, and process </li></ul><ul><li>or thread contexts, in decreasing order of execution priorities. </li></ul>
    10. 10. <ul><li>Every device driver interrupt must be handled in real time, i.e. </li></ul><ul><li>as and when the driver routine is called. </li></ul><ul><li>For this there has to be a Schedulability mechanism to do it in </li></ul><ul><li>real time. </li></ul><ul><li>We discuss here the Demand based Schedulability and its </li></ul><ul><li>analysis on device drivers. </li></ul><ul><li>There are two approaches to DBS analysis </li></ul><ul><li>i) Measure of computational demand </li></ul><ul><li>ii)Ad-hoc mechanisms to schedule a-periodic tasks </li></ul>How to overcome it?
    11. 11. What is a demand analysis ? <ul><li>A job is a schedulable component of computational work with a release </li></ul><ul><li>time, a deadline, and an execution time. </li></ul><ul><li>The computational demand of a job J in a given time interval (a, b) for a </li></ul><ul><li>given schedule, denoted by demand J(a, b), is defined to be the actual </li></ul><ul><li>amount of processor time consumed by that job within the interval. </li></ul><ul><li>Every job will be completed on time as long as the sum of its own </li></ul><ul><li>execution time and the interference caused by the execution of other </li></ul><ul><li>higher priority jobs within the same time window during which the job </li></ul><ul><li>must be completed add up to no more than the length of the window. </li></ul><ul><li>A job J k released at time r k with deadline r k +d k and execution time e k </li></ul><ul><li>will be completed by its deadline if </li></ul><ul><li>e k + ∑ i<k demand Ji (r k , r k + d k ) ≤ d k </li></ul>
    12. 12. What is a demand analysis ? <ul><li>A task is an abstraction for a collection of possible sequences of jobs. </li></ul><ul><li>The notions of computational demand and interference </li></ul><ul><li>extend naturally to tasks. </li></ul><ul><li>The function demand max Ti (∆) </li></ul><ul><li>is the maximum of combined demands of all the jobs of T i in every </li></ul><ul><li>time interval of length , taken over all possible job sequences of T i . </li></ul><ul><li>That is if S is the collection of all possible job sequences of T i then </li></ul><ul><li>demand max Ti (∆) = def max S€S ,t>0∑ J € S demand J (t − ∆ , t) </li></ul>
    13. 13. 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 ),
    14. 14. <ul><li>Network interface device drivers present the biggest challenge for </li></ul><ul><li>modeling and Schedulability analysis. </li></ul><ul><li>The Linux e1000 driver leaves the hardware interrupts for incoming </li></ul><ul><li>packets disabled as long as there are queued received packets </li></ul><ul><li>that have not been processed. The device interrupt is </li></ul><ul><li>only re-enabled when the server thread has polled. </li></ul><ul><li>The device-driven workload of the e1000 driver can </li></ul><ul><li>be viewed as two device-driven tasks: </li></ul><ul><li>i)Input Processing </li></ul><ul><li>which includes dequeuing packets that the device has </li></ul><ul><li>previously received and copied directly into system memory. </li></ul><ul><li>ii)Output processing, </li></ul><ul><li>which includes dequeuing packets already sent and the </li></ul><ul><li>enqueueing of more packets to send. </li></ul>The Linux e1000 Driver
    15. 15. The hardware preempts the currently executing thread The driver’s ISR does the minimum amount of work necessary The softirq handler does the rest of the driver’s work The Linux e1000 Driver Thread context Level 3 Softriq Level 2 Driver ISR Level 1 Generic ISR Interrupt Context
    16. 16. 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
    17. 17. Thank you
    18. 18. Questions….????