qemu help please

rayholland
Posts: 16
Joined: Thu Nov 26, 2009 3:38 pm

qemu help please

Post by rayholland » Sat Dec 05, 2009 3:32 pm

Hi,

I'm very new to embedded linux and ordered the mini2440 plus 5.6" display yesterday.
I have allready setup an ARM cross compile toolchain using buildroot and made a kernel (2.6.32-rc8) and jffs2 root filesystem (with busybox/SDL etc.) for the mini2440.
I can't wait till the board arrives, so i started playing with qemu to test my build for the mini2440.

Unfortunally I can't get it to work. Here's the output:
root@ubuntu-v:/home/raymond/embedded/qemu/mini2440/mini2440# ./mini2440_start.sh
Starting in .
./../arm-softmmu/qemu-system-arm -M mini2440 -drive file=./mini2440_snapshots.img,snapshot=on -serial stdio -kernel /tftpboot/uImage -mtdblock ./mini2440_nand.bin -show-cursor -usb -usbdevice keyboard -usbdevice mouse -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 -monitor telnet::5555,server,nowait
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
QEMU mini2440_reset: loaded default u-boot from NAND
QEMU mini2440_reset: loaded override u-boot (size 0)
QEMU mini2440_reset: loaded /tftpboot/uImage (size 200)
qemu: fatal: Trying to execute code outside RAM or ROM at 0x34000000

R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00000000 R15=34000000
PSR=400001d3 -Z-- A svc32
./mini2440_start.sh: line 36: 6710 Aborted $cmd
root@ubuntu-v:/home/raymond/embedded/qemu/mini2440/mini2440#

What am i doing wrong? Can someone tell me a step by step guide to get it working, please?

Van Der Hinferm
Posts: 10
Joined: Thu Dec 25, 2008 8:26 am

Re: qemu help please

Post by Van Der Hinferm » Tue Dec 08, 2009 11:09 am

Try to execute script from parent directory.

./mini2440/mini2440_start.sh

rayholland
Posts: 16
Joined: Thu Nov 26, 2009 3:38 pm

Re: qemu help please

Post by rayholland » Thu Dec 10, 2009 9:53 pm

you are right. stupid me. but how to proceed:

U-Boot 1.3.2-mini2440 (Dec 5 2009 - 07:27:50)

I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: 64 MiB
Found Environment offset in OOB..
*** Warning - bad CRC or NAND, using default environment

USB: S3C2410 USB Deviced
ERROR: usbd_device_event_irq(), 613: (3401f664,1) NULL device or device->bus
ERROR: usbd_device_event_irq(), 613: (3401f664,2) NULL device or device->bus
ERROR: usbd_device_event_irq(), 613: (3401f664,3) NULL device or device->bus
In: serial
Out: serial
Err: serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot: 0
MINI2440 #

rayholland
Posts: 16
Joined: Thu Nov 26, 2009 3:38 pm

Re: qemu help please

Post by rayholland » Fri Dec 11, 2009 1:57 am

ok, i set up a working tftp server (192.168.1.201) and now i'm trying to tftp the uImage in uboot. This gives me a timout.
i have tried to ping the tftp server in uboot, but it can not even find the server:

MINI2440 # ping 192.168.1.201
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
ping failed; host 192.168.1.201 is not alive
MINI2440 #

this is the printenv output:
MINI2440 # printenv
bootargs=root=/dev/mtdblock3 rootfstype=jffs2 console=ttySAC0,115200
bootcmd=
bootdelay=3
baudrate=115200
ethaddr=08:08:11:18:12:27
netmask=255.255.255.0
usbtty=cdc_acm
mtdparts=mtdparts=mini2440-nand:256k@0(u-boot),128k(env),5m(kernel),-(root)
mini2440=mini2440=0tb
bootargs_base=console=ttySAC0,115200 noinitrd
bootargs_init=init=/sbin/init
root_nand=root=/dev/mtdblock3 rootfstype=jffs2
root_mmc=root=/dev/mmcblk0p2 rootdelay=2
root_nfs=/mnt/nfs
set_root_nfs=setenv root_nfs root=/dev/nfs rw nfsroot=${serverip}:${root_nfs}
ifconfig_static=run setenv ifconfig ip=${ipaddr}:${serverip}::${netmask}:mini2440:eth0
ifconfig_dhcp=run setenv ifconfig ip=dhcp
ifconfig=ip=dhcp
set_bootargs_mmc=setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_mmc}
set_bootargs_nand=setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_nand}
set_bootargs_nfs=run set_root_nfs; setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_nfs} ${ifconfig}
mtdids=nand0=mini2440-nand
ipaddr=192.168.1.25
serverip=192.168.1.201
partition=nand0,0
mtddevnum=0
mtddevname=u-boot
setenv4=setenv ipaddr 192.168.1.25; setenv ethaddr
eth1addr=08:00:3e:03:01:11

