2 Notes for the Qemu MIPS port
6 # ln -s u-boot.bin mips_bios.bin
8 qemu-system-mips -L . /dev/null -nographic
12 if you use a qemu version after commit 4224
15 # dd of=flash bs=1k count=4k if=/dev/zero
16 # dd of=flash bs=1k conv=notrunc if=u-boot.bin
18 # qemu-system-mips -M mips -pflash flash -monitor null -nographic
20 II) How to debug U-Boot
22 In order to debug U-Boot you need to start qemu with gdb server support (-s)
23 and waiting the connection to start the CPU (-S)
25 # qemu-system-mips -S -s -M mips -pflash flash -monitor null -nographic
27 in an other console you start gdb
29 1) Debugging of U-Boot Before Relocation
31 Before relocation, the addresses in the ELF file can be used without any problems
32 buy connecting to the gdb server localhost:1234
34 # mipsel-unknown-linux-gnu-gdb u-boot
36 Copyright (C) 2006 Free Software Foundation, Inc.
37 GDB is free software, covered by the GNU General Public License, and you are
38 welcome to change it and/or distribute copies of it under certain conditions.
39 Type "show copying" to see the conditions.
40 There is absolutely no warranty for GDB. Type "show warranty" for details.
41 This GDB was configured as "--host=i486-linux-gnu --target=mipsel-unknown-linux-gnu"...
42 (gdb) target remote localhost:1234
43 Remote debugging using localhost:1234
44 _start () at start.S:64
45 64 RVECENT(reset,0) /* U-boot entry point */
46 Current language: auto; currently asm
48 Breakpoint 1 at 0xbfc00cc8: file board.c, line 289.
52 Breakpoint 1, board_init_f (bootflag=<value optimized out>) at board.c:290
53 290 relocate_code (addr_sp, id, addr);
54 Current language: auto; currently c
58 2) Debugging of U-Boot After Relocation
60 For debugging U-Boot after relocation we need to know the address to which
61 U-Boot relocates itself to 0x87fa0000 by default.
62 And replace the symbol table to this offset.
65 Discard symbol table from `/private/u-boot-arm/u-boot'? (y or n) y
66 Error in re-setting breakpoint 1:
67 No symbol table is loaded. Use the "file" command.
69 (gdb) add-symbol-file u-boot 0x87fa0000
70 add symbol table from file "u-boot" at
71 .text_addr = 0x87fa0000
73 Reading symbols from /private/u-boot-arm/u-boot...done.
74 Breakpoint 1 at 0x87fa0cc8: file board.c, line 289.
78 Program received signal SIGINT, Interrupt.
79 0xffffffff87fa0de4 in udelay (usec=<value optimized out>) at time.c:78
80 78 while ((tmo - read_c0_count()) < 0x7fffffff)