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

Re: [Xen-devel] How to invoke hypercalls


  • To: antoinet <xen@xxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Aca+6lmCl/hpiCrdEdupUAANk04WTA==
  • Thread-topic: [Xen-devel] How to invoke hypercalls

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


 


Rackspace

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