"Implementation of an operating system" learning notes (i) Bochs source installation and configuration

Source: Internet
Author: User

Introduction: Native environment Ubuntu 14.04 Bochs 2.4.5

A. Download

Official website http://bochs.sourceforge.net/

Two. Installation

1. Unzip the downloaded compressed package and enter the directory

tar vxzf bochs-2.4. 5. Tar . GZCD Bochs-2.4. 5

2. Install the package that the compiler depends on

sudo Install build-essential

3. Check the environment, turn on the debug function switch

./configure--enable-debugger--enable-disasm

(1) If the error:x Windows GUI was selected appears, but the X Windows libraries were not found. Input

sudo Install Xorg-dev

(2) If error:pkg-config is not found, or unable to access the gtk+-2.0 package. Input

sudo Install libgtk2. 0-dev

If you have error, the dependent package is installed, you need to re-configure

(Note *: When I download bochs-2.3.5 error 1, installation of Xorg-dev can not be resolved, for some reason.) Also please the predecessors of the more advice! Then replaced by bochs-2.4.5, pro-Test available)

4. Compiling

Make

    (1) If error occurs: Collect2:error:ld returned 1 exit status

Make: * * * [Bochs] Error 1

Edit Boches-2.4.5/makefile.in file, find LIBS = ... Row, add-lpthread at the end of the line, save

After re-configure, re-make, success

5. Installation

sudo make Install

Three. Configuration

As 11 pages in the book, you need to write your own configuration file after installing Bochs. The storage path is not explicitly pointed out, but the original book is followed by a hint: "If you enter a Bochs without any parameters and execute it, then Bochs will look for the following files in the current directory order as the default configuration file:

. bochsrc

Bochsrc

Bochsrc.txt

BOCHSRC.BXRC (valid only for Windows) "

This means that the configuration file is stored in your current working directory, which is the folder where the. bin. asm. IMG is stored.

So I create a new bochsrc file in the working directory, as shown in code 2.1 in the book, and change the path to match the Bochs in My Computer

1#Configurationfile  forBochs2 3 #how much memory the emulated machine would have4Megs: +5 6 #filename of ROM images7Romimage:file= $BXSHARE/bios-bochs-Latest8Vgaromimage:file= $BXSHARE/vgabios-lgpl-Latest9 Ten #what disk images 'll be used OneFloppya:1_44=a.img, status=inserted A  - #choose the boot disk. - Boot:floppy the  -#where DoWe send log messages - Log:bochsout.txt -  + #disable the mouse -Mouse:enabled=0 +  A #enable key mapping, using US layout as default atKeyboard_mapping:enabled=1, Map=/usr/local/share/bochs/keymaps/x11-pc-us.map

7th, the Romimage and vgaromimage of line 8 correspond to the BIOS of the real machine and the VGA BIOS, how to set the path?

(Note: The path may vary depending on the system, under different software versions)

Method One: In My Computer/usr/local/share/doc/bochs under the sample file, called Bochsrc-sample.txt, open, find romimage and vgaromimage can get the path;

Method Two: Take 23 lines of map for example, with the Find command, in the/usr folder to find X11-pc-us.map can be

Find -name x11-pc-us.map

After the configuration file is written, enter Bochs in the current directory to see:

========================================================================Bochs x86 Emulator2.4.5Build from CVS snapshot, on April -, .========================================================================00000000000i[] Reading configuration from BOCHSRC------------------------------Bochs configuration:main Menu------------------------------This was the Bochs Configuration Interface, where you can describe themachine so you want to simulate. Bochs has already searched foraconfigurationfile(typically called bochsrc.txt) and loaded itifitcould be found. When your is satisfied with the configuration, Goahead and start the simulation. You can also start Bochs with the-q option to skip these menus.1. Restore Factory Default configuration2. Read options from ...3. Edit Options4. Save options to ...5. Restore the Bochs state from ...6. Begin Simulation7. Quit Nowplease Choose one: [6]

The default option at this point is 6. Begin Simulation

Enter, eject Bochs virtual machine interface, success!

(Note: If the configuration file is missing, the default option is 2; If the configuration file is wrong, an error will be added)

Reference: http://www.cnblogs.com/sobe/archive/2010/09/05/1818367.html

http://m.blog.csdn.net/blog/u010066564/26068283

"Implementation of an operating system" learning notes (i) Bochs source installation and configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.