qemu got errors when boot u-boot

521 views
Skip to first unread message

prife

unread,
Jul 10, 2012, 1:50:19 PM7/10/12
to mini...@googlegroups.com
hi,all

I build the qemu,uboot from the git repo.  
then I do this:
qemu -M mini2440 -mtdblock u-boot  -serial stdio

while ,the qemu sometimes would get errors:

2440_init: Boot mode: nand
mini2440_init: .....
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
         
                 floating point exception

while sometimes, I could boot correctly to u-boot  prompt... does anyone meet this errors?

I got these web by google


Is there any help?

--
把有限的时间投入到无限的学习中去

prife

unread,
Jul 10, 2012, 2:27:34 PM7/10/12
to mini...@googlegroups.com
well, I got an idea..

when use mtdblock,  qemu just think it is an NAND flash, which a page = data + spare(oob),  while uboot is just a binary....

I will try write a python script make u=boot.bin to u-boot_nand.bin


2012/7/11 prife <gop...@gmail.com>



--
把有限的时间投入到无限的学习中去

prife

unread,
Jul 10, 2012, 3:41:32 PM7/10/12
to mini...@googlegroups.com
:-( nothing changes....

1.create a nand flash, with all 0xff filled..
prife@smart:~/work$ ./creatNand.py

prife@smart:~/work$ ls -lh u-boot.nand  
-rw-rw-r-- 1 prife prife 132M  7月 11 03:33 u-boot.nand   (128M nand flash, 1page = 2048+64)

2.copy the u-boot.bin to nand flash .
prife@smart:~/work$ ./mkuboot.py

3. run qemu 
prife@smart:~/work$ qemu -M mini2440 -mtdblock u-boot.nand -serial stdio
mini2440_init: Boot mode: NAND
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 3b400)
浮点数例外 (核心已转储),   while in Chinese it means " floating point exception(the core has been dumped")

retry, well,  this time it works..., 

prife@smart:~/work$ qemu -M mini2440 -mtdblock u-boot.nand -serial stdio
mini2440_init: Boot mode: NAND
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 3b400)
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=48
S3C: CLK=304 HCLK=304 PCLK=304 UCLK=48
S3C: CLK=304 HCLK=101 PCLK=50 UCLK=48
S3C: CLK=304 HCLK=76 PCLK=38 UCLK=48
S3C: CLK=304 HCLK=76 PCLK=38 UCLK=48
S3C: CLK=405 HCLK=101 PCLK=50 UCLK=48


U-Boot 1.3.2-mini2440 (Oct  6 2009 - 12:51:09)

I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  Bad block table not found for chip 0
Bad block table not found for chip 0
128 MiB
*** Warning - bad CRC or NAND, using default environment

USB:   S3C2410 USB Deviced
In:    serial
Out:   serial
Err:   serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot:  0 
MINI2440 # 
MINI2440 # 
MINI2440 # 

" floating point exception(the core has been dumped") 
this errors is often occurred, is there anyone who can fixed it??

2012/7/11 prife <gop...@gmail.com>



--
把有限的时间投入到无限的学习中去

M P

unread,
Jul 10, 2012, 3:43:28 PM7/10/12
to mini...@googlegroups.com
check the mini2440 directory, there is a start script already there

Michael

prife

unread,
Jul 10, 2012, 11:47:25 PM7/10/12
to mini...@googlegroups.com
2012/7/11 M P <buse...@gmail.com>
check the mini2440 directory, there is a start script already there


frankly speaking,  I want use mini2440-qemu  to run  NetBSD, looks  here: http://xpg.dk/projects/netbsd-support-for-the-mini2440/
That's why I did not use the mini2440/start .sh。

mini2440-qemu often  met  the errors,although some times it can boot to uboot correctly..

floating point exception

qemu -M mini2440 -mtdblock u-boot.nand -serial stdio....



--
把有限的时间投入到无限的学习中去

yargil

unread,
Jul 11, 2012, 5:20:58 AM7/11/12
to mini...@googlegroups.com
Hello,

 I've seen this bug. It is a division by 0 in sdl_send_mouse_event function.
The attached patch should fix the bug.

yargil.
bug_SIGFPE.patch

prife

unread,
Jul 11, 2012, 7:10:17 AM7/11/12
to mini...@googlegroups.com
I tested more than 20 times, it works very well,  thanks  yargil very much!

but it seems you didn't push to git repo yet..

2012/7/11 yargil <yar...@free.fr>



--
把有限的时间投入到无限的学习中去

yargil

unread,
Jul 11, 2012, 7:28:27 AM7/11/12
to mini...@googlegroups.com
Le mercredi 11 juillet 2012 13:10:17 UTC+2, prife a écrit :
I tested more than 20 times, it works very well,  thanks  yargil very much!

but it seems you didn't push to git repo yet..
 
I sent the patch to Buserror few days ago.

prife

unread,
Jul 11, 2012, 7:35:23 AM7/11/12
to mini...@googlegroups.com
hi, yargil

another quetion:
I have noticed that, you added tcode to make mini2440-qemu can boot from NOR,

but I tested it now:

prife@smart:~/work$ MINI2440_BOOT='nor'
prife@smart:~/work$ export MINI2440_BOOT
           
prife@smart:~/work$ qemu -M mini2440 -pflash supervivi-64M -serial stdio
mini2440_init: Boot mode: NOR
mini2440_init: Register parallel flash 0 size 0x3e9a4 'pflash0'
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
nand_init no/invalid block device, allocating 131072*528 in ram
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
qemu: fatal: Trying to execute code outside RAM or ROM at 0x00200000

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=00200000
PSR=400001d3 -Z-- A svc32
已放弃 (核心已转储)   In English, It means " Has been abandoned (core dump)"

prife@smart:~/work$ 

did I use wrong command to boot from NOR? 

2012/7/11 yargil <yar...@free.fr>



--
把有限的时间投入到无限的学习中去

yargil

unread,
Jul 11, 2012, 8:52:03 AM7/11/12
to mini...@googlegroups.com
2012/7/11 yargil
Le mercredi 11 juillet 2012 13:10:17 UTC+2, prife a écrit :
I tested more than 20 times, it works very well,  thanks  yargil very much!

but it seems you didn't push to git repo yet..
 
I sent the patch to Buserror few days ago.

Command line is correct.
I didn't test the boot from NOR flash with supervivi. But work fine with my own bootloader.
I will investigate.

yargil

unread,
Jul 11, 2012, 4:25:56 PM7/11/12
to mini...@googlegroups.com
I investigated.

The file for the pflash option must be an image of the NOR flash memory. Thus it must have a size of 2MB.
But you use the bootloader binary file of supervivi directly. It's wrong.
To construct a flash image file, you can use http://yargil.free.fr/flashimgflashimg. It's a tools design to construct and populate flash image file for qemu.

Bad news the super-vivi don't boot with qemu. It's strange. I tested the qemu patch with my own bootloader and with barebox and its was work fine.

prife

unread,
Jul 11, 2012, 9:02:17 PM7/11/12
to mini...@googlegroups.com
I cannot open your website... Cause there is a ugly GreatFireWall over the network of China...

I guess it is like this:

-----------------------------------------------------------------
#!/usr/bin/python

filename = "u-boot.nor"
data = 2048
spare = 0 
page = data + spare; 
pagenumPerMb = 1024 * 1024 / data
fileInMb = 2
buffer = '\xff' * page * pagenumPerMb
fh = open(filename, 'wb')
for i in range(0,fileInMb):
    fh.write(buffer);
fh.close();

---------------------------------------------------------------------------------
#!/usr/bin/python

uboot_bin = "u-boot.bin"
uboot_nor = "u-boot.nor"
data = 2048
spare = 0

page = data + spare

src = open(uboot_bin, 'rb')
target = open(uboot_nor, 'r+b')

offset = 0
while True:
    chunk = src.read(data)
    if not chunk:
        break
    target.seek(offset)
    target.write(chunk)
    offset = offset + page

src.close()
target.close()

---------------------------------------------------------------------
while then I did

#!/bin/bash
export MINI2440_BOOT="nor"
/home/prife/projects/git/mini2440-qemu/arm-softmmu/qemu-system-arm \
-M mini2440 -pflash u-boot.nor -serial stdio \
-net nic,vlan=0 -net tap,vlan=0,ifname=tap0

