qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] cpu lose control when run uboot on qemu-system-mips


From: Peter Maydell
Subject: Re: [Qemu-discuss] cpu lose control when run uboot on qemu-system-mips
Date: Thu, 25 Dec 2014 13:09:20 +0000

On 25 December 2014 at 11:04, jiang <address@hidden> wrote:
> Hello all:
>     I try to run uboot(from some router(cpu:QCA9533 24Kc)) with
> qemu-system-mips,but there are some problems.

It seems unlikely that a boot loader intended for a specific
bit of router hardware will run on any of the board models
we support for MIPS.

> I run with:
> qemu-system-mips -M malta -pflash flash.bin -nographic -monitor
> telnet:127.0.0.1:12121,server -singlestep -gdb tcp::1234 -S
> Then connect with gdb and run step by step,but I found that cpu lose control
> when try to step over this:
> (qemu) x/10i 0xbfc00468
> 0xbfc00468:  mtc0    zero,$20 //here
> 0xbfc0046c:  mtc0    zero,$21
> 0xbfc00470:  mtc0    zero,$22
> 0xbfc00474:  mtc0    zero,$23

Likely this is because you're not specifiying the wrong CPU,
given we seem to get further with the other command line.

> Another try with:
> qemu-system-mips -M mips -cpu 24Kc -pflash flash.bin -nographic -monitor
> telnet:127.0.0.1:12121,server -singlestep -gdb tcp::1234 -S
> And cpu lose control with:
> (qemu) x/10i 0xbfc02f98
> 0xbfc02f98:  lw    t1,0(t0)  //here
> 0xbfc02f9c:  lui    t2,0xfffc
> 0xbfc02fa0:  ori    t2,t2,0x17ef
> 0xbfc02fa4:  and    t1,t1,t2
> 0xbfc02fa8:  sw    t1,0(t0)

Likely this is where u-boot tries to access hardware that's in the
router but not in the 'mips' board model, and takes an exception.

In both these cases if you put a breakpoint on the appropriate
exception vectors you'll probably find you hit it when you try
to singlestep the offending instruction.

>
> Did I do something wrong? And what should I do if I want to run uboot on
> qemu? :)

Use a u-boot binary that's built for the QEMU board model you're using.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]