Hi everybody! I need to use a GSM modem attached to a serial port from domU running Linux 2.6.11 on Xen 2.0.6 (or I could go with -testing if needed). I don''t use it for networking, but for text messaging - it talks to a database and some other processes, i.e. I''d really like to avoid having the userspace driver in dom0. Is that somehow possible? I only know about dedicating whole PCI devices to domains but how about giving them serial ports? Is that possible? Given that I know the IRQ/iobase, have kernel with drivers in domU, etc... Thanks! Giovanni _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> I don''t use it for networking, but for text messaging - it talks to a > database and some other processes, i.e. I''d really like to avoid > having the userspace driver in dom0. Is that somehow possible? I only > know about dedicating whole PCI devices to domains but how about > giving them serial ports? Is that possible?It''s doable technically but might require a bit of hacking on Xen and the tools to make it work. Otherwise the most straightforward way to deal with this would be to just share through dom0. Cheers, Mark> Given that I know the IRQ/iobase, have kernel with drivers in domU, etc... > > Thanks! > > Giovanni > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wednesday 27 July 2005 15:34, Mark Williamson wrote:> > I don''t use it for networking, but for text messaging - it talks to a > > database and some other processes, i.e. I''d really like to avoid > > having the userspace driver in dom0. Is that somehow possible? I only > > know about dedicating whole PCI devices to domains but how about > > giving them serial ports? Is that possible? > > It''s doable technically but might require a bit of hacking on Xen and the > tools to make it work. > > Otherwise the most straightforward way to deal with this would be to just > share through dom0.Another posible solution: Get a $10 USB->Serial adaptor, and share the USB device into domU. Those adaptors have some different timings compared to "real" serial ports, but if its just for AT Commands/GSM TextMessaging, you should be fine. (Does sharing individual USB Devices work, even if they require a kernel module driver? Or do you have to hand over the entire PCI device of the USB HCI to domU?) /Ernst _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> Another posible solution: > > Get a $10 USB->Serial adaptor, and share the USB device into domU. > Those adaptors have some different timings compared to "real" serial ports, > but if its just for AT Commands/GSM TextMessaging, you should be fine. > > (Does sharing individual USB Devices work, even if they require a kernel > module driver? Or do you have to hand over the entire PCI device of the USB > HCI to domU?)Sharing the whole PCI device for the USB host controller is necessary under Xen 2.0. We have code for sharing individual USB devices that''ll likely be available as part of the Xen 3.0 release. Cheers, Mark _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 7/28/05, Mark Williamson <mark.williamson@cl.cam.ac.uk> wrote:> > I don''t use it for networking, but for text messaging - it talks to a > > database and some other processes, i.e. I''d really like to avoid > > having the userspace driver in dom0. Is that somehow possible? I only > > know about dedicating whole PCI devices to domains but how about > > giving them serial ports? Is that possible? > > It''s doable technically but might require a bit of hacking on Xen and the > tools to make it work. > > Otherwise the most straightforward way to deal with this would be to just > share through dom0.What do you mean "share through dom0"? A kind of forwarding of ttyS? Running the userspace controller in dom0 is a bit tricky because it needs to talk to the database in domU (which is doable over TCP connection indeed) and as well uses FIFO for talking to some other daemon running in domU. That daemon shouldn''t run in dom0 either because the web interface talks to it as well. I hope I won''t end up running all this GSM beast, cron jobs and apache in dom0 just because of the serial port... How much work would it be to assign the port to domU? Thanks Giovanni _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wednesday 27 July 2005 15:58, Giovanni Bordello wrote:> > How much work would it be to assign the port to domU?Well, Serial Ports (16550 & co) still are accessed like ISA bus devices, for compatibility with DOS & PC/XT. Xen AFAIK only has support for giving PCI devices to domains other than domU, and I highly doubt that anyone is willing to implement ISA device sharing. So the easy solution of giving the serial port hardware to domU is IMHO out of the question (unless you have a PCI->Serial card, but then it should already work with the existing PCI sharing code) So what would be needed is a "Virtual character device", working like the Blockdevice FE/BE drivers, but transfering the ttyS device (with all IOCTLs and whatnot) to domU. (Quite a security hole, considering what you can do with IOCTLs on serial devices, but I''d guess its ok for trusted domUs) I think the much easier solution in your case would be to split your message server thingy in half, keeping a backend with HW access in dom0, and the application logic in domU, and only transfer the messages it should send over TCP. /Ernst _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 7/28/05, Ernst Bachmann <e.bachmann@xebec.de> wrote:> I think the much easier solution in your case would be to split your message > server thingy in half, keeping a backend with HW access in dom0, and the > application logic in domU, and only transfer the messages it should send over > TCP.Cool, that''s exactly what I just decided while having a shower ;-) I somehow hesitate to touch this old piece of software that was running smoothly up to now but that''s my problem of course. Thanks for all your answers guys and keep doing this great work! Giovanni _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> What do you mean "share through dom0"? A kind of forwarding of ttyS?If you can find some way of doing that, it''d be preferable (surely there must be some daemon that can do this?). Otherwise, I''m afraid it might be easiest to just split things between the two domains :-/> How much work would it be to assign the port to domU?I actually wouldn''t have thought it''d be too bad: to do PIO, all you''d need is to give the domU access to the relevant IO port range (and maybe plumb an interrupt through). It''s probably not much code but reasonable familiarity with codebase of Xen and the tools would be pretty necessary. Cheers, Mark _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> I actually wouldn''t have thought it''d be too bad: to do PIO, > all you''d need is to give the domU access to the relevant IO > port range (and maybe plumb an interrupt through). > > It''s probably not much code but reasonable familiarity with > codebase of Xen and the tools would be pretty necessary.Accessing serial ports directly from other domains work fine with the unstable tree. If you search you should be able to find an email thread about this some months back. Just compile a driver into the kernel and give it access to the ioport range it needs. Ian _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> Accessing serial ports directly from other domains work fine with the > unstable tree. If you search you should be able to find an email thread > about this some months back. Just compile a driver into the kernel and > give it access to the ioport range it needs.Do we actually have hooks in the tools for dedicating IO port ranges to domains? I checked when this thread started and it looked like the machinery was there in Xen but not exported to the user. If that''s the case, it should be a fairly easy patch for someone to roll up. Cheers, Mark _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> > Accessing serial ports directly from other domains work > fine with the > > unstable tree. If you search you should be able to find an email > > thread about this some months back. Just compile a driver into the > > kernel and give it access to the ioport range it needs. > > Do we actually have hooks in the tools for dedicating IO port > ranges to domains? I checked when this thread started and it > looked like the machinery was there in Xen but not exported > to the user.I thought this had been added to xend. Maybe I''m imagining it and just asigned a fake PCI device last time I tried this...> If that''s the case, it should be a fairly easy patch for > someone to roll up.Indeed. Volunteers? Ian _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users