skip to main content
research-article

A declarative language approach to device configuration

Published:05 March 2011Publication 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. Hippodrome: Running circles around storage administration. In Proceedings of the 1st USENIX Conference on File and Storage Technologies (Berkeley, CA, USA, 2002), FAST '02, USENIX Association. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Apt, K. R., and Wallace, M. G. Constraint Logic Programming using ECLiPSe. Cambridge University Press, 2007. 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. Transforming policies into mechanisms with Infokernel. In Proceedings of the 19th ACM Symposium on Operating System Principles (Oct. 2003), pp. 90--105. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Baldwin, J. H. Multiple passes of the FreeBSD device tree. In BSDCan Conference (May 2009). http://www.bsdcan.org/2009/schedule/attachments/83_article.pdf.Google ScholarGoogle Scholar
  5. Baldwin, J. H. About hot-plugging support in FreeBSD. http://www.mavetju.org/mail/view_message.php?list=freebsd-arch&id=31067%57, Feb. 2010.Google ScholarGoogle Scholar
  6. Barker, V. E., O'Connor, D. E., Bachant, J., and Soloway, E. Expert systems for configuration at digital: Xcon and beyond. Commun. ACM 32 (March 1989), 298--318. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. The Barrelfish Research Operating System. http://www.barrelfish.org/, December 2010.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. The multikernel: a new OS architecture for scalable multicore systems. In Proceedings of the 22nd ACM Symposium on Operating System Principles (Oct. 2009). Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Budruk, R., Anderson, D., and Shanley, T. PCI Express System Architecture. Addison Wesley, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Dunham, S. N. Method for allocating system resources in a hierarchical bus structure, July 1998. US patent 5,778,197.Google ScholarGoogle Scholar
  11. Gunawi, H. S., Rajimwale, A., Arpaci-Dusseau, A. C., and Arpaci-Dusseau, R. H. SQCK: A declarative file system checker. In Proceedings of the 8th USENIX Symposium on Operating Systems Design and Implementation (Dec. 2008). Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Hewlett-Packard, Intel, Microsoft, Phoenix, Toshiba. Advanced Configuration and Power Interface Specification, Rev. 4.0a, Apr. 2010. http://www.acpi.info/.Google ScholarGoogle Scholar
  13. Hovel, D. Using Prolog in Windows NT network configuration. In Proceedings of the Third Annual Conference on the Practical Applications of Prolog (1995).Google ScholarGoogle Scholar
  14. The Importance of Implementing APIC-Based Interrupt Subsystems on Uniprocessor PCs. http://www.microsoft.com/whdc/archive/apic.mspx, January 2003.Google ScholarGoogle Scholar
  15. Jaffar, J., and Lassez, J.-L. Constraint logic programming. In POPL '87: Proceedings of the 14th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (1987), pp. 111--119. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Kauer, B. ATARE: ACPI tables and regular expressions. Tech. Rep. TUD-FI09-09, TU Dresden, Faculty of Computer Science, Dresden, Germany, Aug. 2009.Google ScholarGoogle Scholar
  17. 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. seL4: Formal verification of an OS kernel. In Proceedings of the 22nd ACM Symposium on Operating System Principles (Oct. 2009). Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Livny, M., Basney, J., Raman, R., and Tannenbaum, T. Mechanisms for high throughput computing. SPEEDUP Journal 11, 1 (June 1997).Google ScholarGoogle Scholar
  19. Mérillon, F., Réveillère, L., Consel, C., Marlet, R., and Muller, G. Devil: an IDL for hardware programming. In Proceedings of the 4th USENIX Symposium on Operating Systems Design and Implementation (2000), pp. 17--30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Microsoft. PCI multi-level rebalance in Windows Vista. http://www.microsoft.com/whdc/archive/multilevel-rebal.mspx, Nov. 2003.Google ScholarGoogle Scholar
  21. Microsoft. Firmware allocation of PCI device resources in Windows. http://www.microsoft.com/whdc/connect/PCI/pci-rsc.mspx, Oct. 2006.Google ScholarGoogle Scholar
  22. Nightingale, E. B., Hodson, O., McIlroy, R., Hawblitzel, C., and Hunt, G. Helios: heterogeneous multiprocessing with satellite kernels. In Proceedings of the 22nd ACM Symposium on Operating System Principles (2009), pp. 221--234. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. PCI-SIG. PCI Express Base 2.1 Specification, Mar. 2009. http://www.pcisig.com/.Google ScholarGoogle Scholar
  24. Reis, L. P., and Oliveira, E. A constraint logic programming approach to examination scheduling. In Proceedings of the 10th Irish Conference on Artificial Intelligence and Cognitive Science (1999).Google ScholarGoogle Scholar
  25. Rusling, D. A. The Linux kernel. http://tldp.org/LDP/tlk/tlk.html, 1999.Google ScholarGoogle Scholar
  26. Schüpbach, A., Peter, S., Baumann, A., Roscoe, T., Barham, P., Harris, T., and Isaacs, R. Embracing diversity in the Barrelfish manycore operating system. In Proceedings of the 1st Workshop on Managed Multi-Core Systems (June 2008).Google ScholarGoogle Scholar
  27. Spear, M. F., Roeder, T., Hodson, O., Hunt, G. C., and Levi, S. Solving the starting problem: device drivers as self-describing artifacts. In Proceedings of the EuroSys Conference (2006), pp. 45--57. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Thain, D., Tannenbaum, T., and Livny, M. Distributed computing in practice: the Condor experience. Concurrency: Practice and Experience 17, 2--4 (2005), 323--356. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. TJ. PCI dynamic resource allocation management. http://tjworld.net/wiki/Linux/PCIDynamicResourceAllocationManagement, June 2008.Google ScholarGoogle Scholar
  30. W3C. Resource description framework, Feb. 2004. http://www.w3.org/RDF.Google ScholarGoogle Scholar
  31. Weinsberg, Y., Dolev, D., Anker, T., Ben-Yehuda, M., and Wyckoff, P. 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 (2008), pp. 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 SIGARCH Computer Architecture News
          ACM SIGARCH Computer Architecture News  Volume 39, Issue 1
          ASPLOS '11
          March 2011
          407 pages
          ISSN:0163-5964
          DOI:10.1145/1961295
          Issue’s Table of Contents
          • cover image ACM Conferences
            ASPLOS XVI: Proceedings of the sixteenth international conference on Architectural support for programming languages and operating systems
            March 2011
            432 pages
            ISBN:9781450302661
            DOI:10.1145/1950365

          Copyright © 2011 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: 5 March 2011

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader