From owner-freebsd-mips@FreeBSD.ORG Mon Oct 20 01:31:24 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6250564F; Mon, 20 Oct 2014 01:31:24 +0000 (UTC) Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [IPv6:2607:f8b0:400d:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0E3D28A; Mon, 20 Oct 2014 01:31:23 +0000 (UTC) Received: by mail-qg0-f48.google.com with SMTP id i50so2785187qgf.7 for ; Sun, 19 Oct 2014 18:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=7NFMj5JuyhemqAEBCozhcw6ygYq+EtDQpNxsKkUxl2I=; b=JNPixWKo0gpIVGhy/uLI/j9R0d+w1BAgwWPFATLqWvYSmsu5q8yCanKO/Dhei3C7Wo CfX5quTKcEOrRQH5iJny5dTijpDXExi5sK/X49kxFjyK6bNOw/k5mWSYreZOO6gS+z5V EIpyfemqHctItFXQpF3koNJ+PBSQQa9mmPzVOcBgRtlhCamVWtiDUHuh27SqmYneJ+E2 K7ygYzwsg8VoE3AAOrkQlmrkFytdOuqKt0Xun8d/H+LPxv4CIbNHNylPW6CZyaojnxbv mWWFoqOJMFcpw1BZHgZLX20PGWZXl/M2mWjEyWHfQluvjsrk6dRGW4d3I9iObSdke5xD YF5w== X-Received: by 10.229.40.71 with SMTP id j7mr31529745qce.21.1413768683136; Sun, 19 Oct 2014 18:31:23 -0700 (PDT) Received: from kan ([2601:6:6780:7d0:226:18ff:fe00:232e]) by mx.google.com with ESMTPSA id m9sm6732714qac.18.2014.10.19.18.31.22 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 19 Oct 2014 18:31:22 -0700 (PDT) Date: Sun, 19 Oct 2014 21:31:15 -0400 From: Alexander Kabaev To: Juli Mallett Subject: Re: Trying to get MALTA64 running under qemu Message-ID: <20141019213115.336c997f@kan> In-Reply-To: References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/9LdL6l8iLSBHKJbl6ezXTP0"; protocol="application/pgp-signature" Cc: Ben Morrow , "freebsd-mips@FreeBSD.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 01:31:24 -0000 --Sig_/9LdL6l8iLSBHKJbl6ezXTP0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Sun, 19 Oct 2014 15:49:56 -0700 Juli Mallett wrote: > On Sun, Oct 19, 2014 at 3:34 PM, Ben Morrow wrote: >=20 > > Adrian Chadd wrote: > > > On 18 October 2014 15:59, Ben Morrow wrote: > > > > I'm considering buying an ERL to use as a local router, but > > > > before I > > did > > > > I thought I'd make sure the ports I want to run work properly > > > > with > > MIPS, > > > > so I'm trying to bring up a qemu-system-mips64 instance. I've > > > > built world and kernel (using MALTA64) for mips.mips64, and > > > > built a disk > > image > > > > following the instructions on the MipsEmulation page on the > > > > wiki. The source I am using is a slightly patched 10-STABLE > > > > from 2014-09-09; the patches have nothing to do with MIPS. > > > > > > > > However, when I try to bring qemu up, the system appears to > > > > hang after probing the ata devices. Over the course of about 30 > > > > seconds the qemu process goes up to 100% of one CPU, and no > > > > more output appears on the console. This appears to happen > > > > regardless of the disk images I pass to qemu; I've tried > > > > passing a UFS image, a file full of zeros, no disks at all, and > > > > (just in case) both -hda and -hdc. I've included the boot log > > > > below; I'd appreciate any advice. > > > > > > can you try qemu-devel? > > > > Thank you, that works. (Good God, it's slow... I wonder how hard it > > would be to replace cc with something that runs a cross-compiler on > > the host? Maybe I can do something with distcc...) > > >=20 > The optimal thing here is to use a user-mode emulator, whereby you can > effectively run a MIPS userland through qemu on a FreeBSD host, so > all of the kernel stuff is being done natively - which is a lot for > things like package building; others have done this for ARM, and I > believe that one of the groups using FreeBSD/MIPS was looking at > doing so for MIPS as well for the sake of package builds, etc. You > might create a new thread for user-mode MIPS emulation to see if any > of the right people notice and respond, or perhaps dig into what the > ARM folks have done. >=20 > Thanks, > Juli. There is not much to it, usermode emulation for mips64 just works for the purpose of the package building, that is how I have been doing it for a while now. I did not get the cross-toolchain going on, but even just running package builds under qemu-bsd-user on my amd64 machine lets me take advantage of multiple CPUs and much less restrictive amounts of memory and is a big win. Five lines recipe: 1. build and install emulators/qemu-user-static port or use package 2. build and install mips64 world info some location, say, make it /scratch/mips for the purpose of this recipe. 3. mount devfs info that image: sudo mount -t devfs devfs /scratch/mips/dev 4. copy /usr/local/bin/qemu-mips64-static info some place within the mips64 tree you have created above. /scratch/mips/usr/local/bin/qemu-mips64-static will do nicely. 5. start the mips64 shell:=20 sudo chroot /scratch/mips /usr/local/bin/qemu-mips64-static /bin/sh Voila, you are running in environment that is good enough to build many of the ports. Now, you can start playing with installing cross-tools into that image so that compilers/linkers are native and you do not pay the price of emulation to run them and start writing five line recipes for others :) --=20 Alexander Kabaev --Sig_/9LdL6l8iLSBHKJbl6ezXTP0 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iD8DBQFURGXpQ6z1jMm+XZYRAlH0AJ91s1Z8x+5nI8QZuFU2JLUrvaLAAQCdFk4Q yYNLQws1mv5hmqYo99m6X/k= =BTex -----END PGP SIGNATURE----- --Sig_/9LdL6l8iLSBHKJbl6ezXTP0--