skip to main content
research-article

A Declarative Language Approach to Device Configuration

Published:01 February 2012Publication History
Skip Abstract Section

Abstract

C remains the language of choice for hardware programming (device drivers, bus configuration, etc.): it is fast, allows low-level access, and is trusted by OS developers. However, the algorithms required to configure and reconfigure hardware devices and interconnects are becoming more complex and diverse, with the added burden of legacy support, “quirks,” and hardware bugs to work around. Even programming PCI bridges in a modern PC is a surprisingly complex problem, and is getting worse as new functionality such as hotplug appears. Existing approaches use relatively simple algorithms, hard-coded in C and closely coupled with low-level register access code, generally leading to suboptimal configurations.

We investigate the merits and drawbacks of a new approach: separating hardware configuration logic (algorithms to determine configuration parameter values) from mechanism (programming device registers). The latter we keep in C, and the former we encode in a declarative programming language with constraint-satisfaction extensions. As a test case, we have implemented full PCI configuration, resource allocation, and interrupt assignment in the Barrelfish research operating system, using a concise expression of efficient algorithms in constraint logic programming. We show that the approach is tractable, and can successfully configure a wide range of PCs with competitive runtime cost. Moreover, it requires about half the code of the C-based approach in Linux while offering considerably more functionality. Additionally it easily accommodates adaptations such as hotplug, fixed regions, and “quirks.”

