<自已动手写操作系统>之环境安装

 1. 安装VirtualBox 虚拟机

 2. 在VirtualBox中安装Ubuntu10.10  

 2. 安装基本的编译环境 sudo apt-get install build-essential 

 3. 安装bochs,下载的版本是2.4.6

     a)运行 ./configure --enable-debugger --enable-disasm

  出现在以下错误

      ERROR: X windows gui was selected, but X windows libraries were not found

      google后,运行以下命令解决

      sudo apt-get install libx11-dev
      sudo apt-get install xserver-xorg-dev
      sudo apt-get install xorg-dev

 

       重新运行configure 命令

 

      出现以下错误

  ERROR: pkg-config was not found,or unable to access the gtk+-2.0 package

  Install pkg-config and the gtk+ development package, or disable the gui debugger,or the wxWidgets display library(whichever is being used).

      google后,运行以下命令解决

      sudo apt-get install libgtk2.0-dev

 

     再次运行configure 命令,OK

 

     b)运行 make 

     c)运行 sudo make install

     至此安装结束,默认文件安装在/usr/local 目录, 安装完后仔细读安装文档,其可以通过前面Configure 带--prefix=directory 指定安装目录.

    d)测试bochs

      可以直接从http://www.osfromscratch.org/下载源代码,以Chapter1的代码测试,bochs 的配置文件中一些文件路径项需要修改.我的配置文件更改后如下

       megs:32

       romimage:file=/usr/local/share/bochs/BIOS-bochs-latest

       vgaromimage:file=/usr/local/share/bochs/VGABIOS-lgpl-latest

       floppya:1_44=a.img,status=inserted

       boot:foppy

       mouse:enabled=0

       keyboard_mapping:enabled=1,map=/usr/local/share/bochs/keymaps/x11-pc-us.map

      保存好配置文件,在当前目录运行bochs -q, 中间会停下来等待调试(我们开始配置调试参数),输入C继续,终于在模拟窗口见到了久违的"Hello,OS world."

  4.安装其它工具

       NASM  sudo apt-get install nasm

       VIM  sudo apt-get install vim

 

  5.主机与虚拟机内的操作系统共享文件夹的设置

       参看 http://keyannan.blogbus.com/logs/50466956.html

 

 

posted @ 2011-04-12 19:12  十三  阅读(310)  评论(0编辑  收藏  举报