Home turboPC
Python scripts Python tutorial Bouncing dice Diagram editor LRC network simulation
Qt embedded
OS Bootfloppy Go 64 bits Bochs

Bochs

Introduction

Bochs [1] is a processor emulator. It can be used as a virtual PC to test your OS.

Run bochs

You can configure bochs to run from a floppy image. Some required settings:

floppya: image=bootdisk.img, status=inserted
boot: floppy
Next run bochs:
$ bochs -q

You will see bochs boot and the emulated x86 PC is displayed:

bochs screen

The debug screen

Enable the GUI debugger by using the following in the configuration file bochsrc.txt (note that this feature is not always compiled in):

display_library: x, options="gui_debug"

Now a debug window show up:

Bochs debug screen

Breakpoints

Insert into bochsrc.txt:
magic_break: enabled=1

Now bochs will brake when the instruction:

xchg bx, bx

which does nothing, but bochs detects this and stops and enters the debugger.

References

[1] Bochs