From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D4Srp-0000As-K2 for qemu-devel@nongnu.org; Thu, 24 Feb 2005 18:58:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D4Srn-00009y-HQ for qemu-devel@nongnu.org; Thu, 24 Feb 2005 18:58:01 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D4Srn-00009v-EQ for qemu-devel@nongnu.org; Thu, 24 Feb 2005 18:57:59 -0500 Received: from [65.74.133.9] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1D4Sd1-00068L-A4 for qemu-devel@nongnu.org; Thu, 24 Feb 2005 18:42:43 -0500 From: Paul Brook Subject: Re: [Qemu-devel] qemu capabilities Date: Thu, 24 Feb 2005 23:42:37 +0000 References: <200502241102.45308.joshua.kugler@uaf.edu> <1109280037.3975.193.camel@localhost.localdomain> In-Reply-To: <1109280037.3975.193.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_vZmHCiDhakXRoqc" Message-Id: <200502242342.39399.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, mwaite@redhat.com --Boundary-00=_vZmHCiDhakXRoqc Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thursday 24 February 2005 21:20, Michael Waite wrote: > I am wondering if anyone has tried using qemu in a way such that it > simulates another computer architecture such as: > > Set up an x86 host system and configure qemu to simulate a POWER > platform. The purpose would be to build application binaries for a > variety of platforms without having to physically have them. This would > also provide a testing environment such that an ISV could not only build > their packages but test and certify them as well. I have done this emulating arm on x86. Setup binfmt_misc with the appropriate magic, and it mostly just works. I've attached the setup script I use. I also gave ppc a quick try, but didn't get very far as the debian installer didn't work. Paul --Boundary-00=_vZmHCiDhakXRoqc Content-Type: application/x-shellscript; name="binfmt_misc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="binfmt_misc" #! /bin/sh # Setup binfmt_misc PROCDIR="/proc/sys/fs/binfmt_misc" FORMATS="ARM ARMS PPC PPCS" #ARM_SIM="/home/paul/arm/bin/arm-none-elf-run" ARM_SIM="/bin/qemu-arm-static" ARM_MAGIC='\x7f\x45\x4c\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00' ARM_MMASK='\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff' # Also do the same for shared libraries ARMS_SIM="$ARM_SIM" ARMS_MAGIC='\x7f\x45\x4c\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x28\x00' ARMS_MMASK='\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff' PPC_SIM="/bin/qemu-ppc-static" PPC_MAGIC='\x7f\x45\x4c\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14' PPC_MMASK='\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff' PPCS_SIM="$ARM_SIM" PPCS_MAGIC='\x7f\x45\x4c\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\x00x03\x00\x14' PPCS_MMASK='\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff' start_binfmt () { for f in $FORMATS; do eval echo ":${f}:M::\$${f}_MAGIC:\$${f}_MMASK:\$${f}_SIM:" \ > ${PROCDIR}/register done } stop_binfmt () { echo "-1" > ${PROCDIR}/status } # Abort is the filesystem is not mounted [ -f $REGFILE ] || exit 0 case "$1" in start) start_binfmt ;; stop) stop_binfmt ;; restart) stop_binfmt start_binfmt ;; *) echo "Usage: /etc/init.d/binfmt_misc {start|stop|restart}" exit 1 ;; esac --Boundary-00=_vZmHCiDhakXRoqc--