Spunky #6: CPU device driver

genodians.org
4 min read
fairly easy
Article URL: https://genodians.org/m-stein/2021-09-02-spunky-6 Comments URL: https://news.ycombinator.com/item?id=28403585 Points: 1 # Comments: 0
Spunky #6: CPU device driver

In this article series I illustrate the development of an Ada kernel for Genode named Spunky. The approach is to first successively translate parts from the C++ base-hw kernel and temporarily integrate them with the remaining C++ parts. Once, the whole Kernel made it to Ada, Spunky can be further developed independently to benefit from the characteristics of Ada or even SPARK. This time, I'll talk about the port of the CPU device driver and about the use of the GNAT binder for the Spunky main package.

You can find the code behind this article on my Github branch. If you're interested in the discussion around Spunky, you may have a look at the Github issue. And finally, this is a list of all articles in this series:

Porting the CPU device driver

Preparing the base-hw classes for being ported to Ada has almost become a routine. The main challenge this time was to first get an overview of all the parts that form the CPU device driver and how they are connected to the generic code (the different abstractions and platforms of base-hw can be confusing here), and second to get rid of others deriving from CPU driver stuff. The latter had also quiet a clean-up effect for base-hw itself.

Simply speaking, base-hw has two CPU abstractions. One is the class Genode::Cpu , the device driver with hardware-specific implementations. It provides a generic interface for things like maintaining CPU caches and reading…
Read full article