Installation and Configuration Ubuntu 16.04LTS Bochs

Environment: VMWare14 + Ubuntu16.04

Installation Bochs2.6.9

1. go to the official website to download

Download bochs-2.6.9.tar.gz

2. Install a series of packages

Since Bochs needs to run under X11 environment, so your Linux system must have the X Window System installed in order to use Bochs.

Since Bochs is written in C ++, so here to install GNU gcc / g ++ compiler.

(I do not know, installed on the bin

sudo apt-get install build-essential

sudo apt-get install xorg-dev

sudo apt-get install bison

sudo apt-get install libgtk2.0-dev

sudo apt-get install g++ 

3. Unzip the downloaded source code:

The sudo  tar zxvf bochs 2.6 . 9 . tar gz 
cd followed by bochs 2.6 . 8 . tar gz

4. Run the configure script, it will test your machine, C / C ++ compiler and some library to determine which configuration is suitable for your machine. run:

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

(These two are used to open debugging and disassembly functions)

5. Step 3 is running properly, will produce a Makefile, then:

make clean
sudo
make

6. Installation:

Sudo  Make  Install 

At this point, bochs installation has been completed.

 

experiment procedure

  1. Making the boot sector, the compiled boot.asm give boot.bin;
  2. Diskette, and the boot sector write
  3. Start bochs, get results

1. Compile

First you have first installed NASM compiler directly with sudo apt-get install nasm.

Then open a terminal in the current working directory, enter the following command:

nasm -o boot.bin boot.asm

2. Make a floppy disk

After previously compiled bochs2.6.9 folder there will be a bximage executable file that runs in a terminal:

bximage

Select 1 to make a floppy disk, and then select, fd, then directly enter the rest of the like, will be under bochsrc the folder, which is now working folder a.img generate a file, this is our floppy disk .

Then write to the floppy boot sector:

dd if=boot.bin of=a.img bs=512 count=1 conv=notrunc

3. Start Bochs

Before you start Bochs, you need to modify the configuration file.

In bochs-2.6.9 folder can be seen by ls -a reference to .bochsrc original (non-essential

To be able to run an operating system in Bochs, you need at least some of the following resources or information:

    • Bochs executable file
    • BIOS image file (commonly referred to as BIOS-bochs-latest)
    • VGA BIOS image file (e.g. VGABIOS-lgpl-latest)
    • At least a boot disk image file (floppy disk, hard disk or CDROM image file)
      My configuration is as follows:

 

 

###############################################################
# 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
vgaromimage: file=/usr/local/share/bochs/VGABIOS-lgpl-latest

# what disk images will be used
floppya: 1_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=1

# enable key mapping, using US layout as default.
keyboard:keymap=/usr/local/share/bochs/keymaps/x11-pc-us.map

( Mouse: Enabled = 1 play interface card Bochs mouse functions

Input terminal command:

bochs -f bochsrc

(Assuming that the current directory bochsrc

Enter only bochs also, because if you enter a bochs without any parameters and execute, then Bochs will find the following files in the current directory in sequence as a configuration file:

  •  .bochsrc
  •  bochsrc
  •  bochsrc.txt
  •  bochsrc.bxrc (valid only for Windows)

Logically, then Hello, OS World should appear!

 

 If only the black box, no text,

You need to enter the terminal c, enter, will appear above the results.

 

Reference links:

1. Ubuntu installation bochs

2. Installation Bochs under CSDN Ubuntu environment

3. Simple to install and configure Ubuntu 14.04LTS book Bochs

4. Orange`s implementation of an operating system

Guess you like

Origin www.cnblogs.com/lfri/p/11489223.html