Device-Driver-Environment Kit API
The Device-Driver-Environment (DDE) Kit provides a C API for developing device drivers. In principle, device drivers can be implemented directly using Genode's base API. But because most existing device drivers are implemented in C rather than C++, a C API such as DDE Kit facilitates the porting of existing device drivers. The functionality comprised in the DDE Kit covers all typical functions needed by device drivers and normally found in the kernel of a monolithic OS. The DDE Kit library translates the C API calls to Genode's Base API.
Initialization and types
function is the name of the initialization function and id is an user-defined identifier concatenated with the function name. The marked function is exported via a non-static symbol called dde_kit_initcall_<id>_<fn>. On driver startup, the driver environment has to explicitly call these functions. The signature of initialization functions is
extern int initcall_func(void);
For convenience, the os/tool/dde_kit_find_initcalls tool can be used to print all inititalization symbols in a list of binaries, e.g.
A demonstrative example for the usage of initcalls can be found in linux_drivers/src/test/dde_linux26_net/main.cc.
The memory subsystem provides slab caches and large-block allocators backed by physically contiguous RAM prepared for DMA operations. Memory allocated from the provided simple memory allocator cannot be used for DMA and is intended for meta-data memory blocks. A virtual page table implementation supports the bookkeeping of physical memory mappings into the drivers virtual address space. Note, slab cache and large-memory allocations are automatically added to the virtual page table.
The DDE kit supports registration of one handler function per interrupt. If any specific DDE implementation needs to register more than one handler, multiplexing has to be implemented there. Furthermore, the driver is supplied with a virtual PCI bus, where accessible PCI devices are connected.
The timer subsystem provides a generic timer implementation that enables users to execute a callback function after a certain period of time. Therefore, DDE kit starts a timer thread that executes callbacks and keeps track of the currently running timers. Moreover, the system tick can be accessed via the dde_kit_timer_ticks and jiffies symbols.