From: antoinet <xen@schoggi.org>
To: xen-devel@lists.xensource.com
Subject: How to invoke hypercalls
Date: Sun, 13 Aug 2006 17:00:42 +0200 [thread overview]
Message-ID: <44DF3E9A.4070507@schoggi.org> (raw)
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
next reply other threads:[~2006-08-13 15:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-13 15:00 antoinet [this message]
2006-08-13 15:08 ` How to invoke hypercalls Keir Fraser
2006-08-13 17:54 ` antoinet
2006-08-13 17:51 ` Keir Fraser
2006-08-14 16:55 ` console hypercalls (was "How to invoke hypercalls") Hollis Blanchard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44DF3E9A.4070507@schoggi.org \
--to=xen@schoggi.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.