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

A declarative language approach to device configuration

Published: 05 March 2011 Publication History

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.
[2]
Apt, K. R., and Wallace, M. G. Constraint Logic Programming using ECLiPSe. Cambridge University Press, 2007.
[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.
[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.
[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.
[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.
[7]
The Barrelfish Research Operating System. http://www.barrelfish.org/, December 2010.
[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).
[9]
Budruk, R., Anderson, D., and Shanley, T. PCI Express System Architecture. Addison Wesley, 2004.
[10]
Dunham, S. N. Method for allocating system resources in a hierarchical bus structure, July 1998. US patent 5,778,197.
[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).
[12]
Hewlett-Packard, Intel, Microsoft, Phoenix, Toshiba. Advanced Configuration and Power Interface Specification, Rev. 4.0a, Apr. 2010. http://www.acpi.info/.
[13]
Hovel, D. Using Prolog in Windows NT network configuration. In Proceedings of the Third Annual Conference on the Practical Applications of Prolog (1995).
[14]
The Importance of Implementing APIC-Based Interrupt Subsystems on Uniprocessor PCs. http://www.microsoft.com/whdc/archive/apic.mspx, January 2003.
[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.
[16]
Kauer, B. ATARE: ACPI tables and regular expressions. Tech. Rep. TUD-FI09-09, TU Dresden, Faculty of Computer Science, Dresden, Germany, Aug. 2009.
[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).
[18]
Livny, M., Basney, J., Raman, R., and Tannenbaum, T. Mechanisms for high throughput computing. SPEEDUP Journal 11, 1 (June 1997).
[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.
[20]
Microsoft. PCI multi-level rebalance in Windows Vista. http://www.microsoft.com/whdc/archive/multilevel-rebal.mspx, Nov. 2003.
[21]
Microsoft. Firmware allocation of PCI device resources in Windows. http://www.microsoft.com/whdc/connect/PCI/pci-rsc.mspx, Oct. 2006.
[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.
[23]
PCI-SIG. PCI Express Base 2.1 Specification, Mar. 2009. http://www.pcisig.com/.
[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).
[25]
Rusling, D. A. The Linux kernel. http://tldp.org/LDP/tlk/tlk.html, 1999.
[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).
[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.
[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.
[29]
TJ. PCI dynamic resource allocation management. http://tjworld.net/wiki/Linux/PCIDynamicResourceAllocationManagement, June 2008.
[30]
W3C. Resource description framework, Feb. 2004. http://www.w3.org/RDF.
[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.

Cited By

View all
  • (2023)CPU-free Computing: A Vision with a BlueprintProceedings of the 19th Workshop on Hot Topics in Operating Systems10.1145/3593856.3595906(1-14)Online publication date: 22-Jun-2023
  • (2021)Generating correct initial page tables from formal hardware descriptionsProceedings of the 11th Workshop on Programming Languages and Operating Systems10.1145/3477113.3487270(69-75)Online publication date: 25-Oct-2021
  • (2021)Declarative Power SequencingACM Transactions on Embedded Computing Systems10.1145/347703920:5s(1-21)Online publication date: 22-Sep-2021
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

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
  • 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 SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 46, Issue 3
    ASPLOS '11
    March 2011
    407 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1961296
    Issue’s Table of Contents
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 05 March 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. constraint logic programming
  2. eclipse clp
  3. hardware programming
  4. pci configuration

Qualifiers

  • Research-article

Conference

ASPLOS'11

Acceptance Rates

Overall Acceptance Rate 535 of 2,713 submissions, 20%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)6
  • Downloads (Last 6 weeks)1
Reflects downloads up to 08 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2023)CPU-free Computing: A Vision with a BlueprintProceedings of the 19th Workshop on Hot Topics in Operating Systems10.1145/3593856.3595906(1-14)Online publication date: 22-Jun-2023
  • (2021)Generating correct initial page tables from formal hardware descriptionsProceedings of the 11th Workshop on Programming Languages and Operating Systems10.1145/3477113.3487270(69-75)Online publication date: 25-Oct-2021
  • (2021)Declarative Power SequencingACM Transactions on Embedded Computing Systems10.1145/347703920:5s(1-21)Online publication date: 22-Sep-2021
  • (2020)Automated reasoning and detection of specious configuration in large systems with symbolic executionProceedings of the 14th USENIX Conference on Operating Systems Design and Implementation10.5555/3488766.3488807(719-734)Online publication date: 4-Nov-2020
  • (2017)Formalizing Memory Accesses and InterruptsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.244.4244(66-116)Online publication date: 15-Mar-2017
  • (2017)Towards Correct-by-Construction Interrupt Routing on Real HardwareProceedings of the 9th Workshop on Programming Languages and Operating Systems10.1145/3144555.3144557(8-14)Online publication date: 28-Oct-2017
  • (2017)Towards Proving Optimistic Multicore SchedulersProceedings of the 16th Workshop on Hot Topics in Operating Systems10.1145/3102980.3102984(18-23)Online publication date: 7-May-2017
  • (2017)A Model Driven Approach for Device Driver Development2017 IEEE International Conference on Software Quality, Reliability and Security Companion (QRS-C)10.1109/QRS-C.2017.27(122-129)Online publication date: Jul-2017
  • (2014)Relational access to Unix kernel data structuresProceedings of the Ninth European Conference on Computer Systems10.1145/2592798.2592802(1-14)Online publication date: 14-Apr-2014
  • (2013)Do not blame users for misconfigurationsProceedings of the Twenty-Fourth ACM Symposium on Operating Systems Principles10.1145/2517349.2522727(244-259)Online publication date: 3-Nov-2013
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media