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

Re: [MirageOS-devel] Mirage and sensor data

On Sun, Aug 17, 2014 at 6:35 PM, Phil Tomson <philtomson@xxxxxxxxx> wrote:
I'm very much a Xen newbie - ok, maybe not even that far along - so I hope this question isn't completely uninformed...

Do you have to have Linux running in dom0? Could it be a much simpler OSÂ that basically just allows access to GPIO without a lot of other overhead? Maybe I should back up a step: Is there always a Linux OS running in dom0 when you're running Mirage on a Cubieboard (as in your OSCON demo for example)?

On a Xen host, there's always something in dom0. Xen doesn't care what OS is running in dom0, but only certain OSes have the necessary Xen dom0 support available. Linux's Xen support is very good. You could create a cut down Linux configuration by removing all the drivers you don't need, and creating a trivial userspace (perhaps something based on an embedded Linux distro?) This is the path of least resistance for now.

One day it would be interesting to create a minimal Mirage-based dom0 kernel. I don't know what state the hardware is in when dom0 starts booting -- clearly the console works already. On Intel/AMD you'd "just" need to initialise the hardware to allow PCI devices to be passed-through to driver domains (running Linux/FreeBSD). How hard could it be? ;-)
Also, a bit of googling reveals http://wiki.xen.org/wiki/Driver_Domain
"A driver domain is unprivileged Xen domain that has been given responsibility for a particular piece of hardware. It runs a minimal kernel with only that hardware driver and the backend driver for that device class. Thus, if the hardware driver fails, the other domains (including Dom0) will survive and, when the driver domain is restarted, will be able to use the hardware again"

When they say "minimal kernel" there does that imply a Linux kernel?

A driver domain can have any kernel (Linux, FreeBSD, Mirage etc) but it needs a device driver for the physical hardware. If you wanted to run the same software on lots of different bits of hardware (say generic PCs or laptops) then you'll need a large number of drivers -- Linux would be a good choice for that. I doubt Mirage will ever rival Linux's physical hardware support :-) However if you have fixed hardware in mind then it's up to you.

I think Anil's suggestion of accessing GPIO in dom0 and serving requests over vchan is a good place to start. It would be worth asking on xen-devel whether a driver domain could be given access to the GPIO hardware-- I don't know what the possibilities are on ARM devices. On Intel/AMD driver-domains operate at the granularity of PCI devices. It's possible to "pass-through" specific PCI devices to driver domains, where they can perform DMA to virtual memory addresses handled by the IOMMU. I'm optimistic about ARM, since they seem to have done a nice job of their hardware virtualisation support generally.


On Sun, Aug 17, 2014 at 10:18 AM, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:
On 17 Aug 2014, at 12:14, Phil Tomson <philtomson@xxxxxxxxx> wrote:

I'm interested in Mirage for some embedded applications that interact with the Internet of Things either by http or other protocols (like MQTT or COAP).

So for example, let's say I've got a Cubieboard2 and I connect up an A/D board to collect data (temperature, weather data, etc.) and I want to setup an http server using Mirage that would serve up this data. The http part is straightforward. However, how does one interact with the GPIO pins on the Cubieboard? - that seems to be on the "other side of" Xen. So would one need to write some kind of device driver for Xen that interfaces to the Cubieboard's GPIO in order to do this? And if so, how would it be accessed by Mirage?

1. Is it possible?
2. If so, can you point me in the right direction?

The GPIO pins would, in the simplest instance, just be accessible from the Linux running in dom0. ÂAfter that, you can interface it to a Mirage VM via 'vchan':Âhttp://openmirage.org/blog/update-on-vchan

If you're feeling extra-paranoid, it's possible to move the GPIO handling code into an unprivileged VM, but the first step to do is to figure out the GPIO/Linux runes in dom0 first.

I'd be very interested in seeing how this goes...


MirageOS-devel mailing list

Dave Scott
MirageOS-devel mailing list



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