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.
- J. Andrus, C. Dall, A. Van-ôt Hof, O. Laadan, and J. Nieh. Cells: A virtual mobile smartphone architecture. In SOSP, 2011. Google ScholarDigital Library
- 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 ScholarDigital Library
- S. Belongie, J. Malik, and J. Puzicha. Shape matching and object recognition using shape contexts. Transactions on Pattern Analysis and Machine Intelligence, 2002. Google ScholarDigital Library
- S. Boyd-Wickizer and N. Zeldovich. Tolerating malicious device drivers in linux. In USENIX ATC, 2010. Google ScholarDigital Library
- 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 ScholarDigital Library
- V. Chipounov and G. Candea. Reverse engineering of binary device drivers with RevNIC. In Eurosys, Apr. 2010. Google ScholarDigital Library
- 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 ScholarDigital Library
- A. Chou, J. Yang, B. Chelf, S. Hallem, and D. Engler. An empirical study of operating system errors. In SOSP, 2001. Google ScholarDigital Library
- F. M. David et al. CuriOS: Improving reliability through operating system structure. In OSDI, 2008. Google ScholarDigital Library
- Digi International. AnywhereUSB. http://www.digi.com/products/usb/anywhereusb.jsp.Google Scholar
- I. Dryden and K. Mardia. Statistical shape analysis, volume 4. Wiley New York, 1998.Google Scholar
- K. Fraser et al. Safe hardware access with the Xen virtual machine monitor. In OASIS Workhop, 2004.Google Scholar
- 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 ScholarDigital Library
- A. Ganapathi, V. Ganapathi, and D. A. Patterson. Windows xp kernel crash analysis. In LISA, 2006. Google ScholarDigital Library
- V. Ganapathy, A. Balakrishnan, M. M. Swift, and S. Jha. Microdrivers: A new architecture for device drivers. In HOTOS11, 2007. Google ScholarDigital Library
- V. Ganapathy, M. J. Renzelmann, A. Balakrishnan, M. M. Swift, and S. Jha. The design and implementation of microdrivers. In ASPLOS, Mar. 2008. Google ScholarDigital Library
- A. Hari, M. Jaitly, Y.-J. Chang, and A. Francini. The swiss army smartphone: Cloud-based delivery of usb services. In Mobiheld, 2011. Google ScholarDigital Library
- A. Kadav, M. J. Renzelmann, and M. M. Swift. Tolerating hardware device failures in software. In SOSP, 2009. Google ScholarDigital Library
- A. Kadav and M. Swift. Live migration of direct-access devices. Operating Systems Review, 43(3):95--104, 2009. Google ScholarDigital Library
- V. Kuznetsov, V. Chipounov, and G. Candea. Testing closed-source binary device drivers with DDT. In USENIX ATC, 2010. Google ScholarDigital Library
- B. Leslie et al. User-level device drivers: Achieved performance. Jour. Comp. Sci. and Tech., 2005.Google ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- F. Mérillon, L. Réveillère, C. Consel, R. Marlet, and G. Muller. Devil: An IDL for hardware programming. In OSDI, 2000.Google ScholarDigital Library
- Microsoft Corp. Web services on devices. http://msdn.microsoft.com/en-us/library/ aa826001%28v=vs.85%29.aspx.Google Scholar
- 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 ScholarDigital Library
- V. Orgovan and M. Tricker. An introduction to driver quality. Microsoft WinHec Presentation DDT301, 2003.Google Scholar
- Y. Padioleau, J. Lawall, R. R. Hansen, and G. Muller. Documenting and automating collateral evolutions in linux device drivers. In Eurosys, 2008. Google ScholarDigital Library
- 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 ScholarDigital Library
- M. J. Renzelmann and M. M. Swift. Decaf: Moving device drivers to a modern language. In USENIX ATC, June 2009. Google ScholarDigital Library
- L. Ryzhyk, P. Chubb, I. Kuz, and G. Heiser. Dingo: Taming device drivers. In Eurosys, 2009. Google ScholarDigital Library
- L. Ryzhyk, P. Chubb, I. Kuz, E. Le Sueur, and G. Heiser. Automatic device driver synthesis with Termite. In SOSP, 2009. Google ScholarDigital Library
- L. Ryzhyk, Y. Zhu, and G. Heiser. The case for active device drivers. In APSys, Aug. 2010. Google ScholarDigital Library
- A. Schüpbach, A. Baumann, T. Roscoe, and S. Peter. A declarative language approach to device configuration. In ASPLOS, 2011.Google ScholarDigital Library
- A. Silberschatz, P. B. Galvin, and G. Gagne. Operating System Concepts. John Wiley and Sons, eighth edition, 2009. Google ScholarDigital Library
- M. Spear et al. Solving the starting problem: Device drivers as self-describing artifacts. In Eurosys, 2006. Google ScholarDigital Library
- M. M. Swift, M. Annamalai, B. N. Bershad, and H. M. Levy. Recovering device drivers. In OSDI, 2004. Google ScholarDigital Library
- M. M. Swift, B. N. Bershad, and H. M. Levy. Improving the reliability of commodity operating systems. In TOCS, 2005. Google ScholarDigital Library
- Úlfar Erlingsson et al. Xfi: software guards for system address spaces. In OSDI, 2006. Google ScholarDigital Library
- 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 Scholar
- USB Implementors Forum. Universal serial bus 3.0 specification. http://www.usb.org/developers/docs/usb_30_spec_071311.zip, 2011.Google Scholar
- D. A. Wheeler. Sloccount. http://www.dwheeler.com/sloccount/.Google Scholar
- 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 ScholarDigital Library
- L. Wittie. Laddie: The language for automated device drivers (ver 1). Technical Report 08--2, Bucknell CS-TR, 2008.Google Scholar
- Xen.org. Writing xen drivers: Using xenbus and xenstore. http://wiki.xensource.com/xenwiki/XenBus, 2006.Google Scholar
- F. Zhou et al. SafeDrive: Safe and recoverable extensions using language-based techniques. In OSDI, 2006. Google ScholarDigital Library
Index Terms
Understanding modern device drivers
Recommendations
Understanding modern device drivers
ASPLOS '12Device 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 ...
Understanding modern device drivers
ASPLOS '12Device 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 ...
Recovering device drivers
This article presents a new mechanism that enables applications to run correctly when device drivers fail. Because device drivers are the principal failing component in most systems, reducing driver-induced failures greatly improves overall reliability. ...
Comments