36 | | You 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}}}. |
| 36 | You 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). |
| 37 | |
| 38 | An example driver makefile (with license stripped): |
| 39 | {{{ |
| 40 | USPACE_PREFIX = ../../.. |
| 41 | LIBS = $(LIBDRV_PREFIX)/libdrv.a |
| 42 | EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include |
| 43 | BINARY = foo |
| 44 | |
| 45 | SOURCES = \ |
| 46 | foo.c |
| 47 | |
| 48 | include $(USPACE_PREFIX)/Makefile.common |
| 49 | }}} |
| 50 | |
| 51 | The most basic DDF interfaces are defined in the header {{{ddf/driver.h}}}. |