Environment size: 1174/131068 bytes
MINI2440 #


what am i doing wrong? please help guys.

Delavar
Posts: 36
Joined: Mon Dec 22, 2008 12:03 pm
Contact:

Re: qemu help please

Post by Delavar » Fri Dec 11, 2009 5:47 am

You should set up /etc/qemu-ifup file and bridge interface. Try to google for it.

rayholland
Posts: 16
Joined: Thu Nov 26, 2009 3:38 pm

Re: qemu help please

Post by rayholland » Fri Dec 11, 2009 11:19 am

i setup a bridge, but somehow qemu won't work:
raymond@ubuntu-v:~/embedded/qemu/mini2440$ ./mini2440/mini2440_start.sh
Starting in ./mini2440
./mini2440/../arm-softmmu/qemu-system-arm -M mini2440 -drive file=./mini2440/mini2440_snapshots.img,snapshot=on -serial stdio -kernel /tftpboot/uImage -mtdblock ./mini2440/mini2440_nand.bin -show-cursor -usb -usbdevice keyboard -usbdevice mouse -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 -monitor telnet::5555,server,nowait
/etc/qemu-ifup: could not launch network script
Could not initialize device 'tap'
raymond@ubuntu-v:~/embedded/qemu/mini2440$

here the ifconfig output:
br0 Link encap:Ethernet HWaddr 00:0c:29:cd:08:61
inet addr:192.168.1.201 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fecd:861/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:610 errors:0 dropped:0 overruns:0 frame:0
TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:60204 (60.2 KB) TX bytes:9359 (9.3 KB)

eth0 Link encap:Ethernet HWaddr 00:0c:29:cd:08:61
inet6 addr: fe80::20c:29ff:fecd:861/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:610 errors:0 dropped:0 overruns:0 frame:0
TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:68974 (68.9 KB) TX bytes:6130 (6.1 KB)
Interrupt:19 Base address:0x2024

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:73 errors:0 dropped:0 overruns:0 frame:0
TX packets:73 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5608 (5.6 KB) TX bytes:5608 (5.6 KB)

tap0 Link encap:Ethernet HWaddr aa:e2:16:4c:22:45
inet6 addr: fe80::a8e2:16ff:fe4c:2245/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:572 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


root@ubuntu-v:~# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000c29cd0861 no eth0
tap0
pan0 8000.000000000000 no
root@ubuntu-v:~#

and the /etc/qemu-ifup
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2

This should be ok? Or am i missing something?
Again, please help!!!

Delavar
Posts: 36
Joined: Mon Dec 22, 2008 12:03 pm
Contact:

Re: qemu help please

Post by Delavar » Fri Dec 11, 2009 2:36 pm

It seems like qemu can't start /etc/qemu_ifup because of permissions. Start qemu with sudo may be a solution. Or somehow permit qemu start script with sudo commands in it.

rayholland
Posts: 16
Joined: Thu Nov 26, 2009 3:38 pm

Re: qemu help please

Post by rayholland » Sat Dec 12, 2009 1:46 am

permission are set ok. i can run the script '/etc/qemu-ifup tap0' manually without any problem. strange.

rayholland
Posts: 16
Joined: Thu Nov 26, 2009 3:38 pm

Re: qemu help please

Post by rayholland » Sat Dec 12, 2009 2:01 am

i got it working now. adding '#!/bin/sh' to the qemu-ifup script did the trick.

rayholland
Posts: 16
Joined: Thu Nov 26, 2009 3:38 pm

Re: qemu help please

Post by rayholland » Sat Dec 12, 2009 8:04 am

hi guys (and girls),

i need your help again. i have setup a nfs-server. how do i setup u-boot to boot the kernel (zImage) and rootfs (rootfs.arm.jffs2), both located in /tftpboot, over the network using nfs?

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests