Learning Notes | ORANGE ' S: An implementation of an operating system | (i) Ubuntu-16.04 Bochs installation and configuration __ environment configuration

Source: Internet
Author: User

Directory

BOCHS installation experimental environment direct get download Bochs install edit dependent Environment Profile Action command dos in Bochs

installation of Bochs Experimental Environment

Ubuntu 16.04 + bochs 2.4.6 + nasm

The floppy disk production and NASM compilation files are outlined here as shown in the book. Direct Access

You can use the command download directly, because of the version reason, may not be the same as the operation of the book caused confusion.

sudo apt-get Install

So here is the download source package to compile the installation process download Bochs

https://sourceforge.net/projects/bochs/files/bochs/2.4.6/

Download Bochs 2.4.6.tar.gz Compression pack on this site

    Tar vxzf bochs-2.4.6.tar.gz
    CD bochs-2.4.6
Install an edit dependent environment
sudo apt-get install build-essential xorg-dev Libgtk2.0-dev

After configure will appear makefile file, modify makefile file in Find LIBS = ... Row, add-lpthread at end of line, save

PS: Also read an article is to modify the makefile.in file, but I was modified makefile only after the

If you do not add this parameter, the compilation will fail.

Configuration parameters turn on debug function switch

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

Compile

Make

Installation

Make install

There are errors in the first makes clean and then configure, the general error is not installed environment package or make failure is because the above does not add a library of compiled threads, the author has appeared before these several errors.

Enter command

Bochs

If you can display the following code to indicate successful installation

======================================================================== Bochs x86 emulator 2.4.6 Build from CVS snapshot, on February Compiled at Nov 14 2017, 22:04:17 ======================= ================================================= 00000000000i[] Reading configuration from BOCHSRC---------------- --------------Bochs Configuration:main Menu------------------------------This is the Bochs Configuration Interface, W  This is where you can describe the machine, want to simulate.  Bochs has already searched for a configuration file (typically called) and bochsrc.txt it if it loaded is could.

When you are satisfied with the configuration, go ahead and start the simulation.

can also start Bochs with THE-Q option to skip this 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: [6] 
 

As the book says, our Bochs run requires configuration files, so we can build a folder dedicated to running Bochs.
configuration file

Below is my profile ↓

# Configuration file for Bochs
###############################################################

# so much Memory the emulated machine'll have
megs:32

# filename of ROM images
romimage:file= $BXSHARE/bios-bochs-la Test
vgaromimage:file= $BXSHARE/vgabios-lgpl-latest

# What disk images'll be used
floppya:1_44=a.img, status=inserted

# Choose the boot disk.
Boot:a

# Where do we send log messages?
# log:bochsout.txt

# Disable the mouse
mouse:enabled=0

# Enable key mapping, using US layout as default.< C16/>keyboard_mapping:enabled=1, Map=/usr/local/share/bochs/keymaps/x11-pc-us.map

According to the book, mainly Romiage and vgaromimage two paths need to match their own system, followed by the floppy disk file nouns need to correspond with the boot of the device to configure (if there are more than one device) in the book Code in the end link.

Copy the book bochsrc and a.img into the folder you created to run, and the results, as shown in the book, will have a red p. Operation Command

The specific command as shown in the book, press C after the operation to press CTRL + C interrupt to be followed by the input, press Q is to exit the virtual machine.

steps for using DOS in Bochs

At the end of the text download the source code compression package to find the appropriate chapters, find inside the freedos.img,pm.img copied to their Bochs directory. (or the installation book said to Bochs website download FreeDOS)

Change our bochsrc file, and replace it with the following in floppy

Floppya:1_44=freedos.img, status=inserted

floppyb:1_44=pm.img, status=inserted

Modify our code to change the 07c00h to 0100h recompile because DOS differs from the loading position of the system.

NASM Pmtest1.asm-o pmtest1.com

To make a floppy disk pm.img, first mount the floppy disk on the virtual machine and then pmtest1.com:

sudo mkdir mnt/floppy/
sudo mount-o loop pm.img/mnt/floppy/
sudo cp pmtest1.com/mnt/floppy/
sudo umount/mn t/floppy/

Run Bochs, at the beginning of a: The time format, after the completion of the implementation

B:\pmtest1.com

The results of the experiment as above, a red P appeared, proved successful in FreeDOS run our program.

With the book source download: Oranges_ an operating system to achieve _ CD source code

Resources: https://www.cnblogs.com/KoalaDream/p/5045875.html

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.