ChorusOS 4.0 Device Driver Framework Guide

Write Bus Driver Class-Specific Functions

At this step, you write the implementation for a specific hardware bus controller. In other words, the code has to be written for each function of the specified bus class, as defined in the API. These functions must then be provided to the subsequent level device drivers.


Note -

None of these functions is directly exported, but that all of them are defined as static functions, and then grouped as indirect calls in an "operations data structure" typed by the bus class API. The bus driver then gives this "operations data structure" as an argument to its child device driver's "probe" and "initialize" registered functions (see "Write Registry Functions", below).


In this way you can ensure that the visibility and use of the bus API is restricted to device drivers which are servicing a device connected to this bus.

Each bus class API is different. Thus, the functions to write are different for different classes of bus API. The complete list of the currently defined bus class APIs may be found in the ddi(9) man page.


Note -

All of these steps are performed in the example provided for the "Write General Functions" section below. See specifically the sections dealing with the ISA bus.