can erlang code talk directly with device driver ?

Daniel Goertzen goertzen@REDACTED
Thu Jul 27 15:20:32 CEST 2006


Only OpenSource wrote:
> On 7/27/06, Javier París <javierparis@REDACTED> wrote:
>> El Jueves, 27 de Julio de 2006 12:36, Only OpenSource escribió:
>> > On 7/27/06, Ryan Rawson <ryanobjc@REDACTED> wrote:
>> > > Just write a erlang port or library.  See EDTK.
>> >
>> > Thanks Ryan.
>> >
>> > I downloaded the paper list on the snookles.com site
>> >
>> > However, I am looking for an example, wherein erlang program works 
>> with
>> >  - Network Device driver
>> >  - USB Device driver
>>
>> You mean ioctls? You would do that, as Ryan said, using a port. There 
>> is a
>> nice tutorial on how to do that on the web. In the network device 
>> case, if
>> wou are only going to use a socket, there is already a library for 
>> that: look
>> for gen_tcp and gen_udp.
>>
>> Regards.
>>
>
> Yes IOCTLS or something similar to that.
> As an illustration iptables on Linux implemented in erlang !
> Could you point out the url of the nice tutorial ?
>
> For network device, I donot intend to use a socket !
> What are the options available from an Erlang perspective ?
>
> I am also keen to do a Erlang prototype for a Wireless USB device driver.
> Like to hear about what the erlang community has thought about this !
>
> In case I want to explore DMA in the erlang code, how do I do that ?
>
> Thanks in advance for any pointers.
>
If you want to solve the problem with Erlang, you need to think of it 
terms of message streams.  You'll need some way to get USB messages to 
an from the USB device.  I'm not that familiar in this area, but there 
must be some userland or kernel debugger that will give you access to a 
USB stream, perhaps as an erlang port or perhaps through direct file io 
with a device node.  On the other end of this you need some way to 
stream ethernet packets to and from a network interface.  The linux tap 
driver is what you want for this: it provides a device node on one end 
and network interface on the other.

Once you've figured out all that, you can write your elrang program that 
converts USB packets to ethernet frames and vice versa.

I would think DMA would happen at the USB subsystem level, so I doubt 
you need to think about that.

Cheers,
Dan.



More information about the erlang-questions mailing list