qemu 作りなおし

tarball 展開。

$ tar zxvf qemu-0.12.5-6828.2010-08-31.tar.gz 

で、カレントディレクトリ移動して configure 実行。

$ cd qemu-0.12.5-6828
$ ./configure --prefix=/opt --target-list="i386-softmmu x86_64-softmmu"

Error: zlib check failed
Make sure to have the zlib libs and headers installed.

$

なんか根本的に駄目な模様。とりあえず zlib1g-dev 入れてみてリトライか。

$ sudo apt-get install -fy zlib1g-dev

で、configure 実行して make 実行。いちおうなんとなかってるのかどうか。

コンパイル終了

ええと、make install するんだったか。で、xv6 に移動して Makefile の以下の部分を修正して

# If the makefile can't find QEMU, specify its path here
#QEMU = 
QEMU = /opt/bin/qemu

実行してみました。

$ make qemu-gdb
*** Now run 'gdb'.
/opt/bin/qemu -serial mon:stdio -hdb fs.img xv6.img -smp 2 -m 512  -S -gdb tcp::26000
VNC server running on `127.0.0.1:5900'

で、別端末で gdb 起動。

[f000:fff0]    0xffff0: ljmp   $0xf000,$0xe05b
0x0000fff0 in ?? ()
+ symbol-file kernel
(gdb) b *0x7c00
Breakpoint 1 at 0x7c00
(gdb) c
Continuing.
[   0:7c00] => 0x7c00:  cli

Breakpoint 1, 0x00007c00 in ?? ()
(gdb) 

を、止まりましたな。ちなみに Makefile を元に戻して同じことしてみたらどうなるんだろ、と言いつつ試験してみたら止まりませんでした。良かった。