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

[Xen-devel] How to invoke hypercalls

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] How to invoke hypercalls
From: antoinet <xen@xxxxxxxxxxx>
Date: Sun, 13 Aug 2006 17:00:42 +0200
Delivery-date: Sun, 13 Aug 2006 08:00:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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
User-agent: Thunderbird 1.5.0.4 (X11/20060713)
Hello,
I am a computer science student and my assignment is porting an OS (pintos, http://www.stanford.edu/class/cs140/) as an unpriviledged Domain. I'm trying to invoke hypercalls as described in http://www-user.tu-chemnitz.de/~mien/materialien/sys/04-Hypercalls.pdf or http://www.o3one.org/xen.html#posp1 by using int 0x82:

------------------------------------------------------------------------

.section __xen_guest
        .ascii  "GUEST_OS=Mini-OS"
        .ascii  ",XEN_VER=xen-3.0"
        .ascii  ",HYPERCALL_PAGE=0x2"
        .ascii  ",LOADER=generic"
        .ascii  ",PT_MODE_WRITABLE"
        .byte   0

        .text

        .globl  _start
_start:
        cld

        movl    $18, %eax                       # __Hypervisor_console_io
        movl    $0, %ebx                        # CONSOLEIO_write
        movl    $hello_message_len, %ecx        # buffer length
        movl    $hello_message, %edx            # buffer virtual address
        int     $0x82

        movl    $6, %eax                        # __Hypervisor_sched_op_compat
        movl    $2, %ebx                        # SCHEDOP_shutdown
        movl    $0, %ecx                        # SHUTDOWN_poweroff
        int     $0x82

hang:   jmp     hang                            # shouldn't get here

hello_message:  .ascii  "This is the hello world program.\n"
        hello_message_len = . - hello_message

------------------------------------------------------------------------

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.
...

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?

Thanks,
Antoine

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

<Prev in Thread] Current Thread [Next in Thread>