prife@smart:~/work$ ./runnor.sh 
sudo tunctl -u prife -t tap0
TUNSETIFF: Device or resource busy
sudo ifconfig tap0 0.0.0.0 promisc up
sudo brctl addif br0 tap0
brctl show
bridge name bridge id STP enabled interfaces
br0 8000.20cf3048bcb3 no eth0
tap0
mini2440_init: Boot mode: NOR
mini2440_init: Register parallel flash 0 size 0x200000 'pflash0'
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
nand_init no/invalid block device, allocating 131072*528 in ram
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=48
S3C: CLK=304 HCLK=304 PCLK=304 UCLK=48
S3C: CLK=304 HCLK=101 PCLK=50 UCLK=48

the qemu stoped here, couldnot go on anymore.... really very strange...

2012/7/12 yargil <yar...@free.fr>



--
把有限的时间投入到无限的学习中去

prife

unread,
Jul 11, 2012, 9:21:58 PM7/11/12
to mini...@googlegroups.com
sorry, I just made a foolish mistake.. I copy u-boot.bin to 2 M nor flash binary..
----------------------------------------------------------------------------------------
prife@smart:~/work$ cat ./createnor.py 
#!/usr/bin/python
filename = "nor"
data = 2048
spare = 0      
page = data + spare; 
pagenumPerMb = 1024 * 1024 / data
fileInMb = 2
buffer = '\xff' * page * pagenumPerMb
fh = open(filename, 'wb')
for i in range(0,fileInMb):
    fh.write(buffer);
fh.close();
----------------------------------------------------------------------------------------
prife@smart:~/work$ cat ./mknor.py 
#!/usr/bin/python

bin = "vivi.bin"
nor = "nor"
data = 2048
spare = 0

page = data + spare

src = open(bin, 'rb')
target = open(nor, 'r+b')

offset = 0
while True:
    chunk = src.read(data)
    if not chunk:
        break
    target.seek(offset)
    target.write(chunk)
    offset = offset + page

src.close()
target.close()
----------------------------------------------------------------------------------------
prife@smart:~/work$ cat runnor.sh 
#!/bin/bash
export MINI2440_BOOT="nor"
/home/prife/projects/git/mini2440-qemu/arm-softmmu/qemu-system-arm \
-M mini2440 -pflash nor -serial stdio \
-net nic,vlan=0 -net tap,vlan=0,ifname=tap0
# script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown


then:  
 $ ./runnor.py
----------------------------------------------------------------------------------------
mini2440_init: Boot mode: NOR
mini2440_init: Register parallel flash 0 size 0x200000 'pflash0'
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
nand_init no/invalid block device, allocating 131072*528 in ram
S3C: CLK=240 HCLK=60 PCLK=30 UCLK=57
S3C: CLK=240 HCLK=60 PCLK=30 UCLK=48
S3C: CLK=405 HCLK=101 PCLK=50 UCLK=48
qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000d38

R00=c000107c R01=eafffffe R02=00000000 R03=eafffffe
R04=00000030 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=33fffff4 R14=000002ac R15=00000d38
PSR=600001d3 -ZC- A svc32
./runnor.sh: 行 5: 10459 已放弃        (核心已转储)


2012/7/12 prife <gop...@gmail.com>



--
把有限的时间投入到无限的学习中去

yargil

unread,
Jul 12, 2012, 2:45:55 AM7/12/12
to mini...@googlegroups.com
I have the same error with the super-vivi bootloader. But the same binary work fine to my mini2440. Weird :(
If you just search a bootloader to start netbsd from NOR flash, try barebox. I already booted it whith Qemu from NOR.

For flashimg, try to access directly to the gitorious webpage: https://gitorious.org/flashimg
To download source:
git clone git://gitorious.org/flashimg/flashimg.git
or
git clone https://git.gitorious.org/flashimg/flashimg.git

prife

unread,
Jul 13, 2012, 9:04:36 PM7/13/12
to mini...@googlegroups.com
sorry, I didn't see the email until now...

the first time,  because of my mistake , I copy uboot.bin to nor flash, and try to boot from nor,  qemu couldn't boot..

but, In mini2440 board,  u-boot can boot from NOR..

so there must be something wrong in mini2440-qemu when booting from NOR...

2012/7/12 yargil <yar...@free.fr>



--
把有限的时间投入到无限的学习中去
Reply all
Reply to author
Forward
0 new messages