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

[Xen-devel] How to invoke hypercalls



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


 


Rackspace

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