|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Native hypercall basics using int 82
Hi,
I'm trying to detect if I'm running as a guest in XEN hypervisor using a simple hypercall like __HYPERVISOR_xen_version with the XENVER_extraversion option. I cannot use any of the API functions for this so I'm trying to setup the required registers and call int 82 myself.
This is what I do and unfortunately, it generates an exception 0xd when executing INT 82.
Reading the source, I think I've figured out that I should put my arguments in a hypercall struct shown below. I might be wrong then.
Thanks in advance David
--- char buffer[256]; HYPERCALL hypercall; PHYPERCALL phypercall = &hypercall;
hypercall.op = 17; // xen_version hypercall.arg[0] = (unsigned long) 1; // xen_extra_version
hypercall.arg[1] = (unsigned long) Buffer;
memset(Buffer, 0, sizeof(Buffer));
_asm { PUSH EDI; PUSH ESI; PUSH EDX; PUSH ECX; PUSH EBX; PUSH EAX;
MOV EAX, phypercall; INT 82; POP EAX; POP EBX; POP ECX POP EDX; POP ESI; POP EDI; }
BufferA[255] = '\0'; Cprintf("Buf: %s\r\n", Buffer);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|