Issue
I'm trying to firmware emulate with qemu. But there is some error.
First my firmware busybox introduction
busybox: ELF 32-bit LSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, BuildID[sha1]=35ad4cc498db7d5439552d8c3ed0d36a47cbc661, stripped
So I think this is mips 32bit firmware and I emulate by qemu-system-mipsel
Like this
qemu-system-mipsel -M malta -kernel vmlinux-3.2.0-4-4kc-malta -hda debian_wheezy_mipsel_standard.qcow2 -append "root=/dev/sda1" -nographic -redir tcp:2222::22
And I command this on qemu-emulating system
chroot ./ ./bin/sh
But qemu said to me Illegal Instruction
...
How Can I Solve this problem!
Solution
You don't say how your binary was built, ie which toolchain you compiled it with and what options you used. The "file" output is not sufficient to determine what CPU it was built for.
The malta board by default uses the 24Kf CPU, so if this binary was built for a newer CPU than that with more features, it is going to fail when it tries to execute instructions that are not present on the 24Kf.
Since you're using a standard Debian guest image, you can install a 'gdb' into the guest OS, and then run your binary under gdb, which will tell you what instruction it crashed on.
Answered By - Peter Maydell
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.