
The LDDK Toolkit
What is LDDK ?
LDDK stands for Linux Driver Development Kit, it is intended
to minimize the development time for a hardware driver module significantly.
The basic Philosophy of the toolkit is to describe a driver module in a
compact Driver Description Language (DDL)and translate it to a whole
driver module source tree either for further development or for direct
use as a loadable kernel module. Beginners should be able to write simple
drivers as easy as normal C-programs and add functionality step by step.
But also professional driver writers will appreciate the LDDK for the standardized
interface to the kernel that makes the driver easy to use and highly configurable.
The architecture of LDDK uses templates together with a simple macropreprocessor
language, so it is relatively flexible and extensible for adaption to newer
kernel releases. Inlined C-code can be used to perform the essential driver
tasks, so programmers need not to learn another new language. A DDL library
provides a higher level code repository to implement complex DDL modules.
All Makefiles and setup scripts in the sourcetree are maintained automatically
by the generator.

Fig. 1: The LDDK architecture
LDDK does many things in background for you but full access to all kernel
module features is granted.
Features of LDDK
Sourctree Generation:
- LDDK generates a whole sourcetree, including
- Makefiles and installation scripts
- user interface library
- scripting language support,
- online documentation from inlined description tags.
- function prototypes
LDDK is able to generate different driver types:
- Simple global character drivers. This drivers are using one
global major number for all its methods. (Methods are specified per module).
- Submodule Drivers that are using one major and several minor
numbers for different driver subclasses. (Methods are specified per minor
number).
- Core Modules, that only contain loadung/unloading (as used for
Realtime tasks for RTlinux)
Kernel Interface Support:
- LDDK supports the classical UNIX driver interface with the open(),
close(), read(), write(), ioctl(), mmap() etc calls as basic methods.
- The core module loading and unloading code is generated automatically.
- An easy-to-use procinfo interface supports the presentation
of driver status information in the /proc filesystem
- Support for the sysctl subsystem provides easy driver configuration
at runtime.
Debugging Support:
- All autogenerated functions contains intrinsic debugging code.
- A set of debugging macros can be used to provide this feature
to own routines.
- The verbosity of the debug information is configurable
at runtime or when the driver is loaded.
Additional features:
- Driver stub and library stub routines for ioctl() routines are automatically
generated, so you have the same calling conventions in the kernel as well
in the driver.
Scripting Language Support:
- If you have the swig
wrapper generator installed on your system, interfaces for Tcl/Tk,
Perl, Guile or Python can be generated automatically for all your ioctl()
functions.
Goodies:
- Together with LDDK comes the kernel ressouce manager that provides
a simple ressource registry system, similar to the X11 ressource database
for kernel drivers.
Availiability
Installation
Requirements:
- GCC 2.7.2 or higher
- Kernel 2.0.0 or higher
- gnu make
- SWIG (optional if you want the Scripting language support)
- Tcl/Tk (if SWIG is used)
Installation steps:
- Unpack the package to a directory (e.g /usr/local/src)
- cd to the lddk subdirectory
- type make
- type make install
Testing:
- cd to examples/basics
- execute ddl2c -m Simple.ddl , the simple module now should
be generated and compiled with gcc
- cd to the Simple sourcetree
- type make load to load the module in the kernel
- examine /usr/adm/syslog or type dmesg to see the
kernel messages from the Simple module
- unload the module with make unload
BUGS and Caveats
Currently the ddl compiler code is still very messy and many of the
LDDK features are hardwired.
Whenever a ddl file changes, the whole sourcetree wil be rebuilt.
clausi@chemie.fu-berlin.de