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

Daniel Goertzen dang@REDACTED
Fri Dec 2 17:21:51 CET 2011


Sanya is correct.

You would need to write a device driver that implements the block device
interface and also provides a conduit to userspace; probably a character
device node which Erlang could read and write.  After being spoiled by
Erlang, writing linux device drivers in C will make you want to rip your
hair out. :)

Incidentally, people abuse the existing NBD client driver to write their
own userspace block devices.  You could easily do the same without having
to touch kernel code at all.

Dan.

On Tue, Nov 29, 2011 at 5:23 PM, Motiejus Jakštys <desired.mta@REDACTED>wrote:

> 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
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
*Daniel Goertzen
Senior Software Engineer
*--
*Network Integrity Systems
*We Bring Security To Light(tm)

1937 Tate Blvd. SE
Hickory, North Carolina 28602

Phone: 828.610.4596
Fax: 828.322.5294


Network Integrity Systems' INTERCEPTOR(tm) Optical Network Security System is
a Smart-PDS(tm) that ensures superior protection and cost effectiveness of
classified networks.

For more information, visit our website at: www.networkintegritysystems.com
 <*http://www.networkintegritysystems.com*>
__________________________________________
INTERCEPTOR(tm) Optical Network Security System is made in the USA for the
USA. Although not an export controlled item, because of the role it plays
in the assurance of the safety and integrity of National Security
Information, Network Integrity Systems (NIS) is committed to compliance
with the U.S. Export Administration Act. Accordingly, NIS will not ship
INTERCEPTOR products to certain foreign government end users without U.S.
government approval and will refuse transactions with individuals or
entities that have been denied export privileges.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111202/8f3ac616/attachment.htm>


More information about the erlang-questions mailing list