Problem with Bochs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Klakap
Member
Member
Posts: 299
Joined: Sat Mar 10, 2018 10:16 am

Problem with Bochs

Post by Klakap »

good day!
When I wanted to run bochs I got this result:

Code: Select all

========================================================================
                        Bochs x86 Emulator 2.6
            Built from SVN snapshot on September 2nd, 2012
========================================================================
00000000000i[     ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'
00000000000i[     ] BXSHARE not set. using compile time default '/usr/share/bochs'
00000000000i[     ] lt_dlhandle is 0x2abc4c0
00000000000i[PLGIN] loaded plugin libbx_unmapped.so
00000000000i[     ] lt_dlhandle is 0x2abd0d0
00000000000i[PLGIN] loaded plugin libbx_biosdev.so
00000000000i[     ] lt_dlhandle is 0x2abda50
00000000000i[PLGIN] loaded plugin libbx_speaker.so
00000000000i[     ] lt_dlhandle is 0x2abde00
00000000000i[PLGIN] loaded plugin libbx_extfpuirq.so
00000000000i[     ] lt_dlhandle is 0x2abf970
00000000000i[PLGIN] loaded plugin libbx_parallel.so
00000000000i[     ] lt_dlhandle is 0x2ac1620
00000000000i[PLGIN] loaded plugin libbx_serial.so
00000000000i[     ] lt_dlhandle is 0x2ac5200
00000000000i[PLGIN] loaded plugin libbx_gameport.so
00000000000i[     ] lt_dlhandle is 0x2ac5ca0
00000000000i[PLGIN] loaded plugin libbx_iodebug.so
00000000000i[     ] reading configuration from bochsrc.txt
00000000000p[     ] >>PANIC<< bochsrc.txt:5: vgaromimage directive malformed.
00000000000e[CTRL ] notify called, but no bxevent_callback function is registered
00000000000i[CPU0 ] CPU is in real mode (active)
00000000000i[CPU0 ] CS.mode = 16 bit
00000000000i[CPU0 ] SS.mode = 16 bit
00000000000i[CPU0 ] EFER   = 0x00000000
00000000000i[CPU0 ] | EAX=00000000  EBX=00000000  ECX=00000000  EDX=00000000
00000000000i[CPU0 ] | ESP=00000000  EBP=00000000  ESI=00000000  EDI=00000000
00000000000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf
00000000000i[CPU0 ] | SEG sltr(index|ti|rpl)     base    limit G D
00000000000i[CPU0 ] |  CS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  DS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  SS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  ES:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  FS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  GS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] | EIP=00000000 (00000000)
00000000000i[CPU0 ] | CR0=0x00000000 CR2=0x00000000
00000000000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
bx_dbg_read_linear: physical memory read error (phy=0x0000000000000000, lin=0x0000000000000000)
00000000000i[CTRL ] quit_sim called with exit code 1
Please what should I do so that I bochs start?
Octocontrabass
Member
Member
Posts: 5586
Joined: Mon Mar 25, 2013 7:01 pm

Re: Problem with Bochs

Post by Octocontrabass »

Are you trying to follow a bad tutorial?

Delete bochsrc.txt and use the built-in menu to generate a new one. Start with the factory default configuration, then make any changes you need.
Klakap
Member
Member
Posts: 299
Joined: Sat Mar 10, 2018 10:16 am

Re: Problem with Bochs

Post by Klakap »

I am getting a panic romimage directive malformed :(
config:

Code: Select all

romimage: file="/usr/share/bochs/BIOS-bochs-latest", options=fastboot
Klakap
Member
Member
Posts: 299
Joined: Sat Mar 10, 2018 10:16 am

Re: Problem with Bochs

Post by Klakap »

I have already resolve this problem, but I don't know how I got through bochs to run my kernel. Please advise me.
Octocontrabass
Member
Member
Posts: 5586
Joined: Mon Mar 25, 2013 7:01 pm

Re: Problem with Bochs

Post by Octocontrabass »

Klakap wrote:I am getting a panic romimage directive malformed :(
Update Bochs, or stop trying to use directives that aren't supported on your old version of Bochs.
Klakap wrote:I have already resolve this problem, but I don't know how I got through bochs to run my kernel. Please advise me.
Have you tried using the built-in menu? You can use it to load your disk image in one of the virtual drives, and set the boot order so Bochs will boot from that virtual drive.
Klakap
Member
Member
Posts: 299
Joined: Sat Mar 10, 2018 10:16 am

Re: Problem with Bochs

Post by Klakap »

I tried http://bochs.sourceforge.net/doc/docboo ... onfig.html but when I see:

Code: Select all

---------------------
Bochs Runtime Options
---------------------
1. Floppy disk 0: (not present)
2. Floppy disk 1: (not present)
3. 1st CDROM: (not present)
4. 2nd CDROM: (not present)
5. 3rd CDROM: (not present)
6. 4th CDROM: (not present)
7. (not implemented)
8. Log options for all devices
9. Log options for individual devices
10. Instruction tracing: off (doesn't exist yet)
11. USB runtime options
12. Misc runtime options
13. Continue simulation
14. Quit now
and I press 1, bochs wrote the same thing. And I have the next problem, bochs is very very very slow. Please what do I do?
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Problem with Bochs

Post by BenLunt »

Hi there,

First, I would suggest that you grab the latest release of Bochs. Current version is at http://bochs.sourceforge.net/ and is v2.6.9. Then I suggest you grab the latest bochsrc.txt file from https://sourceforge.net/p/bochs/code/HE ... s/.bochsrc (https://sourceforge.net/p/bochs/code/HE ... format=raw). It currently has general/common used items already set. You can go through it and comment out items you don't plan to use. It also has many comments to instruct you on each item.

As for the speed, Bochs is not meant to be fast. Bochs is meant to be used as a testing tool, a tool that will emulate each and every instruction, hardware task, etc., with a lot of debugging capabilities to be able to test your guest. Yes, this makes Bochs considerably slower than other emulators. However, when tracking down a bug, in my opinion, there is no better emulator environment.

If you wish for a faster emulator, there is QEMU from https://www.qemu.org/, Oracle's VirtualBox from https://www.virtualbox.org/, along with a few others.

QEMU is quite fast, but since the support for WinXP has been dropped, I can no longer stay up with latest releases.

VirtualBox is also quite fast, not as fast as QEMU but much faster than Bochs, and has a nice interface.

However, neither compare to Bochs' ability to debug the Quest.

Hope this helps,
Ben
Klakap
Member
Member
Posts: 299
Joined: Sat Mar 10, 2018 10:16 am

Re: Problem with Bochs

Post by Klakap »

Version of my bochs is 2.6, the last number I don't know; when I copied bochsrc, bochs works faster, but I couldn't run .iso file :( . Please how do I do that?
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Problem with Bochs

Post by BenLunt »

Code: Select all

ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=cdrom, path=D:\file.iso, status=inserted, model="file.iso"
boot: cdrom
However, this assumes that the ISO file is correctly formatted and has a bootable interface.
(This also assumes you are using the DOS/Windows path format, D:\file.ext. You will need to use whatever path type your platform uses)

Ben
Post Reply