LoginSignup
2
2

More than 5 years have passed since last update.

bochs(on Mac OS)でxv6を起動する。

Last updated at Posted at 2014-10-21

環境構築

 ・Mac OS Lion
 ・bochs 2.6.6

bochsのソースコードをgdbで検証するため,ソースコードからコンパイルする。GUIを適切に設定する必要があるため,configureで以下の指定を行う。

$./configure LIBS="-L/usr/X11R6/lib -L/usr/X11/lib" X_PRE_LIBS="-lX11" --with-term --with-x11 --enable-e1000 -enable-pnic --enable-ne2000

上記の設定により,ターミナル(curse)もしくは,Xサーバを有効にできる。有効にするには,.borchrcファイルで以下のように指定する。

display-library: term #ターミナルで起動
display-library: x    #Xサーバで起動

また,XV6のイメージファイルを以下のように設定する。

ata0-master: type=disk, mode=flat, path="xv6.img", cylinders=1, heads=1, spt=1
ata0-slave: type=disk, mode=flat, path="fs.img", cylinders=1, heads=1, spt=1

bochsのソースツリーは,モジュールごとに階層化されているので,gdbでステップ実行するには./configureで生成された各ディレクトリのMakefileのCXXFLAGSに"-g"を追加する。

参考

電源投入後のBIOSの動作が詳細に記載
http://park12.wakwak.com/~eslab/pcmemo/boot/index.html

BIOS命令で画面出力させる方法が詳しく記載
http://softwaretechnique.jp/OS_Development/bootloader1.html

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2