All of lore.kernel.org
 help / color / mirror / Atom feed
* How to invoke hypercalls
@ 2006-08-13 15:00 antoinet
  2006-08-13 15:08 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: antoinet @ 2006-08-13 15:00 UTC (permalink / raw)
  To: xen-devel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-14 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-13 15:00 How to invoke hypercalls antoinet
2006-08-13 15:08 ` 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

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.