ubuntu下源碼安裝bochs

假設你已經裝好了gcc,g++

下載bochs最新源碼

http://sourceforge.net/projects/bochs/files/bochs/

我下載的是bochs-2.6.8.tar.gz

解壓 tar -xvf bochs-2.6.8.tar.gz

進入解壓目錄cd bochs-2.6.8,目錄裏你會發現configure配置文件

輸入./configure --help你將會知道如何進行配置

eagle@eagle-QJC4:~/Downloads/bochs-2.6.8$ ./configure --help

`configure' configures this package to adapt to many kinds of systems.


Usage: ./configure [OPTION]... [VAR=VALUE]...


To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.


Defaults for the options are specified in brackets.


Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']


Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

                                                                                   這兩句是設置安裝路徑

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.


For better control, use the options below.


Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]

等等......



bochs默認安裝在/usr/local/ 目錄下(上面紅字部分),我將其改到了桌面,命令如下

 sudo ./configure --prefix=/home/eagle/Desktop/bochs --exec-prefix=/home/eagle/Desktop/bochs --enable-debugger --enable-disasm

當然你也可以把紅色的部分換到你喜歡的路徑

後面的--enable-debugger 意思是允許調試 --enable-disasm意思是允許反彙編也可以不設置

之後執行

make

make install

執行完後你會發現自己的桌面上多了一個名爲bochs的文件夾呢.

打開bochs文件夾會有兩個文件夾 bin  和  share

bin裏面是安裝好的bochs執行./bochseagle@eagle-QJC4:~/Desktop/bochs/bin$ ./bochs 
========================================================================
                       Bochs x86 Emulator 2.6.8
                Built from SVN snapshot on May 3, 2015
                  Compiled on Dec  5 2015 at 10:44:41
========================================================================
00000000000i[      ] BXSHARE not set. using compile time default '/home/eagle/Desktop/bochs/share/bochs'
------------------------------
Bochs Configuration: Main Menu
------------------------------


This is the Bochs Configuration Interface, where you can describe the
machine that you want to simulate.  Bochs has already searched for a
configuration file (typically called bochsrc.txt) and loaded it if it
could be found.  When you are satisfied with the configuration, go
ahead and start the simulation.


You can also start bochs with the -q option to skip these menus.


1. Restore factory default configuration
2. Read options from...
3. Edit options
4. Save options to...
5. Restore the Bochs state from...
6. Begin simulation
7. Quit now


Please choose one: [2] 


這說明安裝好了呢!!!


你可以在當前目錄執行./bochs運行,也可以把安裝好的bochs放到環境變量裏,這樣你就可以在

任何地方直接敲入bochs直接運行bochs了呢!!

$ vim ~/.bashrc

#BOCHS
export BOCHS=/home/eagle/Desktop/bochs
export PATH=...............$BOCHS/bin:$PATH

上面的...............表示前面還有其他設置直接在$PATH前面添加$BOCHS/bin:即可

之後保存退出,    :wq

好了,自由的使用bochs吧

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章