Changes between Version 6 and Version 7 of DeviceDrivers


Ignore:
Timestamp:
2011-10-20T08:30:52Z (13 years ago)
Author:
Jiri Svoboda
Comment:

Start DDF driver structure

Legend:

Unmodified
Added
Removed
Modified
  • DeviceDrivers

    v6 v7  
    2525
    2626== DDF Driver Structure ==
     27
     28When HelenOS runs the driver is an executable stored in {{{/drv}}} (e.g. {{{/drv/foo}}}). The driver is normally started automatically by the Device Manager. When the driver is needed, the Device Manager will start it and the driver connects to the Device Manager.
     29
     30In HelenOS source tree drivers are located under {{{uspace/drv}}}. To add a new driver ''foo'', you need to:
     31 * create a directory {{{uspace/drv/a/b/foo}}}
     32 * create a makefile {{{uspace/drv/a/b/foo/Makefile}}}
     33 * create at least one source file {{{uspace/drv/a/b/foo/foo.c}}}
     34 * add directory {{{uspace/drv/a/b/foo}}} to the DIRS definition in {{{uspace/Makefile}}}
     35
     36You can use an existing driver as a starting point, for example {{{uspace/drv/test/test1}}}. A driver is a C program similar to a HelenOS server or application. It is linked with {{{libdrv}}} (and the makefile should add libdrv's include path to the header search paths). The most basic DDF interfaces are defined in the header {{{ddf/driver.h}}}.
    2737
    2838 * #include <ddf/driver.h>