[PTLsim-devel] Making ptlctl a 32-bit executable for 32-bit domU?

Matt T. Yourst
Tue Mar 6 20:05:42 EST 2007


On Tuesday 06 March 2007 18:55, Edward Lee wrote:
> Building ptlctl seems to only work from a 64-bit host with Makefile
> setting PTLSIM_HYPERVISOR=1. But that generates a 64-bit executable
> that won't run on a 32-bit guest. Controlling PTLsim for a 32-bit domU
> - is the only way from "outside" (dom0)?

By "32-bit domU", I assume you mean all the libraries and executables are 
32-bit, but the kernel is still 64-bit (the current PTLsim doesn't support 
32-bit-only kernels yet).

I just checked and there is no easy way to compile a 32-bit ptlctl program, 
since the special PTLCALL instruction (0x0f37) is only defined in x86-64 mode 
(because of the registers used for parameters). We could probably fix this in 
the next release - it's required if you want to embed PTLCALLs in a benchmark 
executable that happens to be 32-bit.

I'd suggest you compile ptlctl as a statically linked 64-bit executable, then 
copy it to your disk image. It will be the only 64-bit program in the disk 
image, but it won't require any outside libraries.

In the Makefile:

ptlctl: ptlctl.o $(BASEOBJS) $(STDOBJS)
  g++ -O2 ptlctl.o $(BASEOBJS) $(STDOBJS) -o ptlctl -static
                                                    ^ add this

That should fix it.

- Matt

-------------------------------------------------------
 Matt T. Yourst               yourst at cs.binghamton.edu
 Binghamton University, Department of Computer Science
-------------------------------------------------------


More information about the PTLsim-devel mailing list