From mboxrd@z Thu Jan 1 00:00:00 1970 From: antoinet Subject: How to invoke hypercalls Date: Sun, 13 Aug 2006 17:00:42 +0200 Message-ID: <44DF3E9A.4070507@schoggi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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