From owner-freebsd-emulation@FreeBSD.ORG Fri Nov 23 21:29:43 2012 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D61CA683; Fri, 23 Nov 2012 21:29:43 +0000 (UTC) (envelope-from garmitage@swin.edu.au) Received: from gpo2.cc.swin.edu.au (gpo2.cc.swin.edu.au [136.186.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 6C2388FC19; Fri, 23 Nov 2012 21:29:42 +0000 (UTC) Received: from [136.186.229.44] (garmitage3.caia.swin.edu.au [136.186.229.44]) by gpo2.cc.swin.edu.au (8.14.3/8.14.3) with ESMTP id qANLTf5x003083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 24 Nov 2012 08:29:41 +1100 Message-ID: <50AFEAC5.6040607@swin.edu.au> Date: Sat, 24 Nov 2012 08:29:41 +1100 From: grenville armitage User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111003 Thunderbird/7.0.1 MIME-Version: 1.0 To: freebsd-emulation@freebsd.org, freebsd-arm@freebsd.org Subject: FreeBSD-CURRENT on Qemu-emulated Gumstix Verdex? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 21:29:44 -0000 All, Apologies if I have the wrong lists, feel free to redirect me. I recently decided to try getting an arm build of 10.0-CURRENT (r243319) (TARGET=arm KERNCONF=GUMSTIX-QEMU) running inside a Qemu-emulated Gumstix Verdex board, using qemu-devel (1.1.1) as the emulator. Short version: I fire up qemu-system-arm with "-m 768" to make sure there's enough virtual RAM. u-boot reports the emulated Verdex board as having 256MB of DRAM (I believe this limit is imposed by u-boot). But when control passes to FreeBSD the kernel prints the usual copyright messages, detects the CPU type ("PXA27x step C-0 (XScale core)"), auto-detects 512MB of real memory rather than 256MB and promptly panics (with "panic: vm_page_insert: page already inserted"). The problem appears to be FreeBSD auto-detecting twice the emulated available RAM. Does this ring any bells with anyone? My google-fu has so far failed me. (I've been contemplating trying this for awhile, since noticing sys/arm/conf/GUMSTIX-QEMU was added to head earlier this year. Admittedly GUMSTIX-QEMU relies on GUMSTIX, which notes it is for the Basix and Connex boards. So I recognise that the answer when emulating Verdex boards might simply be "don't do that".) FWIW, this is a side project to get an emulated ARM environment running on my amd64 box for building ARM Ports. I've also tried booting the same kernel using Qemu's emulation of the Gumstix Connex board -- this does seem to work, but the emulated 64MB RAM is too tight. (http://matrossi.blogspot.com.au/2011/09/freebsd-arm-on-qemu-in-virtualbox.html was my early motivation for doing this.) FWIW#2, the actual console output during a failed boot: ----------------------------------------------- % qemu-system-arm -M verdex -m 768 -pflash flash6-moduboot -net nic -net tap -nographic pxa2xx_clkpwr_write: CPU frequency change attempt U-Boot 1.2.0 (May 10 2008 - 21:22:03) - PXA270@600 MHz - 1604 *** Welcome to Gumstix *** DRAM: 256 MB Flash: 32 MB Using default environment Hit any key to stop autoboot: 0 Instruction Cache is ON Copying kernel to 0xa2000000 from 0x01f00000 (length 0x00100000)...done ## Booting image at a2000000 ... Bad Magic Number GUM> bootelf 40000 -v bootelf 40000 -v Usage: bootelf - Boot from an ELF image in memory GUM> GUM> bootelf 40000 bootelf 40000 Loading .text @ 0xa0200054 (14400 bytes) Loading .rodata @ 0xa0203894 (356 bytes) Loading .rodata.str1.4 @ 0xa02039f8 (48 bytes) Loading .data @ 0xa0204a28 (28 bytes) Loading .real_kernel @ 0xa0204a44 (1565298 bytes) Clearing .bss @ 0xa0382cb8 (34080 bytes) ## Starting application at 0xa0200054 ... KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2012 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.0-CURRENT #4 r243319M: Fri Nov 23 13:34:32 EST 2012 root@nsk330-builder:/usr/obj/arm.arm/usr/wr1403nd-dev/head/src/sys/GUMSTIX-QEMU arm CPU: PXA27x step C-0 (XScale core) Little-endian DC enabled IC enabled WB enabled LABT branch prediction enabled 16KB/32B 64-way instruction cache 16KB/32B 64-way write-back-locking-A data cache real memory = 536870912 (512 MB) panic: vm_page_insert: page already inserted KDB: enter: panic ----------------------------------------------- cheers, gja