From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IoaFM-0001Z7-6Q for qemu-devel@nongnu.org; Sun, 04 Nov 2007 02:50:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IoaFK-0001Yv-Q8 for qemu-devel@nongnu.org; Sun, 04 Nov 2007 02:50:14 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IoaFK-0001Ys-L1 for qemu-devel@nongnu.org; Sun, 04 Nov 2007 02:50:14 -0500 Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IoaFJ-000308-PY for qemu-devel@nongnu.org; Sun, 04 Nov 2007 02:50:14 -0500 Received: from honiara.magic.fr ([195.154.193.36]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IoaFI-0002is-B3 for qemu-devel@nongnu.org; Sun, 04 Nov 2007 02:50:12 -0500 Subject: Re: [Qemu-devel] [RFC] linux-user (mostly syscall.c) From: "J. Mayer" In-Reply-To: <200711040151.09983.paul@codesourcery.com> References: <1194048343.2168.48.camel@phantasm.home.enterpriseandprosperity.com> <1194138960.2168.73.camel@phantasm.home.enterpriseandprosperity.com> <1194140125.16781.580.camel@rapid> <200711040151.09983.paul@codesourcery.com> Content-Type: text/plain Date: Sun, 04 Nov 2007 08:49:46 +0100 Message-Id: <1194162586.31210.21.camel@rapid> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org, thayne@c2.net On Sun, 2007-11-04 at 01:51 +0000, Paul Brook wrote: > > If you take a close look, you'll find more variations between Linux ABIs > > for different CPUs than between all BSD implementations: common syscalls > > of all BSD flavors do the same thing (and have the same ABI whatever the > > CPU...). You'll also find very few variations between the syscalls > > common to BSD & Linux because most of those directly map POSIX defined > > functions. > > Then, following the given argument, we never should try to share any > > code between linux-user for different targets, as the Linux ABI and > > behavior is different for different CPUs... > > I'd guess that the ones that are all the same are the ones that don't take any > real effort to implement in the first place. > > If you can combine the implementations I'd also expect to be able to do cross > emulation. e.g. run *BSD applications on a Linux host. This definitely works > for simple cases, even in the extreme case of a windows host - as you say > many syscalls map directly onto POSIX functions so there is only ever one > implementation. Whether it works well enough for real applications or whole > distributions of software I'm not so sure. If you can't do cross emulation > I'm sceptical about how much they can be combined. Ooops... I should have been more precise. In my idea, it was "BSD-on-Linux" I was talking about. Let's say OpenBSD / NetBSD. FreeBSD has some specific tricks that might be difficult to map on Linux (or even other BSD), not even talking of Darwin which is quite impossible to emulate (or if one wants to emulate the IOkit...). The main difficulty of emulating BSD on Linux is the sysctl syscall, the trace facilites and the ioctls. I guess we can forget the ioctls... Most of the other syscalls mappings are quite like mapping one Linux port to another. -- J. Mayer Never organized