1. Download the source code package from Bochs because the debugging function is used. Bochs2.4.5http: // response. 3. Execute the configuration to enable debugging and disassembly./configure -- enable-debugger
1. Download the source code package from Bochs because the debugging function is used. Bochs 2.4.5 http://sourceforge.net/projects/bochs/
2. Install the G ++ Compiler
Sudo apt-get install g ++
If the G ++ compiler is not installed, some errors will occur when configure is executed.
3. Execute the configuration and enable debugging and disassembly.
./Configure -- enable-debugger -- enable-disasm
4. ERROR: X windows gui was selected, but X windows libraries were not found.
When this error occurs, install the xorg-dev package.
Sudo apt - Get install xorg - Dev
5. package gtk +-2.0 was not found in the pkg-config search path. perhaps you shoshould add the directory containing 'gtk +-2.0.pc' to the PKG_CONFIG_PATH environment variableNo package 'gtk +-2.0 'foundERROR: 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 ).
When this error occurs, run:
Sudo apt - Get install libgtk2 . 0 - Dev
6. Re-execute the configuration (handle errors as above)
./ Configure -- Enable - Debugger -- Enable - Disasm
Then run make
Make
Then install
Sudo make install
I tried to execute it directly without using sudo. It may cause errors. The error prompt is not clear. It should be due to insufficient permissions.
Make : *** [Install_bin] Error 1
7. Complete. Execute bochs.
Configure bochs:
After installing bochs, We need to configure bochs. In fact, we need to modify the bochrsc file!
The attached CD of orange's: Implementation of an operating system contains a configured bochrsc,
Yes. It is for bochs2.3, so it cannot be used !!! We need to modify bochrsc again!
First, move the folder a under the chapter1 subdirectory in the attached CD to/home/roothoo/(mainly
Is to make a. img and bochsrc in the same folder), and then modify bochrc as follows:
Note: # Is the annotator! That is, # the subsequent statement is invalid. In fact, # is equivalent to // in C + //
######################################## #######################
# Configuration file for Bochs
######################################## #######################
# How much memory the emulated machine will have
Megs: 32
# Filename of ROM images
Romimage: file =/usr/local/share/bochs/BIOS-bochs-latest
# Romimage: file = $ BXSHARE/BIOS-bochs-latest (applicable to the installation of bochs in windows)
Vgaromimage:/usr/local/share/vgabios. bin
# Vgaromimage: file = $ BXSHARE/VGABIOS-lgpl-latest (applicable to bochs installed in windows)
# What disk images will be used
Floppya: 44 = a. img, status = inserted
# Choose the boot disk.
Boot: floppy
# Where do we send log messages?
# Log: bochsout.txt
# Disable the mouse
Mouse: enabled = 0
# Enable key mapping, using US layout as default.
Keyboard_mapping: enabled = 1, map =/usr/local/share/bochs/keymaps/x11-pc-us.map
After modification, [Linux community www.Linuxidc.com] should not forget to save it!
Finally, we run bochs
Cd /Home/User Name # Switch to the folder where a. img and bochsrc are located,
Bochs -F Bochsrc # Start bochs with bochsrc as the configuration file
Then select 6,
Then press the c key,
OK !!!
ENJOY! -_-
Question 1: Install bochs and enter the following code under terminal
Sudo apt-get install bochs
After the installation is complete, the following error occurs when I use bochs:
Event type: PANIC
Device :[ ]
Message: dlopen failed for module 'X': file not found
This is because there are fewerBochs-xPackage
This package can be found at http://packages.ubuntu.com/dapper/misc/bochs-x.
You can also enter
Sudo apt-get install bochs-x
The installation is complete.
Problem 2: startup Problems
Click to enter the system. The following message is displayed on the console:
Please choose one: [6] 6
Extends 000i [] installing win32 module as the Bochs GUI
00000000000i [] using log file bochsout.txt
========================================================== ======================================
Event type: PANIC
Device: [MEM0]
Message: ROM: System BIOS must end at 0 xfffff
A panic has occurred. Do you want:
Cont-continue execution
Alwayscont-continue execution, and don't ask again.
This affects only PANIC events from device [MEM0]
Die-stop execution now
Abort-dump core
Choose one of the actions above: [die]
Cause:
The BIOS-bochs-latest used by bochs before 2.3.5 is 64 KB. At that time, you need to add
Romimage: file = BIOS-bochs-latest, address = 0xf0000 (example)
BIOS-bochs-latest updated in 2.3.5 and changed to kb.
Romimage: file = $ BXSHARE/BIOS-bochs-latest (for example, remove address = 0xf000)
Solution:
Remove the address in the configuration file
Problem 3: bochsrc
Generally, the following tools will be prompted after you install them on the Internet:
/Usr/bin/bochs Bochs Startup Program
/Usr/bin/bximage Bochs tools used to create disk image files
/Usr/bin/bxcommit Interactive tool that puts redolog into the flat disk image file
/Usr/share/doc/bochs/bochsrc-sample.txt Bochs configuration file example
/Usr/share/bochs/BIOS-bochs -* Rom bios Image File
/Usr/share/bochs/VGABIOS -* Files related to vga bios image files
/Usr/bin/bochs-dlx Start the DLX linux program in Bochs
/Usr/share/bochs/dlxlinux/ DLX Linux directory, including its disk image files and configuration files
/Usr/share/bochs/keymaps/*. map Keymap list of X11 and SDL
In fact, there are no fourth, seventh, and eighth items installed on the terminal. Even the second and third items must be installed separately:
Sudo apt-get install bximage
Sudo apt-get install bxcommit
Therefore, the online bochsrx cannot run on Ubuntu. Because of this, I thought it was a wrong configuration file for nearly one afternoon.
Common bochsrc:
Romimage: file = $ BXSHARE/BIOS-bochs-latest,
Vgaromimage: file = $ BXSHARE/VGABIOS-lgpl-latest
However, there is no VGABIOS-lgpl-latest In Ubuntu.
For example:
Www.linuxidc.com @ linuxidc-desktop:/usr/share/bochs $ ls
BIOS-bochs-latestBIOS-bochs-legacyBIOS-qemu-latest Keymaps
Www.linuxidc.com @ linuxidc-desktop:/usr/share/bochs $
Later, I discovered that when I installed bochs on a terminal, it installed VGA in/usr/share/vgabios/as a program.
Www.linuxidc.com @ linuxidc-desktop:/usr/share/bochs $ ls/usr/share/vgabios/
Vgabios. binVgabios. cirrus. binVgabios. cirrus. debug. binVgabios. debug. bin
Www.linuxidc.com @ linuxidc-desktop:/usr/share/bochs $
In this way, the configuration file should be changed:
Romimage: file = $ BXSHARE/BIOS-bochs-latest
Megs: 4
Floppya: image =./boot. img, status = inserted
Vgaromimage: file =/usr/share/vgabios. bin
Boot:
Log: out. bochs