References

  1. Anderson, E., Hobbs, M., Keeton, K., Spence, S., Uysal, M., and Veitch, A. 2002. Hippodrome: Running circles around storage administration. In Proceedings of the 1st USENIX Conference on File and Storage Technologies (FAST’02). USENIX Association, Berkeley, CA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Apt, K. R. and Wallace, M. G. 2007. Constraint Logic Programming Using ECLiPSe. Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Arpaci-Dusseau, A. C., Arpaci-Dusseau, R. H., Burnett, N. C., Denehy, T. E., Engle, T. J., Gunawi, H. S., Nugent, J. A., and Popovici, F. I. 2003. Transforming policies into mechanisms with Infokernel. In Proceedings of the 19th ACM Symposium on Operating System Principles. 90--105. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Baldwin, J. H. 2009. Multiple passes of the FreeBSD device tree. In Proceedings of the BSDCan Conference. http://www.bsdcan.org/2009/schedule/attachments/83_article.pdf.Google ScholarGoogle Scholar
  5. Baldwin, J. H. 2010. About hot-plugging support in FreeBSD. http://www.mavetju.org/mail/view_message.php?list=freebsd-arch&id=3106757.Google ScholarGoogle Scholar
  6. Barker, V. E., O’Connor, D. E., Bachant, J., and Soloway, E. 1989. Expert systems for configuration at digital: Xcon and beyond. Comm. ACM 32, 298--318. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Barrelfish Team. 2010. The Barrelfish research operating system. http://www.barrelfish.org/.Google ScholarGoogle Scholar
  8. Baumann, A., Barham, P., Dagand, P.-E., Harris, T., Isaacs, R., Peter, S., Roscoe, T., Schüpbach, A., and Singhania, A. 2009. The multikernel: A new OS architecture for scalable multicore systems. In Proceedings of the 22nd ACM Symposium on Operating System Principles. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Budruk, R., Anderson, D., and Shanley, T. 2004. PCI Express System Architecture. Addison Wesley. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Conway, P. and Hughes, B. 2007. The AMD Opteron northbridge architecture. IEEE Micro 27, 2, 10--21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. de Moura, L. and Bjørner, N. 2008. Z3: An Efficient SMT Solver. In Proceedings of the Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Diaz, D. 2011. Gnu prolog. http://www.gprolog.org/.Google ScholarGoogle Scholar
  13. Dunham, S. N. 1998. Method for allocating system resources in a hierarchical bus structure. US patent 5,778,197.Google ScholarGoogle Scholar
  14. Gunawi, H. S., Rajimwale, A., Arpaci-Dusseau, A. C., and Arpaci-Dusseau, R. H. 2008. SQCK: A declarative file system checker. In Proceedings of the 8th USENIX Symposium on Operating Systems Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Hewlett-Packard, Intel, Microsoft, Phoenix, Toshiba. 2010. Advanced configuration and power interface specification, rev. 4.0a. http://www.acpi.info/.Google ScholarGoogle Scholar
  16. Hovel, D. 1995. Using Prolog in Windows NT network configuration. In Proceedings of the 3rd Annual Conference on the Practical Applications of Prolog.Google ScholarGoogle Scholar
  17. Jaffar, J. and Lassez, J.-L. 1987. Constraint logic programming. In Proceedings of the 14th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL’87). 111--119. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Kauer, B. 2009. ATARE: ACPI tables and regular expressions. Tech. rep. TUD-FI09-09, Faculty of Computer Science, TU Dresden, Dresden, Germany.Google ScholarGoogle Scholar
  19. Klein, G., Elphinstone, K., Heiser, G., Andronick, J., Cock, D., Derrin, P., Elkaduwe, D., Engelhardt, K., Kolanski, R., Norrish, M., Sewell, T., Tuch, H., and Winwood, S. 2009. seL4: Formal verification of an OS kernel. In Proceedings of the 22nd ACM Symposium on Operating System Principles. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Livny, M., Basney, J., Raman, R., and Tannenbaum, T. 1997. Mechanisms for high throughput computing. SPEEDUP J. 11, 1.Google ScholarGoogle Scholar
  21. Mérillon, F., Réveillère, L., Consel, C., Marlet, R., and Muller, G. 2000. Devil: An IDL for hardware programming. In Proceedings of the 4th USENIX Symposium on Operating Systems Design and Implementation. 17--30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Microsoft. 2003a. The importance of implementing APIC-based interrupt subsystems on uniprocessor PCs. http://www.microsoft.com/whdc/archive/apic.mspx.Google ScholarGoogle Scholar
  23. Microsoft. 2003b. PCI multi-level rebalance in Windows Vista. http://www.microsoft.com/whdc/archive/multilevel-rebal.mspx.Google ScholarGoogle Scholar
  24. Microsoft. 2006. Firmware allocation of PCI device resources in Windows. http://www.microsoft.com/whdc/connect/PCI/pci-rsc.mspx.Google ScholarGoogle Scholar
  25. Mochel, P. 2005. The filesystem. In Proceedings of the Annual Linux Symposium.Google ScholarGoogle Scholar
  26. Nightingale, E. B., Hodson, O., McIlroy, R., Hawblitzel, C., and Hunt, G. 2009. Helios: heterogeneous multiprocessing with satellite kernels. In Proceedings of the 22nd ACM Symposium on Operating System Principles. 221--234. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. PCI-SIG 2009. PCI express base 2.1 specification. PCI-SIG. http://www.pcisig.com/.Google ScholarGoogle Scholar
  28. Reis, L. P. and Oliveira, E. 1999. A constraint logic programming approach to examination scheduling. In Proceedings of the 10th Irish Conference on Artificial Intelligence and Cognitive Science.Google ScholarGoogle Scholar
  29. Rusling, D. A. 1999. The Linux kernel. http://tldp.org/LDP/tlk/tlk.html.Google ScholarGoogle Scholar
  30. Schüpbach, A., Peter, S., Baumann, A., Roscoe, T., Barham, P., Harris, T., and Isaacs, R. 2008. Embracing diversity in the Barrelfish manycore operating system. In Proceedings of the 1st Workshop on Managed Multi-Core Systems.Google ScholarGoogle Scholar
  31. Solomon, D. A., Russinovich, M. E., and Ionescu, A. 2009. Windows internals: Including Windows Server 2008 and Windows Vista 5th Ed. Microsoft Press, Chapter 4.Google ScholarGoogle Scholar
  32. Spear, M. F., Roeder, T., Hodson, O., Hunt, G. C., and Levi, S. 2006. Solving the starting problem: device drivers as self-describing artifacts. In Proceedings of the EuroSys Conference. 45--57. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Thain, D., Tannenbaum, T., and Livny, M. 2005. Distributed computing in practice: the Condor experience. Concurrency: Pract. Exper. 17, 2--4, 323--356. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. TJworld. 2008. PCI dynamic resource allocation management. http://tjworld.net/wiki/Linux/PCIDynamicResourceAllocationManagement.Google ScholarGoogle Scholar
  35. W3C. 2004. Resource description framework. http://www.w3.org/RDF.Google ScholarGoogle Scholar
  36. Weinsberg, Y., Dolev, D., Anker, T., Ben-Yehuda, M., and Wyckoff, P. 2008. Tapping into the fountain of CPUs: On operating system support for programmable devices. In Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems. 179--188. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A Declarative Language Approach to Device Configuration

        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

        Full Access

        • Published in

          cover image ACM Transactions on Computer Systems
          ACM Transactions on Computer Systems  Volume 30, Issue 1
          Special Issue APLOS 2011
          February 2012
          137 pages
          ISSN:0734-2071
          EISSN:1557-7333
          DOI:10.1145/2110356
          Issue’s Table of Contents

          Copyright © 2012 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 February 2012
          • Accepted: 1 October 2011
          • Received: 1 July 2011
          Published in tocs Volume 30, Issue 1

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!