Page 1 of 2

Graphical Bochs Debugger Frontend

Posted: Wed Jul 01, 2009 10:16 am
by Abunada
Hi lads,

I am really happy today :), I had finished my boot loader and currently working on a kernel mode keyboard driver 8) . Recently I had switched to bochs since I had recognized it is virtually impossible to code an operating system without a debugger. Speaking of debuggers, I read the changes in a recent version of bochs, namely, bochs version 2.4, it said that they had implemented a "Graphical Bochs Debugger Frontend" that can run on most supported platforms. I don't know about you but to me that sounds handy, can anyone please provide any information on how one can use such a thing.

Cheers
Abdullah Abunada

Re: Graphical Bochs Debugger Frontend

Posted: Wed Jul 01, 2009 10:41 am
by Combuster
Have you read the documentation? If you did, what about it don't you understand?

Re: Graphical Bochs Debugger Frontend

Posted: Wed Jul 01, 2009 12:00 pm
by Matthew
The documentation will tell you how to setup the bochsrc but I will help you out a bit and note that you need to make sure Bochs was built with the proper configuration flags. I had to use --enable-debugger-gui --enable-debugger and --disable-plugins because the plugin system caused unresolved symbol errors to appear whenever I tried to load the X GUI plugin with GUI debugging enabled.

Though you can get quite far with the text-mode command-line debugger, which is what I was using for a while.

Re: Graphical Bochs Debugger Frontend

Posted: Wed Jul 01, 2009 12:14 pm
by Abunada
Thanks guys for the replies. I will try to compile bochs again with those arguments tonight. Actually I personally prefer the text mode debugger since I am fimilar with the syntax of GDB, however I wanted to try out the GUI just in case I am not in the mood :P.

Anyways thanks again guys.
Abdullah Abunada

Re: Graphical Bochs Debugger Frontend

Posted: Wed Jul 01, 2009 8:01 pm
by Abunada
Hi again,

I tried to compile bochs several times yesterday, however I had no luck with the using the GUI debugger frontend. I compiled it using the following commands:

Code: Select all

./configure --enable-debugger --enable-debugger-gui --enable-disasm --disable-plugins
make && sudo make install
It compiles correctly and everything, but I don't really know how to launch the graphical debugger. I tried to search the documentation but I had no luck with that too, actually the configure option "--enable-debugger-gui" is not documented here. I thought that whenever you compile it in, it should launch automatically whenever you spawn a new bochs session. Any help apprieciated here

Cheers
Abdullah Abunada

Re: Graphical Bochs Debugger Frontend

Posted: Thu Jul 02, 2009 12:45 am
by NickJohnson
You should have to change something in the bochsrc at least. Try this page instead.

Re: Graphical Bochs Debugger Frontend

Posted: Thu Jul 02, 2009 2:56 am
by viki
There is no need to compile bochs. In "Bochs-2.4" folder you have program called bochsdbg.exe the only need is to start it with params like below:

Code: Select all

bochsdbg.exe -q -f bochsrc.bxrc
the bochsrc.bxrc should looks similar to this:

Code: Select all

###############################################################
# bochsrc.txt file for DLX Linux disk image.
###############################################################

# how much memory the emulated machine will have
megs: 32

# filename of ROM images
romimage: file=c:\viki\Bochs-2.4\BIOS-bochs-latest
vgaromimage: file=c:\viki\Bochs-2.4\VGABIOS-lgpl-latest

# what disk images will be used 
floppya: 1_44="C:\viki\osdev\vk\ucos\floppy.img", status=inserted

# hard disk
ata0: enabled=0, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="", cylinders=306, heads=4, spt=17

# choose the boot disk.
boot: a

display_library: win32, options="gui_debug" # use Win32 debugger gui

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

mouse: enabled=0

#gdbstub: enabled=1, port=950, text_base=0, data_base=0, bss_base=0 

Re: Graphical Bochs Debugger Frontend

Posted: Fri Jul 03, 2009 12:51 pm
by yemista
Abunada wrote:Hi lads,
Recently I had switched to bochs since I had recognized it is virtually impossible to code an operating system without a debugger.
Just a piece of history in case anyone might know, how did they first code linux 1.0? Im pretty sure it was way before bochs existed.

Re: Graphical Bochs Debugger Frontend

