From owner-freebsd-arm@FreeBSD.ORG Thu Jul 16 14:16:30 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD6151065733; Thu, 16 Jul 2009 14:16:30 +0000 (UTC) (envelope-from jacques.fourie@gmail.com) Received: from mail-bw0-f208.google.com (mail-bw0-f208.google.com [209.85.218.208]) by mx1.freebsd.org (Postfix) with ESMTP id 06C988FC1D; Thu, 16 Jul 2009 14:16:29 +0000 (UTC) (envelope-from jacques.fourie@gmail.com) Received: by bwz4 with SMTP id 4so133537bwz.43 for ; Thu, 16 Jul 2009 07:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=wmDsYnWXmhMAAovBCYMqnh23xwESb/hzWlci4aMjf9I=; b=YzMf137/rrVmZy0HFECJeQ4ssNrCvdm2dAFi7VzLo4W1Ph+ytZKf8cYeVzc0wLKLfz fKFK4y0S5WUU54ulFMRjFhwy779KdECY11WBOyTwUpQNi1E4a6USCNKJDc4g3qrsyCci WZRHHkfQX+RnZZRWhD77J7ON7181WBf7eHa5o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fU89mzD/setWc6Cb7t9NTqsJY4FD9o1xDSQ2jpAFUSyUnC5B8feeQ6q1hfrNCfawND uZixeQEr01MWRqiQ4LTKgd4q4PGiPksCL5WGI8HiUDIRpL9rFPAkQuULMu9UNYNS8tLg zrr/mXCK6/QI1Uzzubb1QSYMHX+QwutfDT6F0= MIME-Version: 1.0 Received: by 10.204.65.1 with SMTP id g1mr8874819bki.57.1247751820850; Thu, 16 Jul 2009 06:43:40 -0700 (PDT) In-Reply-To: <20090716171030.a0e7a3f0.stas@FreeBSD.org> References: <4734a3ed0907150752g595b680frcacba26da7979479@mail.gmail.com> <20090716171030.a0e7a3f0.stas@FreeBSD.org> Date: Thu, 16 Jul 2009 15:43:37 +0200 Message-ID: From: Jacques Fourie To: Stanislav Sedov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-arm@freebsd.org Subject: Re: qemu / boot parameter X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2009 14:16:31 -0000 On Thu, Jul 16, 2009 at 3:10 PM, Stanislav Sedov wrote: > On Wed, 15 Jul 2009 16:52:40 +0200 > Henri-Pierre Charles mentioned: > >> Hello list, I try to do my first FreeBSD/arm installation. I plan to >> use qemu. I've started with this page >> http://people.freebsd.org/~cognet/freebsd_arm.txt for kernel/world >> build. For my personnal teaching, I've summarized these instructions >> in the attached script. >> >> Now, I'm stuck with qemu. I've tried many invocation, and the best >> result I get is with qemu-system-arm hda.img -boot n =A0 =A0 =A0 =A0 =A0= \ >> =A0 =A0 -tftp $ARMFS/boot/kernel/ -bootp /kernel =A0\ >> =A0 =A0 -kernel $ARMFS/boot/kernel/kernel =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 \ >> =A0 =A0 -m 300 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0\ >> =A0 =A0 -M integratorc >> >> And I get : >> qemu: fatal: Trying to execute code outside RAM or ROM at 0xc0200100 >> (which is not far from KERNVIRTADDR) >> >> I miss something somewhere ? Any idea ? >> > > As far as I know we don't currently support qemu ARM/intergrator platform= . > However, current versions of qemu can emulate XScale devices (gumstix, > for example), so you may want to try this type of emulation with your > XScale kernel. > > Please note, however, that qemu usually emulate specific memory layouts > that may not match what FreeBSD kernel which was configured to run > on the different hardware would expect. =A0So a bit of hand-tweaking migh= t > be required. =A0You should study where qemu maps memory and onboard devic= es, > and how it passes the control to FreeBSD kernel and make the appropriate > modifications to the code/kernel config. > > Hope that helps. > > -- > Stanislav Sedov > ST4096-RIPE > Here is a recipe that worked for me on qemu 0.9.1. As far as I know it won't work with the qemu 0.10 but your mileage may vary. * Apply following patch to sys/arm/xscale/pxa/uart_bus_pxa.c (Patch by Mark Tinguely) static int uart_pxa_probe(device_t dev) { bus_space_handle_t base; struct uart_softc *sc; +#ifdef QEMU + base =3D (bus_space_handle_t)pxa_get_base(dev); + if (0x40100000 !=3D (unsigned int) base) + return (ENXIO); +#else /* Check to see if the enable bit's on. */ if ((bus_space_read_4(obio_tag, base, (REG_IER << 2)) & PXA_UART_UUE) =3D=3D 0) return (ENXIO); +#endif sc =3D device_get_softc(dev); sc->sc_class =3D &uart_ns8250_class; return(uart_bus_probe(dev, 2, PXA2X0_COM_FREQ, 0, 0)); } * Remove ARM_CACHE_LOCK_ENABLE from sys/arm/xscale/std.xscale and compile a GUMSTIX kernel * Build flash image: dd of=3Dflash bs=3D1k count=3D16k if=3D/dev/zero dd of=3Dflash bs=3D1k conv=3Dnotrunc if=3Du-boot-connex-400-r1604.bin dd of=3Dflash bs=3D1k conv=3Dnotrunc seek=3D256 if=3Dkernel.gz.tramp I start qemu as follows: qemu-system-arm -M connex -m 289 -pflash flash \ -nographic -serial tcp::4000,server \ -net nic,macaddr=3D52:54:00:12:34:50,vlan=3D0,model=3Dsmc91c111 \ -net tap,vlan=3D0,ifname=3Dtap1,script=3Dno I then telnet to port 4000 for the serial console and use 'bootelf 4000' in the uboot prompt to boot the kernel.