dynamically linked drivers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

dynamically linked drivers

Garry Hodgson-3

reading the erlang book on ports and drivers last night,
it appears that i must hand-compile a version of erlang
with my new driver linked in, after editing config.c to
reference it.  is this still accurate?  it doesn't seem
a very useful way to go, in an environment where i'd like
to use erlang to control various other software.  should
i abandon this method, and go with the other external
port methods?



--
Garry Hodgson                   Once in a while
Senior Hacker                   you can get shown the light
Software Innovation Services    in the strangest of places
AT&T Labs                       if you look at it right


Reply | Threaded
Open this post in threaded view
|

dynamically linked drivers

Ulf Wiger-4
On Tue, 16 Jan 2001, Garry Hodgson wrote:

>reading the erlang book on ports and drivers last night,
>it appears that i must hand-compile a version of erlang
>with my new driver linked in, after editing config.c to
>reference it.  is this still accurate?  it doesn't seem
>a very useful way to go, in an environment where i'd like
>to use erlang to control various other software.  should
>i abandon this method, and go with the other external
>port methods?

No, you don't have to recompile Erlang to link in a driver.
The documentation on drivers hasn't really kept up with current
events.

Read the manual for the module erl_ddll for information on how to
dynamically link drivers into an Erlang system.

You might also want to read the ERTS User's Guide in the OTP R7B
manual. There is a chapter on the driver for distributed erlang,
and it talks a little about drivers in general.

Still, if you can do with a normal port, you can save yourself the
headache of debugging pointer errors in your own driver code.
If, for performance reasons, you need your own driver, you can start
with a normal port, and add your own driver later, with minimal
changes to the erlang code.

/Uffe
--
Ulf Wiger                                    tfn: +46  8 719 81 95
Senior System Architect                      mob: +46 70 519 81 95
Strategic Product & System Management    ATM Multiservice Networks
Data Backbone & Optical Services Division      Ericsson Telecom AB



Reply | Threaded
Open this post in threaded view
|

dynamically linked drivers

Garry Hodgson-3
Ulf Wiger wrote:

> No, you don't have to recompile Erlang to link in a driver.
> The documentation on drivers hasn't really kept up with current
> events.

wonderful.  i'd kind of figured this was the case, given how well
thought out the rest of erlang is.

> Still, if you can do with a normal port, you can save yourself the
> headache of debugging pointer errors in your own driver code.

bugs?  in *my* code?  not bloody likely! :-)

thanks very much for the rapid and helpful response.
i'm looking forward to using this.  i've been looking
for an excuse to use erlang for some time now.


--
Garry Hodgson                   Once in a while
Senior Hacker                   you can get shown the light
Software Innovation Services    in the strangest of places
AT&T Labs                       if you look at it right