skip to main content
10.1145/2150976.2150987acmconferencesArticle/Chapter ViewAbstractPublication PagesasplosConference Proceedingsconference-collections
research-article

Understanding modern device drivers

Published:03 March 2012Publication History

ABSTRACT

Device drivers are the single largest contributor to operating-system kernel code with over 5 million lines of code in the Linux kernel, and cause significant complexity, bugs and development costs. Recent years have seen a flurry of research aimed at improving the reliability and simplifying the development of drivers. However, little is known about what constitutes this huge body of code beyond the small set of drivers used for research.

In this paper, we study the source code of Linux drivers to understand what drivers actually do, how current research applies to them and what opportunities exist for future research. We determine whether assumptions made by most driver research, such as that all drivers belong to a class, are indeed true. We also analyze driver code and abstractions to determine whether drivers can benefit from code re-organization or hardware trends. We develop a set of static-analysis tools to analyze driver code across various axes. Broadly, our study looks at three aspects of driver code (i) what are the characteristics of driver code functionality and how applicable is driver research to all drivers, (ii) how do drivers interact with the kernel, devices, and buses, and (iii) are there similarities that can be abstracted into libraries to reduce driver size and complexity?

We find that many assumptions made by driver research do not apply to all drivers. At least 44% of drivers have code that is not captured by a class definition, 28% of drivers support more than one device per driver, and 15% of drivers do significant computation over data. From the driver interactions study, we find USB bus offers an efficient bus interface with significant standardized code and coarse-grained access, ideal for executing drivers in isolation. We also find that drivers for different buses and classes have widely varying levels of device interaction, which indicates that the cost of isolation will vary by class. Finally, from our driver similarity study, we find 8% of all driver code is substantially similar to code elsewhere and may be removed with new abstractions or libraries.

