The Driver Description Language

The Driver Description Language (DDL) is an interface definition language, that describes interface handling methods to the kernel or from kernel (driver) to the user process. It consists of a mixup between pure DDL statements, macro expansion expressions and inlined C-code. Inlined C-code statemens or templates usualy contains macros that are expansed when the code is generated, some of this macros are defined implicitely so as the module name or the lddk version.

The Module Structure:

Each DDL module consists of a module header where the module name is declared and codeclass statements. Each codeclass describes an interface to the kernel or an interface to the user (for example the driver codeclass describes the interface for a classical unix driver, but it would be also imaginable to have codeclasses for filesystems or scsi interfaces, network protocolls or whatever). Depending on the implementation of a codeclass it can have options that controls certain global features of the generated interface. (one option of the driver codeclass is the major number for example)

Inside a codeclass the methods for handling certain tasks in the codeclass are described. A method can consist of a simple name and an inlined code statements but sometimes of a set of submethods. Additionally some codeclasses define special methods for administrative tasks such as generating header files ,c-code files that are bundled with the driver module later or just defining or overriding a macro. This provides maximal flexibility if the user needs to write own code for special tasks where no codeclass is defined.

Syntax Rules:

There are some special statements that have a special meaning in DDL:

/{ c-code }/

%< macro>

"a string"

/* comment */

/@ description @/

[ options ]

include filename

The module Header:

Each DDL module begins with a module header statement:

this statements sets the name of the driver module and thus the name of the sourcetree directory.

The Driver Codeclass:

Syntax:

Module Methods:

The Library Codeclass:

The library codeclass is intended to implement self contained user library routines, provided with a LDDK driver. Library functions are using the documentation statements in similar way as the ioctl functions. Additionally an user library function is exported to the scripting language file.

Will generate a file named name in the library subtree which defines the routine and a corresponding entry in the language .i file to specify the corresponding interface to the scripting language.

Additional Statements:

Each codeclass has some common methods defined to add user defined files in the sourcetree. For this purpose there are two methods defined in each codeclass:

both are used to define user functions, types structures or whatever.