Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Nov 2012 08:29:41 +1100
From:      grenville armitage <garmitage@swin.edu.au>
To:        freebsd-emulation@freebsd.org, freebsd-arm@freebsd.org
Subject:   FreeBSD-CURRENT on Qemu-emulated Gumstix Verdex?
Message-ID:  <50AFEAC5.6040607@swin.edu.au>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50AFEAC5.6040607>