[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Asking for information (newbie)



On 17 Mar 2014, at 10:27, Vasileios Anagnostopoulos <fithis2001@xxxxxxxxx> wrote:

Hi,

I recently accidentally came across mirage. It more or less seems a magical unikernel system but I have to delve to a lot of details in order to understand it.

I am interested in high-level device driver construction. I prefer to ask questions directly in mailing lists instead in getting lost in the noise of documentation.

Hi Vasileios!  Questions are very welcome as you explore.

What I am interested is whether it is possible to write a Blutetooth stack using USB transport in Mirage OS and  make it available in another VM.

For example a MirageOS BT driver over USB (possibly using USB passthrouth) and make it available for my e.g. Windows 7x86 or Minix3 VM.


What is involved (apart from me writing the stack)?

This is possibly easily enough using the split driver architecture of Xen.  You will need a USB backend driver that runs in dom0 (usually Linux) that will expose a virtualized protocol to the guest.  This happens as follows, using a virtual network driver as an example:

- the backend and frontend domains negotiate a shared memory ring over xenstore; https://github.com/mirage/mirage-net-xen/blob/master/lib/netif.ml#L185

- the shared ring has an event channel and a memory page associated with it, and an RPC protocol that is implemented by the Ring module in Mirage; https://github.com/mirage/shared-memory-ring

- each device driver type implements its own RPC message appropriate for the device driver in question.  For networking, it's the RX and TX modules (there is one ring for transmission and receipt of traffic); https://github.com/mirage/mirage-net-xen/blob/master/lib/netif.ml#L43.  This corresponds with the C implementation which you can find in the Xen tree (or the Linux pv_ops kernel source) https://github.com/mirage/xen/blob/master/xen/include/public/io/netif.h

- For USB, there is already a pv protocol defined, so you would need to implement this in OCaml (in the same style as the net/block devices -- it's a fairly mechanical translation). https://github.com/mirage/xen/blob/master/xen/include/public/io/usbif.h

Once that's done, you have a well-typed RPC channel for USB, and would need to implement the minimal pieces needed for Bluetooth.  You almost certainly don't want a whole Bluetooth stack (e.g. service discovery), but just the minimum to get connectivity over L2CAP shouldn't be too bad.  Let us know if you need any help on this -- it would be very nice to get a USB frontend working now that Xen/ARM is making so much good progress!

cheers,
Anil
_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.