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. 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 Scholar
Digital Library
- Apt, K. R. and Wallace, M. G. 2007. Constraint Logic Programming Using ECLiPSe. Cambridge University Press. Google Scholar
Digital 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. 2003. Transforming policies into mechanisms with Infokernel. In Proceedings of the 19th ACM Symposium on Operating System Principles. 90--105. Google Scholar
Digital Library
- 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 Scholar
- Baldwin, J. H. 2010. About hot-plugging support in FreeBSD. http://www.mavetju.org/mail/view_message.php?list=freebsd-arch&id=3106757.Google Scholar
- 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 Scholar
Digital Library
- Barrelfish Team. 2010. The Barrelfish research operating system. http://www.barrelfish.org/.Google Scholar
- 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 Scholar
Digital Library
- Budruk, R., Anderson, D., and Shanley, T. 2004. PCI Express System Architecture. Addison Wesley. Google Scholar
Digital Library
- Conway, P. and Hughes, B. 2007. The AMD Opteron northbridge architecture. IEEE Micro 27, 2, 10--21. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Diaz, D. 2011. Gnu prolog. http://www.gprolog.org/.Google Scholar
- Dunham, S. N. 1998. Method for allocating system resources in a hierarchical bus structure. US patent 5,778,197.Google Scholar
- 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 Scholar
Digital Library
- Hewlett-Packard, Intel, Microsoft, Phoenix, Toshiba. 2010. Advanced configuration and power interface specification, rev. 4.0a. http://www.acpi.info/.Google Scholar
- Hovel, D. 1995. Using Prolog in Windows NT network configuration. In Proceedings of the 3rd Annual Conference on the Practical Applications of Prolog.Google Scholar
- 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 Scholar
Digital Library
- Kauer, B. 2009. ATARE: ACPI tables and regular expressions. Tech. rep. TUD-FI09-09, Faculty of Computer Science, TU Dresden, Dresden, Germany.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. 2009. seL4: Formal verification of an OS kernel. In Proceedings of the 22nd ACM Symposium on Operating System Principles. Google Scholar
Digital Library
- Livny, M., Basney, J., Raman, R., and Tannenbaum, T. 1997. Mechanisms for high throughput computing. SPEEDUP J. 11, 1.Google Scholar
- 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 Scholar
Digital Library
- Microsoft. 2003a. The importance of implementing APIC-based interrupt subsystems on uniprocessor PCs. http://www.microsoft.com/whdc/archive/apic.mspx.Google Scholar
- Microsoft. 2003b. PCI multi-level rebalance in Windows Vista. http://www.microsoft.com/whdc/archive/multilevel-rebal.mspx.Google Scholar
- Microsoft. 2006. Firmware allocation of PCI device resources in Windows. http://www.microsoft.com/whdc/connect/PCI/pci-rsc.mspx.Google Scholar
- Mochel, P. 2005. The filesystem. In Proceedings of the Annual Linux Symposium.Google Scholar
- 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 Scholar
Digital Library
- PCI-SIG 2009. PCI express base 2.1 specification. PCI-SIG. http://www.pcisig.com/.Google Scholar
- 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 Scholar
- Rusling, D. A. 1999. The Linux kernel. http://tldp.org/LDP/tlk/tlk.html.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- Thain, D., Tannenbaum, T., and Livny, M. 2005. Distributed computing in practice: the Condor experience. Concurrency: Pract. Exper. 17, 2--4, 323--356. Google Scholar
Digital Library
- TJworld. 2008. PCI dynamic resource allocation management. http://tjworld.net/wiki/Linux/PCIDynamicResourceAllocationManagement.Google Scholar
- W3C. 2004. Resource description framework. http://www.w3.org/RDF.Google Scholar
- 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 Scholar
Digital Library
Index Terms
A Declarative Language Approach to Device Configuration
Recommendations
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 ...
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