Hi,
The first release of the QEMU x86 emulator is available at http://bellard.org/qemu/. QEMU achieves a fast user space Linux x86 emulation on x86 and PowerPC Linux hosts by using dynamic translation. Its main goal is to be able to run the Wine project on non-x86 architectures.
Fabrice.
Hi Fabrice,
The first release of the QEMU x86 emulator is available at http://bellard.org/qemu/. QEMU achieves a fast user space Linux x86 emulation on x86 and PowerPC Linux hosts by using dynamic translation. Its main goal is to be able to run the Wine project on non-x86 architectures.
Using gcc to generate code snippets is a *great* idea! This makes it really easy to port; I've already got it running on s390 ...
A couple of minor observations:
- What do you need the linker scripts for? Is it only to choose a non-standard offset? If so, I guess it would be less error- prone to use the currently installed scripts ('ld --verbose') and just change the offset using sed or so ...
- The test-i386 case gives differing results (even on i386) for several sh[lr]dw cases and for sin(2.0) ...
- syscall.c would refuse to build due to prototype mismatch; this patch fixes it:
diff -urN qemu-0.1/syscall.c qemu-0.1-s390/syscall.c --- qemu-0.1/syscall.c 2003-03-23 21:18:13.000000000 +0100 +++ qemu-0.1-s390/syscall.c 2003-03-24 22:27:41.000000000 +0100 @@ -103,10 +103,10 @@ extern int flock(int, int); extern int setfsuid(int); extern int setfsgid(int); -extern int setresuid(int,int,int); -extern int getresuid(int *,int *,int *); -extern int setresgid(int,int,int); -extern int getresgid(int *,int *,int *); +extern int setresuid(uid_t, uid_t, uid_t); +extern int getresuid(uid_t *, uid_t *, uid_t *); +extern int setresgid(gid_t, gid_t, gid_t); +extern int getresgid(gid_t *, gid_t *, gid_t *);
static inline long get_errno(long ret) {
B.t.w are shared libraries supposed to work already?
Thanks, Ulrich
Ulrich Weigand wrote:
Hi Fabrice,
The first release of the QEMU x86 emulator is available at http://bellard.org/qemu/. QEMU achieves a fast user space Linux x86 emulation on x86 and PowerPC Linux hosts by using dynamic translation. Its main goal is to be able to run the Wine project on non-x86 architectures.
Using gcc to generate code snippets is a *great* idea! This makes it really easy to port; I've already got it running on s390 ...
A couple of minor observations:
- What do you need the linker scripts for? Is it only to choose a non-standard offset? If so, I guess it would be less error- prone to use the currently installed scripts ('ld --verbose') and just change the offset using sed or so ...
Yes, it is just to change the binary base address. My futur plan is to build an "executable shared library" like ld.so and to relocate it dynamically as soon as I know where the ELF file wants to be mapped.
- The test-i386 case gives differing results (even on i386) for several sh[lr]dw cases and for sin(2.0) ...
For sh[lr]dw I discovered yesterday it is *really* CPU dependent as mentionned in the intel doc if the shift is >= 16 (I am using a K6). Strange for sin(2.0).
- syscall.c would refuse to build due to prototype mismatch; this patch fixes it:
diff -urN qemu-0.1/syscall.c qemu-0.1-s390/syscall.c --- qemu-0.1/syscall.c 2003-03-23 21:18:13.000000000 +0100 +++ qemu-0.1-s390/syscall.c 2003-03-24 22:27:41.000000000 +0100 @@ -103,10 +103,10 @@ extern int flock(int, int); extern int setfsuid(int); extern int setfsgid(int); -extern int setresuid(int,int,int); -extern int getresuid(int *,int *,int *); -extern int setresgid(int,int,int); -extern int getresgid(int *,int *,int *); +extern int setresuid(uid_t, uid_t, uid_t); +extern int getresuid(uid_t *, uid_t *, uid_t *); +extern int setresgid(gid_t, gid_t, gid_t); +extern int getresgid(gid_t *, gid_t *, gid_t *);
static inline long get_errno(long ret) {
OK.
B.t.w are shared libraries supposed to work already?
Yes. A new version is at http://bellard.org/qemu. I provided a binary install for glibc and wine. I tested /bin/ls succesfully on PowerPC with dynamic linking. On i386, wine works for some command line windows programms, but it terminates with a segfault...
Fabrice.
Hi Fabrice,
Yes, it is just to change the binary base address. My futur plan is to build an "executable shared library" like ld.so and to relocate it dynamically as soon as I know where the ELF file wants to be mapped.
Ah, I see.
- The test-i386 case gives differing results (even on i386) for several sh[lr]dw cases and for sin(2.0) ...
For sh[lr]dw I discovered yesterday it is *really* CPU dependent as mentionned in the intel doc if the shift is >= 16 (I am using a K6). Strange for sin(2.0).
The sin(2.0) case is now fixed, strange indeed.
But I've got another miscompare, this time with bsfw: -bsfw A=12340128 R=12340003 0 +bsfw A=12340128 R=00000003 0
However, this appears to be a test case bug: #define TEST_BSX(op, size, op0)\ {\ int res, val, resz;\ val = op0;\ asm("xorl %1, %1 ; " #op " %" size "2, %" size "0 ; setz %b1" \ : "=r" (res), "=q" (resz)\ : "g" (val));\ printf("%-10s A=%08x R=%08x %d\n", #op, val, resz ? 0 : res, resz);\ }
Note that when using 16-bit operations, the "=r" (res) is actually invalid, because the assembler code will leave the upper 16-bit undefined. I'd suggest setting res to a defined value before the asm and using "+r" (res).
Yes. A new version is at http://bellard.org/qemu. I provided a binary install for glibc and wine. I tested /bin/ls succesfully on PowerPC with dynamic linking. On i386, wine works for some command line windows programms, but it terminates with a segfault...
Great; /bin/ls works on s390 as well!
Bye, Ulrich
I put at http://bellard.org/qemu the necessary x86 binary files to try wine with qemu. It can now run graphical wine programs when emulating x86 on x86. PowerPC support will come as soon as I can grab a PowerPC computer for some time :-)
Fabrice.
On Sun, 23 Mar 2003 21:46:47 +0100 Fabrice Bellard fabrice.bellard@free.fr wrote:
The first release of the QEMU x86 emulator is available at http://bellard.org/qemu/. QEMU achieves a fast user space Linux x86 emulation on x86 and PowerPC Linux hosts by using dynamic translation. Its main goal is to be able to run the Wine project on non-x86 architectures.
It seems it might be in official kernel soon:
Date: Mon, 07 Apr 2003 12:40:38 +1000 From: Rusty Russell rusty@rustcorp.com.au Subject: [PATCH] Qemu support for PPC To: Fabrice Bellard fabrice.bellard@free.fr Cc: "linux-kernel@vger.kernel.org" linux-kernel@vger.kernel.org, "paulus@samba.org" paulus@samba.org, Marcelo Tosatti marcelo@conectiva.com.br
Paul, is this OK?
I'd like it in 2.4.21 if possible.
Thanks, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Name: Qemu Kernel Patch for PPC Author: Rusty Russell Status: Tested on 2.4.21-pre6
D: Allow (0.1.5 or above) qemu to set the personality for emulation, D: so files in /usr/gnemul/x86-linux get looked up before normal files D: (this is the standard way of hooking in emulation libraries, etc).
diff -urpN --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.4.21-pre6/Documentation/Configure.help working-2.4.21-pre6-wagner/Documentation/Configure.help --- linux-2.4.21-pre6/Documentation/Configure.help 2003-03-27 12:10:45.000000000 +1100 +++ working-2.4.21-pre6-wagner/Documentation/Configure.help 2003-04-04 17:15:21.000000000 +1000 @@ -4123,6 +4123,19 @@ CONFIG_BINFMT_JAVA binaries directly. Note: this option is obsolete and scheduled for removal, use CONFIG_BINFMT_MISC instead.
+Kernel support for Linux/Intel ELF binaries +CONFIG_X86_EMU + Say Y here if you want to be able to execute Linux/Intel ELF + binaries just like native binaries on your PPC machine. For + this to work, you need to have /usr/gnemul/x86-linux populated + with Intel libraries. etc. + + You may answer M to compile the emulation support as a module and + later load the module when you want to use a Linux/Intel binary. The + module will be called x86emu.o. If unsure, say Y. + ...
Date: Mon, 7 Apr 2003 12:29:10 +1000 From: Paul Mackerras paulus@samba.org Subject: Re: [PATCH] Qemu support for PPC To: Rusty Russell rusty@rustcorp.com.au Cc: Fabrice Bellard fabrice.bellard@free.fr, "linux-kernel@vger.kernel.org" linux-kernel@vger.kernel.org, Marcelo Tosatti marcelo@conectiva.com.br
Rusty Russell writes:
Paul, is this OK?
I'd like it in 2.4.21 if possible.
Looks good, I'd like it too.
Just one comment:
+Kernel support for Linux/Intel ELF binaries +CONFIG_X86_EMU
- Say Y here if you want to be able to execute Linux/Intel ELF
- binaries just like native binaries on your PPC machine. For
- this to work, you need to have /usr/gnemul/x86-linux populated
- with Intel libraries. etc.
- You may answer M to compile the emulation support as a module and
- later load the module when you want to use a Linux/Intel binary. The
- module will be called x86emu.o. If unsure, say Y.
This should say that you need qemu as well, and it should probably include the URL to Fabrice's qemu web page.
Paul.
Regards, Nerijus