All pastes #1881818 Raw Edit

goroh_kun

public text v1 · immutable
#1881818 ·published 2010-06-12 18:51 UTC
rendered paste body
qemu for Xperia X10

2010.6.13 goroh.kun@gmail.com

(1)Requirement
1. linux environment on vmware or vmplayer, I use vmplayer and ubuntu 9.04.
2. gnu debugger client, gdb or eclipse, or xda version 5.5 later, I use gdb.
3. uploader image ripped from SEUS(Sonyericsson Update Service).

(2)How to build qemu
# tar xzvf qemu-0.12.3.tar.gz
# cd qemu-0.12.3
# patch -p1 < ../qemu-0.12.3-xperia20100613.patch
# ./configure --target-list=arm-softmmu --enable-system --enable-curses --disable-user --disable-guest-base --enable-debug-tcg --enable-debug --disable-strip --disable-user-pie --enable-debug-tcg --disable-kvm
# make

(3)How to run
1. create sdcardimg
# dd if=/dev/zero of=../sdcard.img bs=1M count=128
# mkfs.msdos ../sdcard.img

2. patched to loader.bin
# md5sum ../loader.bin 
078c1196f299dd3ac6854d4c286f05c3  ../loader_org.bin

try to patch by binary editor

0000A2CA 00 F0 E4 F8 -> C0 46 C0 46
0000A328 00 F0 B5 F8 -> C0 46 C0 46
0000B546 00 F0 05 F8 -> C0 46 C0 46
0000B66A 00 F0 69 F8 -> C0 46 C0 46

# md5sum ../loader_patched.bin
176ed196c245a72b48198adc2d160008  ../loader_patched.bin

# ./arm-softmmu/qemu-system-arm -kernel ../loader_patched.bin -M xperia -sd ../sdcard.img -monitor stdio -s -S -vnc :0

(4)How to debug
on monitor mode, you can try to send usb command like this

To run program
(qemu) c
Then, you can see some debug message on console.


To get USB device descriptor
(qemu) sendkey 1

To get USB configuration descriptor, length 9
(qemu) sendkey 2

To get USB configuration descriptor, length 32
(qemu) sendkey 3

To send SEUS protocol CMD1 (get info)
(qemu) sendkey a


(5)Using gdb
you can use gdbclient to debug bootloader.

(6)Using XDA