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