这是上一篇的后续,T-Kernel 下需要编译对应的QEMU代码。
1. 编译qemu
$ cd /path/to/T-Kernel2.0/emulator/tef_em1d/build/qemu-0.12.4-tef_em1d
$ chmod 775 configure
$ ./configure --target-list=arm-softmmu
$ make
最后生成的 qemu 文件在 arm-softmmu/qemu-system-arm
2. 移动对应的qemu文件
$ cd /path/to/T-Kernel2.0/emulator/tef_em1d/bin
3. 启动qemu
$ ./qemu-system-arm -cpu arm1176jzf-s -kernel ./rom.bin -sd ./sd.img -serial stdio -dipsw dbgsw=off -rtc base=localtime -nographic
serial_parse> index = 0, label = serial0, filename = stdio
before machine->init = 0x00428210
CPU: arm1176jzf-s
DRAM: 64M
ROM: 32M
SRAM: 128K
tp: 64 944 80 912 0
after machine->init
T-Kernel Version 2.B0.00
Push any key to shutdown the T-Kernel.
另外,qemu也可以用于调试 T-Kernel 内核,参考如下:
$ ./qemu-system-arm -cpu arm1176jzf-s -kernel ./rom.bin -sd ./sd.img -serial stdio -dipsw dbgsw=off -rtc base=localtime -nographic -S -s
另一个窗口启动:
$ arm-none-linux-gnueabi-gdb kernel-rom.rom (这个需要自己编译)
(gdb) target remote :1234
Remote debugging using :1234
0x00000000 in ?? ()
(gdb) b main
Breakpoint 1 at 0x70045fac