References

  1. J. Andrus, C. Dall, A. Van-ôt Hof, O. Laadan, and J. Nieh. Cells: A virtual mobile smartphone architecture. In SOSP, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. T. Ball, E. Bounimova, B. Cook, V. Levin, J. Lichtenberg, C. McGarvey, B. Ondrusek, S. K. Rajamani, and A. Ustuner. Thorough static analysis of device drivers. In Eurosys, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Belongie, J. Malik, and J. Puzicha. Shape matching and object recognition using shape contexts. Transactions on Pattern Analysis and Machine Intelligence, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Boyd-Wickizer and N. Zeldovich. Tolerating malicious device drivers in linux. In USENIX ATC, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Castro, M. Costa, J.-P. Martin, M. Peinado, P. Akritidis, A. Donnelly, P. Barham, and R. Black. Fast byte-granularity software fault isolation. In SOSP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. V. Chipounov and G. Candea. Reverse engineering of binary device drivers with RevNIC. In Eurosys, Apr. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. T.-c. Chiueh, G. Venkitachalam, and P. Pradhan. Integrating segmentation and paging protection for safe, efficient and transparent software extensions. Operating Systems Review, 33, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Chou, J. Yang, B. Chelf, S. Hallem, and D. Engler. An empirical study of operating system errors. In SOSP, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. F. M. David et al. CuriOS: Improving reliability through operating system structure. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Digi International. AnywhereUSB. http://www.digi.com/products/usb/anywhereusb.jsp.Google ScholarGoogle Scholar
  11. I. Dryden and K. Mardia. Statistical shape analysis, volume 4. Wiley New York, 1998.Google ScholarGoogle Scholar
  12. K. Fraser et al. Safe hardware access with the Xen virtual machine monitor. In OASIS Workhop, 2004.Google ScholarGoogle Scholar
  13. M. Gabel, J. Yang, Y. Yu, M. Goldszmidt, and Z. Su. Scalable and systematic detection of buggy inconsistencies in source code. In OOPSLA, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Ganapathi, V. Ganapathi, and D. A. Patterson. Windows xp kernel crash analysis. In LISA, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. V. Ganapathy, A. Balakrishnan, M. M. Swift, and S. Jha. Microdrivers: A new architecture for device drivers. In HOTOS11, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. V. Ganapathy, M. J. Renzelmann, A. Balakrishnan, M. M. Swift, and S. Jha. The design and implementation of microdrivers. In ASPLOS, Mar. 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. Hari, M. Jaitly, Y.-J. Chang, and A. Francini. The swiss army smartphone: Cloud-based delivery of usb services. In Mobiheld, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Kadav, M. J. Renzelmann, and M. M. Swift. Tolerating hardware device failures in software. In SOSP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Kadav and M. Swift. Live migration of direct-access devices. Operating Systems Review, 43(3):95--104, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. V. Kuznetsov, V. Chipounov, and G. Candea. Testing closed-source binary device drivers with DDT. In USENIX ATC, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. B. Leslie et al. User-level device drivers: Achieved performance. Jour. Comp. Sci. and Tech., 2005.Google ScholarGoogle ScholarCross RefCross Ref
  22. Z. Li, S. Lu, S. Myagmar, and Y. Zhou. CP-Miner: A tool for finding copy-paste and related bugs in operating system code. In OSDI, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Y. Mao, H. Chen, D. Zhou, X. Wang, N. Zeldovich, and M. Kaashoek. Software fault isolation with api integrity and multi-principal modules. In SOSP, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. A. Menon, S. Schubert, and W. Zwaenepoel. Twindrivers: semi-automatic derivation of fast and safe hypervisor network drivers from guest os drivers. In ASPLOS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. F. Mérillon, L. Réveillère, C. Consel, R. Marlet, and G. Muller. Devil: An IDL for hardware programming. In OSDI, 2000.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Microsoft Corp. Web services on devices. http://msdn.microsoft.com/en-us/library/ aa826001%28v=vs.85%29.aspx.Google ScholarGoogle Scholar
  27. G. C. Necula, S. Mcpeak, S. P. Rahul, and W. Weimer. CIL: Intermediate language and tools for analysis and transformation of C programs. In Compiler Construction, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. V. Orgovan and M. Tricker. An introduction to driver quality. Microsoft WinHec Presentation DDT301, 2003.Google ScholarGoogle Scholar
  29. Y. Padioleau, J. Lawall, R. R. Hansen, and G. Muller. Documenting and automating collateral evolutions in linux device drivers. In Eurosys, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. K. K. Ram, J. R. Santos, Y. Turner, A. L. Cox, and S. Rixner. Achieving 10 gb/s using safe and transparent network interface virtualization. In VEE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. M. J. Renzelmann and M. M. Swift. Decaf: Moving device drivers to a modern language. In USENIX ATC, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. L. Ryzhyk, P. Chubb, I. Kuz, and G. Heiser. Dingo: Taming device drivers. In Eurosys, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. L. Ryzhyk, P. Chubb, I. Kuz, E. Le Sueur, and G. Heiser. Automatic device driver synthesis with Termite. In SOSP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. L. Ryzhyk, Y. Zhu, and G. Heiser. The case for active device drivers. In APSys, Aug. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Schüpbach, A. Baumann, T. Roscoe, and S. Peter. A declarative language approach to device configuration. In ASPLOS, 2011.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. Silberschatz, P. B. Galvin, and G. Gagne. Operating System Concepts. John Wiley and Sons, eighth edition, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. Spear et al. Solving the starting problem: Device drivers as self-describing artifacts. In Eurosys, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. M. M. Swift, M. Annamalai, B. N. Bershad, and H. M. Levy. Recovering device drivers. In OSDI, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. M. M. Swift, B. N. Bershad, and H. M. Levy. Improving the reliability of commodity operating systems. In TOCS, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Úlfar Erlingsson et al. Xfi: software guards for system address spaces. In OSDI, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. USB Implementors Forum. Universal serial bus mass storage class specification overview. http://www.usb.org/developers/devclass_docs/usb_msc_overview_1.2.pdf, 2003.Google ScholarGoogle Scholar
  42. USB Implementors Forum. Universal serial bus 3.0 specification. http://www.usb.org/developers/docs/usb_30_spec_071311.zip, 2011.Google ScholarGoogle Scholar
  43. D. A. Wheeler. Sloccount. http://www.dwheeler.com/sloccount/.Google ScholarGoogle Scholar
  44. D. Williams, P. Reynolds, K. Walsh, E. G. Sirer, and F. B. Schneider. Device driver safety through a reference validation mechanism. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. L. Wittie. Laddie: The language for automated device drivers (ver 1). Technical Report 08--2, Bucknell CS-TR, 2008.Google ScholarGoogle Scholar
  46. Xen.org. Writing xen drivers: Using xenbus and xenstore. http://wiki.xensource.com/xenwiki/XenBus, 2006.Google ScholarGoogle Scholar
  47. F. Zhou et al. SafeDrive: Safe and recoverable extensions using language-based techniques. In OSDI, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Understanding modern device drivers

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ASPLOS XVII: Proceedings of the seventeenth international conference on Architectural Support for Programming Languages and Operating Systems
        March 2012
        476 pages
        ISBN:9781450307598
        DOI:10.1145/2150976
        • cover image ACM SIGARCH Computer Architecture News
          ACM SIGARCH Computer Architecture News  Volume 40, Issue 1
          ASPLOS '12
          March 2012
          453 pages
          ISSN:0163-5964
          DOI:10.1145/2189750
          Issue’s Table of Contents
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 47, Issue 4
          ASPLOS '12
          April 2012
          453 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2248487
          Issue’s Table of Contents

        Copyright © 2012 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 3 March 2012

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate535of2,713submissions,20%

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader