qemu / boot parameter
Jacques Fourie
jacques.fourie at gmail.com
Thu Jul 16 14:16:31 UTC 2009
On Thu, Jul 16, 2009 at 3:10 PM, Stanislav Sedov<stas at freebsd.org> wrote:
> On Wed, 15 Jul 2009 16:52:40 +0200
> Henri-Pierre Charles <hpcharles at gmail.com> 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 \
>> -tftp $ARMFS/boot/kernel/ -bootp /kernel \
>> -kernel $ARMFS/boot/kernel/kernel \
>> -m 300 \
>> -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. So a bit of hand-tweaking might
> be required. You should study where qemu maps memory and onboard devices,
> 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 = (bus_space_handle_t)pxa_get_base(dev);
+ if (0x40100000 != (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) == 0)
return (ENXIO);
+#endif
sc = device_get_softc(dev);
sc->sc_class = &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=flash bs=1k count=16k if=/dev/zero
dd of=flash bs=1k conv=notrunc if=u-boot-connex-400-r1604.bin
dd of=flash bs=1k conv=notrunc seek=256 if=kernel.gz.tramp
I start qemu as follows:
qemu-system-arm -M connex -m 289 -pflash flash \
-nographic -serial tcp::4000,server \
-net nic,macaddr=52:54:00:12:34:50,vlan=0,model=smc91c111 \
-net tap,vlan=0,ifname=tap1,script=no
I then telnet to port 4000 for the serial console and use 'bootelf
4000' in the uboot prompt to boot the kernel.
More information about the freebsd-arm
mailing list