Drivers

Vance Shipley <>
Fri Jun 22 04:21:16 CEST 2001


Karel,

I am also working on a driver now.  The best documentation I have
found is in the ERST User's Guide (3. How to implement an alternative 
carrier for the erlang distribution).  This discusses an example 
linked in driver.

> However, in the (old) documentation that I downloaded from the net, I am
> supposed to change the contents of the 'config.c' file before
> compilation and linking. The problem is I cannot find this file. Can
> somebody help me with this. And how do I link the file into the Erlang

You will however want to use the new Dynamic Driver Loader and Linker
(erl_ddll) which is documented in the Kernel Reference Manual.  This
allows you to install your new driver on a running system without
having to recompile the kernel.  With this method you won't need to 
worry about the above.


> I have written a 'C1.c' file which is supposed to be a linked-in Erlang
> driver:
> 
> -----------------------------------------
> #include <stdio.h>
> #include "erl_driver.h"

You are including the newer header file (driver.h was the old) so that's
a good start.

> Except for a warning message, I have successfully compiled the file with
> the following command:
> 
> gcc -c -I/mnt/hda2/kvo7B-1/otp_src_R7B-1/erts/emulator/beam C1.c -o C1

To go the dll (dynamically linked library) route you'll need to add -fPIC.


I found it quite a struggle to determine how all of this was supposed to
work, especially because I chose to use threads, asynchronous I/O etc.
My source code now serves to document the new features in the driver code
(as best as I understand them).  I do plan to release all of this when
I'm done.  Contact me directly if you need more help.

	-Vance

Vance Shipley
Motivity Telecom Inc.
+1 519 579 5816




More information about the erlang-questions mailing list