Installation and simple operation of Bochs under Linux

Source: Internet
Author: User

Http://bochs.sourceforge.net/bochs official website. About Bochs no longer a statement of exhaustion.

I am in Ubuntu under the package management software apt-get installed Bochs. command

Apt-get Install Bochs

This is an installation without debugging environment, first feel the taste of small success. Oh

After such an installation, execute $bochs at the command line will jump out of a configuration interface, the table is afraid, it said the installation was successful. Reading his hints carefully will find that there is no configuration file

(Configuration file Bochsrc,romimage,vgaromimage. These are not explained. Self-check). You can configure a simple bochsrc. The contents are as follows:

1###############################################################
2 # Configuration file for Bochs
3 ###############################################################
4
5 # How much memory the emulated machine would have
6 megs:64
7
8 # filename of ROM images
9 Romimage:file=/usr/share/bochs/bios-bochs-latest
10
# What disk images'll be used
Floppya:1_44=a.img, status=inserted
13
# Choose the boot disk.
Boot:floppy
16
# Where do we send log messages?
# Log:bochsout.txt
19
# Disable the mouse
Mouse:enabled=0
22
# enable key mapping, using US layout as default.

This file at least can make Bochs can run hehe, because the online master is installed after the direct operation on the line, but the younger brother is not. There are a variety of errors, may be your bochs did not find the configuration file, and you copy from the Internet is relatively long, professional, but some files may be different versions, the path is different, so at the start of the error can not be found, this is the simplest. Many of them use the default path for installing your software. The best thing about writing a configuration file is man bochsrc, standard tutorial

The following is an example of a startup file, a complete anatomy of the Linux kernel, and a very simple function,

*************************************************************************************************************** ****************************************

1!
2!boot.s--BOOTSECT.S's framework program. Replace the 1 character in the MSAG with the code 0x07 and then display it on the first line of the screen
3!
4
5. GLOBL BEGTEXT,BEGDATA,BEGBSS,ENDTEXT,ENDDATA,ENDBSS! Global identifier for use with ld86 links
6. Text! Body Segment
7 Begtext:
8. Data section
9 Begdata:
Ten. BSS! Uninitialized data segment
BEGBSS:
Text! Text Section start
BOOTSEG = 0x7c0! The BIOS loads the original segment address of the Bootsect code.
14
15
Entry start! Tell the linker that the program starts at the Strat label
17
Start:
Jmpi go,bootseg! jumps between segments. Bootseg points to the address of the jump segment, the label go is the offset address
Go:mov AX,CS! Segment Register CS value-->ax for initializing data segment registers DS and ES
Ds,ax mov
MOV Es,ax
[Msg1+17],ah!0x07--> Replace string a dot symbol, the horn will beep a sound
MOV cx, #20! Total 20 characters, including carriage return line feed
MOV dx, #0x1004! The string is displayed on the 17th row of the screen, at column 5th
-mov bx, #0x000c! Character Display Properties (red)
The Mov bp, #msg1! Point to the string to invoke (interrupt call request)
$ mov ax, #0x1301! Write the string and move the cursor to the end of the string
int 0x10! BIOS Interrupt Call 0x10, function 0x13, sub-function 01
LOOP0:JMP loop0! Dead loop
31
MSG1:. ASCII "Loading system ..."! Call the BIOS to interrupt the display of the information. A total of 20 ASCII code characters.
. Byte 13,10
34
35
ORG 510! Represents a later statement to be stored from address 510 (0X1FE)
Word 0xaa55! A valid boot sector flag that is used by the BIOS to load the boot sector.
38
A. Text
Endtext:
A. Data
Enddata:
. BSS
ENDBSS:
*************************************************************************************************************** **********************

Compile process:

$as 86-0-a-o BOOT.O Boot.s

$ld 86-0-s-o Boort BOOT.O

$dd bs=32 if =boot of=a.img skip=1

This then launches Bochs to see the "Loading system" on the screen

Program interpretation and compilation process next article

¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥

The above is simple Bochs installation and experiment, the installation is very simple, but not with debugging, with debugging to the original code to compile:

It's not much more complicated.

Install Bochs:
Then go to bochs official website to download the source package bochs-2.4.6.tar.gz
Unzip this file:

Tar vxzf bochs-2.4.26tar.gz
CD bochs-2.4.2
./configure--enable-debugger--enable-disasm
Make
sudo make install

But Ubuntu is a lot of things (at least mine)

sudo apt-get bulid-essional (free if previously installed)
sudo apt-get install Xorg-dev

But with two chances of estimating the desired scene you're seeing, it's very unlikely.

I also have a GTK not installed and so on ....

The debug error that occurred directly dumped the error message on Google. Will find the answer.

Hope that the brothers succeed once again


Related Article

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.