I am using Bochs on Linux.It works fine but there is a problem I haven't managed to cope with.I get the vga-info (available modes, address of linear framebuffer(LFB)) and then switch to 1024*768*24 in real mode.According to the vga-info mode 118h (1024*768*24) is supported and the LFB is from E000:0000 (i.e. E0000 because of segment:offset, or 0xE0000000 in flat addressing but that memory doesn't exist because it's almost 3.5Gb).Later I switch to protected mode(PM) and write data to E0000, but no pixels appear. Neither do if I write to 0xE0000000. However they do if I write to A0000 but only A0000-C0000 memory (128Kb) is mapped. I'd like to use PM because of the 32bits and the LFB (no paging). I know that the videomemory of lower resolutions (e.g. 320*200*256) is mapped to A0000.In Bochs-config vbe is enabled (vga: extension=vbe) . bochsout.txt says "VBE Bochs Display Extension Enabled".
I don't understand this 0xE0000000 because Bochs supports maximum 1Gb memory and this is by far more. By the way enabling vbe by compiling Bochs with --enable-vbe is depricated, "vga: extension=vbe" should be used instead in bochs-configfile.
In windows, mouse handling is extremely difficult. I suspect it has something to do with the "boost" feature windows has. Once you get the mouse moving it will keep moving in that direction even when you're trying to move to a different direction. The solution is to counter the movement by moving to the opposite direction. It's sort of like trying to push the mouse the other way in order to stop it.
1) Create your bochs image and configuration files. I highly recommend installing the OS on a PC before moving it to the PSP (unless you want to spend the next 10 years staring at a progress bar). You can also download some readily available images from here.
6) Edit the bochs configuration file so it will point to your disk images and bios files correctly. Note that on a PSP you have to use the "ms0:/" prefix as the root of your filesystem (see the example configuration in the downloads). Also set the amount of memory your VM will use. Be sure to set it to about 8MB as the PSP will crash if you try to use more (the PSP has about 32MB of RAM total).
7) Rename the bochs configuration file to "bochsrc.bxrc" and put it under the VM directory. This is the only real requirement as the path to the configuration is hardcoded. You can put the rest of the files wherever you want as long as the configuration file points to them correctly. See downloads section for sample script.
To use Bochs to boot your custom kernel, search for the "floppya" and "boot" lines in the bochsrc configuration file. The following configuration allows you to use, and boot from, the "real" floppy drive of your computer:
Bochs has a command-line internal debugger, and a graphical interface on top of it. You must compile Bochs with the configuration option and then edit your bochsrc file in order to enable the GUI debugger. I use this line in my bochsrc file to enable graphical debugging in X:
Installing an operating system in Bochs is a little tricky, open bochs.exe (from what you built before.) then make sure that it starts without any problem (some systems have problem opening Bochs !).
Bochs can be compiled and used in a variety of modes, some which are still in development. The 'typical' use of bochs is to provide complete x86 PC emulation, including the x86 processor, hardware devices, and memory. This allows you to run OS's and software within the emulator on your workstation, much like you have a machine inside of a machine. For instance, let's say your workstation is a Unix/X11 workstation, but you want to run Win'95 applications. Bochs will allow you to run Win 95 and associated software on your Unix/X11 workstation, displaying a window on your workstation, simulating a monitor on a PC.
This is the default display device (on x86). It provides full VGA compatibility and support for a simple linear framebuffer (using the bochs dispi interface). It is the best choice compatibility wise, pretty much any guest should be able to bring up a working display on this device. Performance or usability can be better with other devices, see discussion below.
This device supports a simple linear framebuffer. It also uses the bochs dispi interface for modesetting, therefore the linear framebuffer configuration is fully compatible to the standard VGA device.
For BIOS guests this device might be useable as well, depending on whenever they depend on direct VGA hardware access or not. There is a vgabios which supports text rendering on a linear framebuffer, so software which uses the vgabios services for text output will continue to work. Linux bootloaders typically fall into this category. The linux text mode console (vgacon) uses direct hardware access and does not work. The framebuffer console (fbcon running on vesafb or bochs-drm) works.
This device lacks VGA compatibility mode but is otherwise identical to the qxl vga device. Providing multihead support for windows guests is pretty much the only use case for this device. The windows guest driver expects one qxl device per secondary display (additionally to one qxl-vga device for the primary display).
The first thing we need to do is create a "bochsrc" file. This is the Bochsconfiguration file. It configures all of the hardware parts of the virtualsystem. Here's an example bochsrc file that will work with Tiny Core Linux andthe disk image we created in the last section.
Two different Bochs binaries should be installed. One, named simplybochs, should have the GDB stub enabled, by passing--enable-gdb-stub to the Bochs configure script. Theother, named bochs-dbg, should have the internal debuggerenabled, by passing --enable-debugger to configure.(The pintos script selects a binary based on the optionspassed to it.) In each case, the X, terminal, SDL and "no GUI" interfacesshould be configured, by passing --with-x --with-x11 --with-term --with-sdl--with-nogui to configure.
This version of Pintos is designed for use with Bochs 2.6.2. A numberof patches for this version of Bochs are included in the Pintos tarball in src/misc.To apply all the patches, build Bochs, and install it, cd $PDIR/src/misc, where $PDIRis the directory with the decompressed Pintos tarball, then type: env SRCDIR=[srcdir] PINTOSDIR=[srcdir] DSTDIR=[dstdir] sh bochs-2.6.2-build.shYou will have to supply the proper SRCDIR (the directory containing the bochs-2.6.2.tar.gz file),PINTOSDIR (directory with Pintos' source code i.e., $PDIR), and DSTDIR (the destination of Bochs build).This command applies patches and builds both binaries. Update PATH with the directory where Bochs was installed. H.2 Running Pintos with Bochs Pintos can be run with Bochs by supplying --bochs to pintoscommand:$ pintos --bochs -- run alarm-multiple
This command creates a bochsrc.txt file, which is needed forrunning Bochs, and then invoke Bochs. Bochs opens a new window thatrepresents the simulated machine's display, and a BIOS message brieflyflashes. Then Pintos boots and runs the alarm-multiple testprogram, which outputs a few screenfuls of text. When it's done, youcan close Bochs by clicking on the "Power" button in the window's topright corner, or rerun the whole process by clicking on the "Reset"button just to its left. The other buttons are not very useful for ourpurposes.
df19127ead