wakatonoの戯れメモ

はてなダイアリーから引っ越してきました。

BitVisorコンパイルしてみた

Debian GNU/Linuxで試してみた。
etchではうまくいったけど、sargeではエラー。
以下はsargeの場合。


wakatono@kid:~/bitvisor-0.2$ make
make -C core
make[1]: Entering directory `/home/wakatono/bitvisor-0.2/core'
as --32 -o asm.o asm.s
asm.s: Assembler messages:
asm.s:61: Error: no such instruction: `vmwrite %edx,%eax'
asm.s:64: Error: no such instruction: `vmwrite %edx,%eax'
asm.s:74: Error: no such instruction: `vmlaunch'
asm.s:108: Error: no such instruction: `vmwrite %edx,%eax'
asm.s:111: Error: no such instruction: `vmwrite %edx,%eax'
asm.s:121: Error: no such instruction: `vmresume'
asm.s:157: Error: no such instruction: `vmwrite %rdx,%rax'
asm.s:160: Error: no such instruction: `vmwrite %rdx,%rax'
asm.s:178: Error: no such instruction: `vmlaunch'
asm.s:223: Error: no such instruction: `vmwrite %rdx,%rax'
asm.s:226: Error: no such instruction: `vmwrite %rdx,%rax'
asm.s:244: Error: no such instruction: `vmresume'
make[1]: *** [asm.o] エラー 1
make[1]: Leaving directory `/home/wakatono/bitvisor-0.2/core'
make: *** [core/core.o] エラー 2
アセンブラが、vmwrite命令を解釈してくれないため。
ちなみに、core/asm.hには、

#ifdef AS_DOESNT_SUPPORT_VMX
というような形で、vmx命令をサポートしてないアセンブラの場合には〜というような宣言も含まれてはいるが、asm.sまでは手が回らなかった模様。すぐ直るかな、これだったら。
gccとasのバージョンは以下のとおり。

wakatono@kid:~/bitvisor-0.2$ gcc -v
/usr/lib/gcc-lib/i486-linux/3.3.5/specs から spec を読み込み中
コンフィグオプション: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
スレッドモデル: posix
gcc バージョン 3.3.5 (Debian 1:3.3.5-13)
wakatono@kid:~/bitvisor-0.2$ as --version
GNU assembler 2.15
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
This assembler was configured for a target of `i386-linux'.
wakatono@kid:~/bitvisor-0.2$
etchでのgccとasのバージョンは以下のとおり。

wakatono@kids:~/bitvisor-0.2$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
wakatono@kids:~/bitvisor-0.2$ as --version
GNU assembler 2.17 Debian GNU/Linux
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
This assembler was configured for a target of `i486-linux-gnu'.
新しい環境であればOKだけど、微妙に古い環境だとNGという感じ。