Graphical Bochs Debugger Frontend

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.
Abunada
Posts: 17
Joined: Mon Jun 08, 2009 4:36 am

Graphical Bochs Debugger Frontend

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Graphical Bochs Debugger Frontend

Post by Combuster »

Have you read the documentation? If you did, what about it don't you understand?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Matthew
Member
Member
Posts: 48
Joined: Wed Jul 01, 2009 11:47 am

Re: Graphical Bochs Debugger Frontend

Post 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.
Abunada
Posts: 17
Joined: Mon Jun 08, 2009 4:36 am

Re: Graphical Bochs Debugger Frontend

Post 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
Abunada
Posts: 17
Joined: Mon Jun 08, 2009 4:36 am

Re: Graphical Bochs Debugger Frontend

Post 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
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Graphical Bochs Debugger Frontend

Post by NickJohnson »

You should have to change something in the bochsrc at least. Try this page instead.
viki
Posts: 14
Joined: Tue May 08, 2007 11:57 am
Location: Poland

Re: Graphical Bochs Debugger Frontend

Post 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 
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

Re: Graphical Bochs Debugger Frontend

Post 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.
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: Graphical Bochs Debugger Frontend

Post 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.
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

Re: Graphical Bochs Debugger Frontend

Post by yemista »

oh wow, those guys were hard core. im gonna remember bochs at thanksgiving
User avatar
gzaloprgm
Member
Member
Posts: 141
Joined: Sun Sep 23, 2007 4:53 pm
Location: Buenos Aires, Argentina
Contact:

Re: Graphical Bochs Debugger Frontend

Post 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
Visit https://gzalo.com : my web site with electronic circuits, articles, schematics, pcb, calculators, and other things related to electronics.
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: Graphical Bochs Debugger Frontend

Post 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.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Graphical Bochs Debugger Frontend

Post 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.
Abunada
Posts: 17
Joined: Mon Jun 08, 2009 4:36 am

Re: Graphical Bochs Debugger Frontend

Post 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
User avatar
mutex
Member
Member
Posts: 131
Joined: Sat Jul 07, 2007 7:49 pm

Re: Graphical Bochs Debugger Frontend

Post 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
Post Reply