WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] How to invoke hypercalls

To: antoinet <xen@xxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] How to invoke hypercalls
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Sun, 13 Aug 2006 16:08:36 +0100
Delivery-date: Sun, 13 Aug 2006 08:17:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <44DF3E9A.4070507@xxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aca+6lmCl/hpiCrdEdupUAANk04WTA==
Thread-topic: [Xen-devel] How to invoke hypercalls
User-agent: Microsoft-Entourage/11.2.5.060620
On 13/8/06 4:00 pm, "antoinet" <xen@xxxxxxxxxxx> wrote:

> I compile this with:
> 
> as -o helloworld.o -a=helloworld.l helloworld.s
> ld -Ttext 0x100000 -o helloworld.elf helloworld.o
> 
> Unfortunately, i don't get any output (or better: i don't know where the
> output goes to). If I check the logs, the domain seems to shut down
> normally:
> 
> ...
> [2006-08-13 16:50:53 xend.XendDomainInfo] INFO (XendDomainInfo:818)
> Domain has shutdown: name=HelloWorld id=24 reason=poweroff.

Console output doesn't get logged, but you can connect to the console
automatically when the domain is created by adding option -c to the end of
your 'xm create' command line.

> I have also studied the mini-os in the xen source distribution
> (extras/mini-os) and I realized, that hypercalls are calls in specific
> entries of a hypercall_page. What is this page and where is it initialized?

It's now the preferred way of executing hypercalls. Rather than the old way
of:
     mov $hypercall_number,%eax
     int $0x82

You now do:
     call hypercall_page + hypercall_number*32

Where 'hypercall_page' is the virtual address of your hypercall page. In
your case your header specifies that the page should be set up at
pseudophysical page frame 2, so this will be at virtual address 0x12000. So
e.g., 'call 0x12000 + __HYPERVISOR_sched_op*32'.

In fact some version of ld don't relocate absolute targets properly. So
you're better writing the above as 'call _start + 0x2000 +
__HYPERVISOR_sched_op*32'.

Of course you really want to hide these details behind a C or asm macro.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel