[erlang-questions] Linux device driver communication with Erlang node

Motiejus Jakštys desired.mta@REDACTED
Wed Nov 30 00:23:43 CET 2011


Hello,

I am thinking of a way for Linux kernel driver to communicate with
Erlang node. The purpose is send binary blobs and have some logic:
* The blob has been ack'ed by erlang node
* Some business operation has been completed with the blob (by node)

C node seems to be the perfect match. Is there anything I should know
before starting messing around? Any possible gotchas running Erlang node
in kernel space? Has anybody tried that?

What I am trying to do
======================

I am thinking of implementing NBD stack with Erlang and C. NBD server is
easy (100% userspace), the client is more tricky, since device driver
code has to be kernel space.

NBD-client would consist of two parts:
* nbd.c that implements block device interface and talks to Erlang node
* Erlang node that communicates with another Erlang node nbd-server
  (which does the "business" part with the blob -- writes to disk)

RFC
===

For me distinction between "client" and "server" is unclear in the
tutorial: http://www.erlang.org/doc/tutorial/cnode.html Could somebody
explain it from the higher perspective?

I have never mixed C and Erlang before, and would appreciate some light
on C nodes generally. What is a C node from the system point of view?
Does it use sockets, pipes? What OS processes/threads does it spawn?

Many thanks,
Motiejus



More information about the erlang-questions mailing list