Skip to contentSkip to conversation

Trans.: Device drivers and Xend

DISCUSSION [email protected] 2 participants 3 messages Sep 6, 2006 – Oct 17, 2006

lore
Share & tools
lore
#0 lore raw

Hi everybody

I am currently writting a split device driver for a custom device.

I have understood the way it works, I wrote the code (kernel module) but currently it is static (i.e. port number) because I am not using Xend.

And I want to use it, but I don't know how to add a new device type in Xend, i.e. which files are needed, ... I looked at blkif.py and netif.py, I know I have to write such a script for my new device, but what are the classes/object that must be present, the same for the methods ?

Also how do I set up a virtual custom device for the domains (XendDomainInfo.py ?) ?

In fact I search for a manual describing in details Xend, like a HowTo Xend device drivers, what I didn't find in the ML. I am using xen-2.0.7, so I think there is no XenBus and XenStore.

If somebody can give me advice.

Thanks.

#1 lore raw

Hi there,

It's great that you're working on Xen. Sounds like you're making good progress.

However, do you really have to use Xen 2.0.7? It's not really supported any more - the 3.x series gets all the attention these days. The main difference between the two from your point of view is probably in the control interface.

The Xend parts of the code are concerned with sending control messages to domains in the right sequence so that their drivers may handshake and set up shared memory / event channel. In Xen 3.x, the Xend components of a split driver are very different and *much* simpler, but you need to use XenStore in the devices.

Could you give any more detail about your device drivers? What requirements do they have? (shared memory pages, event channels, other metadata etc...)

Cheers,
Mark

Quoted 30 lines · On Wednesday 06 September 2006 15:10, [email protected] wrote:

Hi everybody

I am currently writting a split device driver for a custom device.

I have understood the way it works, I wrote the code (kernel module) but currently it is static (i.e. port number) because I am not using Xend.

And I want to use it, but I don't know how to add a new device type in Xend, i.e. which files are needed, ... I looked at blkif.py and netif.py, I know I have to write such a script for my new device, but what are the classes/object that must be present, the same for the methods ?

Also how do I set up a virtual custom device for the domains (XendDomainInfo.py ?) ?

In fact I search for a manual describing in details Xend, like a HowTo Xend device drivers, what I didn't find in the ML. I am using xen-2.0.7, so I think there is no XenBus and XenStore.

If somebody can give me advice.

Thanks.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 4 lines
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
#2 lore raw

Hi,

First thanks for your answer and your encouragements.

So first, why I am using Xen 2.0.7 instead of Xen 3.x, whereas things I want would be easier to implement with the Xen3 API, is because I need a XenoLinux 2.4 kernel. And, if I am right, Xen3 currently support Linux 2.6 but not 2.4. And... in fact it is the only reason.

Now, what I want to be implemented in my driver : when the front-end (corresponding to my driver) is loaded in a domU, I need an event channel to be set up and a shared memory page. By this way the front-end will communicate data to the back-end, by writing data in the shared memory page and sending a notification event. Something very classical. Of course, several front-end could connect to the same back-end.

So (I think) what I need (with Xen2) is to add in Xend the management of my new driver, by adding the right python script, like mydevif.py. I need to define my control message, like CMSG_MYDEV_CONNECT, to add them to /usr/lib/python/xend/server/messages.py. By this way when a front-end starts, it sends a CMSG_MYDEV_CONNECT via the control interface, and Xend creates the event channel between the back and front end and set up a shared memory page.

If I am right above, I just need to understand where to add the needed code in Xend, how to add a new device type, which are the methods / class to implement, ..., which seems difficult to me, as Xend is not well documented. Also if I want this virtual driver to be set up juste for particular guests, I need to modify the configuration script for domain and so xm, to add a new parameter, like mydev = 0 | 1. But once again, as the process of adding a new device type in Xend is not described, it seems difficult to me.

Of course, it seems that such things are really easier to implement in Xen3.x, as I saw in some examples. But I do really need a Linux 2.4 kernel, unfortunately.

So what I wondered first if is I am right on the above explanations, and if some body can tell me the tips I need about Xend.

Thanks again.

PS : If nobody can help me and that I don't succeed by myself in adding what I want in Xend, I will try with Xen3, but I really need a 2.4 Linux kernel (for dom0).

Selon Mark Williamson <[email protected]>:

Quoted 53 lines

Hi there,

It's great that you're working on Xen. Sounds like you're making good progress.

However, do you really have to use Xen 2.0.7? It's not really supported any more - the 3.x series gets all the attention these days. The main difference between the two from your point of view is probably in the control interface.

The Xend parts of the code are concerned with sending control messages to domains in the right sequence so that their drivers may handshake and set up shared memory / event channel. In Xen 3.x, the Xend components of a split driver are very different and *much* simpler, but you need to use XenStore in the devices.

Could you give any more detail about your device drivers? What requirements do they have? (shared memory pages, event channels, other metadata etc...)

Cheers,
Mark

Quoted 26 lines · On Wednesday 06 September 2006 15:10, [email protected] wrote:

Hi everybody

I am currently writting a split device driver for a custom device.

I have understood the way it works, I wrote the code (kernel module) but currently it is static (i.e. port number) because I am not using Xend.

And I want to use it, but I don't know how to add a new device type in Xend, i.e. which files are needed, ... I looked at blkif.py and netif.py, I know I have to write such a script for my new device, but what are the classes/object that must be present, the same for the methods ?

Also how do I set up a virtual custom device for the domains (XendDomainInfo.py ?) ?

In fact I search for a manual describing in details Xend, like a HowTo Xend device drivers, what I didn't find in the ML. I am using xen-2.0.7, so I think there is no XenBus and XenStore.

If somebody can give me advice.

Thanks.

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Quoted 6 lines

--
Dave: Just a question. What use is a unicyle with no seat? And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

--
Nicolas CLERMONT