Posted: Fri Jul 03, 2009 2:07 pm
by xDDunce
yemista wrote:
Abunada wrote:Hi lads,
Recently I had switched to bochs since I had recognized it is virtually impossible to code an operating system without a debugger.
Just a piece of history in case anyone might know, how did they first code linux 1.0? Im pretty sure it was way before bochs existed.
ah yes, but you don't actually *NEED* a debugger. it's just it makes things easier when things go bad. if you didn't want to use a debugger, you could write out a full algorithm and work out exactly what each register is at any single instruction (which is basicly breakpoint testing). if it doesn't look right, then it's going to be wrong. right?

besides that, when linux 1.0 was being made, the technology in a computer was much higher than it is today. so you didn't really wanna test on hardware until you've double-triple-quadruple checked the code for any rogue code, just in case something went horribly wrong (e.g. the most common thing is a mis-programmed monitor resulting, most violently, in flying glass). having done this on an old laptop, causing the HD to start smoking, i advise precaution.

Cheers,
James.

Re: Graphical Bochs Debugger Frontend

Posted: Fri Jul 03, 2009 8:20 pm
by yemista
oh wow, those guys were hard core. im gonna remember bochs at thanksgiving

Re: Graphical Bochs Debugger Frontend

Posted: Fri Jul 03, 2009 8:39 pm
by gzaloprgm
besides that, when linux 1.0 was being made, the technology in a computer was much higher than it is today. so you didn't really wanna test on hardware until you've double-triple-quadruple checked the code for any rogue code, just in case something went horribly wrong (e.g. the most common thing is a mis-programmed monitor resulting, most violently, in flying glass). having done this on an old laptop, causing the HD to start smoking, i advise precaution.
I have heard of monitor explosions (even I can't find any videos on youtube), but HD smoking !? what exactly did you do? Tell me more!

Cheers,
Gzaloprgm

Re: Graphical Bochs Debugger Frontend

Posted: Sat Jul 04, 2009 7:57 am
by xDDunce
lol, im not sure if it was my HD code or just an over heating CPU (they're right next to each other) but i was actually accessing to high a cylinder for the drive and when i pulled the disk out, it was starting to burn down one side. the rest of the laptop was ok though so... speculation is the best i can get.
yemista wrote:oh wow, those guys were hard core. im gonna remember bochs at thanksgiving
</sarcasm>haha... </sarcasm>

I think it's better to write out the algorithm and check it before actually coding it, then checking the code just to be sure it's all gonna work. just think about when you're OS becomes so big it takes a few mins to compile for a small edit. i would rather know it works in theory than to test it out and find there are about 10 errors which may be blocking other errors from surfacing which means at least another 2 re-compiles.

yes, occasionally i will skip the process but very rarely (or if theres no-one to play sword fights with whilst my code is compiling - theres a pic on the forums somewhere.... too lazy to find it).

and finally: if they're so hardcore for pen and paper working, what do you think of the first compiler builders? writing in pure assembly! hardcore to the max!

Cheers,
James.

Re: Graphical Bochs Debugger Frontend

Posted: Sun Jul 05, 2009 8:38 am
by bewing
@OP: after the compilation stage (which you say you have completed successfully), yes you need to modify one line in the bochsrc file. You need to add an "option" to your display library, such as display_library: x, options="gui_debug"

And I think that after trying it for awhile, you will find that it is extremely convenient to be able to see all the registers and all the code at the same time, to be able to set breakpoints with a doubleclick, and to hexdump (and view) large amounts of memory -- things you cannot do in textmode.

Re: Graphical Bochs Debugger Frontend

Posted: Mon Jul 06, 2009 2:45 pm
by Abunada
Thanks guys, I really appreciate your help.
I got it working long ago, But I had not had any time to post a reply.
Thanks Nick, I should have looked at that page before trying to post, Just as Combuster advised.

Cheers
Abdullah

Re: Graphical Bochs Debugger Frontend

Posted: Thu Jul 16, 2009 6:26 am
by mutex
Great news guys,

Just in time for some summertime fun with the os code..

I tried the BFR or whatever it was called but it did not do it for me.

This looks very promising (from the screenshots) i found..

I tried to compile the latest cvs version. I compiled with options mentioned above and everything goes well.

I added the options="gui_debug" to the display line in bochs rc.. When i do that bochs seg-faults.. When i remove it everything is ok..

Im not sure what this is or how to find out really what went wrong. Anyone had success with bochs and the x + gui_debug ?

appriciate any help or tips.. In the meantime i will try to compile it for win32 on cygwin.. :)

cheers
Thomas