Chapter 17
Kernel Device Driver Support: liboskit_dev.a

This chapter is extremely incomplete; it is basically only a bare skeleton.

17.1 Introduction

This library provides default implementations of various functions needed by device drivers under the OSKit device driver framework. These default implementations can be used by the host OS, if appropriate, to make it easier to adopt the driver framework. The facilities provided include:

XXX: oskit_dev_init() call this to init libdev

XXX: oskit_dev_probe() call this after init to probe for devices

17.2 Device Registration

XXX Builds a hardware tree. An example hardware tree is shown in Figure 17.1.


PIC

Figure 17.1: Example Hardware Tree

Roughly. . . the library is initialized through a call to oskit_dev_init. It first does auto-configuration by calling the initialization and probe routines of the different driver sets. After auto-configuration, it builds a device tree representing the topology of the machine. While building the tree, it also organizes the drivers into “driver sets.” A driver set consists of driver that share a common set of properties. After initialization, the library is ready to perform I/O requests for the OS.

void oskit_dev_init(void);

This function initializes the library.

void oskit_dev_probe(void);

This function probes for devices.

17.3 Naming

To be done.

17.4 Memory Allocation

Default implementation uses the LMM.

17.5 Buffer Management

Provides a “simple buffer” implementation, in which buffers are simply regions of physically- and virtually-contiguous physical memory.

17.6 Processor Bus Resource Management

XXX to allocate and free IRQs, I/O ports, DMA channels, etc.