Received: from eggs.gnu.org ([140.186.70.92]:47472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJt97-0000rb-LJ for qemu-devel@nongnu.org; Tue, 10 May 2011 16:03:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJt96-0003Bm-Iv for qemu-devel@nongnu.org; Tue, 10 May 2011 16:03:05 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:57553) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QJt96-00039l-6s for qemu-devel@nongnu.org; Tue, 10 May 2011 16:03:04 -0400 From: =?utf-8?Q?Llu=C3=ADs?= References: <234739.74527.qm@web38402.mail.mud.yahoo.com> Date: Tue, 10 May 2011 22:02:52 +0200 In-Reply-To: <234739.74527.qm@web38402.mail.mud.yahoo.com> (Tarmo Pikaro's message of "Tue, 10 May 2011 11:13:48 -0700 (PDT)") Message-ID: <87liyeb9xv.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Binary translation (of code) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Tarmo Pikaro writes: >> It would be much easier to ship an executable containing both the guest >> application and qemu, so that executing it starts qemu with a >> pre-defined configuration and runs the guest binary. > > - Binary recompilation would allow faster execution than emulated code QEMU does precisely that, using a JIT. You wouldn't obtain much more performance by generating a pre-translated binary instead of using QEMU's JIT. And that's without taking into account the difficulties associated with the static binary analysis that would be required (as others have already pointed to you to in previous mails). > - qemu constantly changes (based on=C2=A0amount of patches provided in th= is > mail list) - in order to keep image+qemu working - simplest way is to con= vert=20 > into > executable. Btw - qemu could be used as a bootstrap to image as well. > :-) Maybe you didn't understand what I was saying. Think of it as a self-extracting executable that contains both a specific qemu binary, as well as the guest binary you want to execute. When you execute that bundle, it transparently extracts both components (qemu + the guest application) and starts qemu to execute that application. Still, this is a poor approach from the software maintenance point of view, and falls into the kind of strategies that windows application developers use (bundle private copies of each library the application is going to use). > - And finally modular "emulation" - it would be possible to recompile ind= ividual > .dll to another os. I suppose you meant another architecture, as recompiling to another OS makes no sense on the general case (can have a completely different set of syscalls). Still, I don't see the point of translating a single library instead of the whole application (specially when you have access to a library compiled for you target architecture, or even better access to the source code to compile that library to whatever target you desire). > Side effects would be: > > - More difficult to debug - since mapping to original binary image should= be=20 > somehow > maintained - if register dump helps anyhow the developer. As others have told you, qemu already has an interface to allow gdb to debug the guest application. Lluis --=20 "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth