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.”
Publisher
Association for Computing Machinery (ACM)
Reference36 articles.
1. Apt K. R. and Wallace M. G. 2007. Constraint Logic Programming Using ECLiPSe. Cambridge University Press. Apt K. R. and Wallace M. G. 2007. Constraint Logic Programming Using ECLiPSe . Cambridge University Press.
2. Transforming policies into mechanisms with infokernel
3. Baldwin J. H. 2010. About hot-plugging support in FreeBSD. http://www.mavetju.org/mail/view_message.php?list=freebsd-arch&id=3106757. Baldwin J. H. 2010. About hot-plugging support in FreeBSD. http://www.mavetju.org/mail/view_message.php?list=freebsd-arch&id=3106757.
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. llhsc: A DeviceTree Syntax and Semantic Checker;2023 53rd Annual IEEE/IFIP International Conference on Dependable Systems and Networks Workshops (DSN-W);2023-06
2. Configuring Unconnected Embedded Devices with Smartphones;Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering;2023
3. DSML4DT: A domain-specific modeling language for device tree software;Computers in Industry;2020-02