how to debug using 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
shaz

how to debug using bochs

Post by shaz »

i'm using bochs for the first time.please explain the following bochs log file.
how can i debug using bochs.

Code: Select all

00002404408p[CPU  ] >>PANIC<< prefetch: running in bogus memory
00002404408i[SYS  ] Last time is 1075000370
00002404408i[CPU  ] protected mode
00002404408i[CPU  ] CS.d_b = 32 bit
00002404408i[CPU  ] SS.d_b = 32 bit
00002404408i[CPU  ] | EAX=00000010  EBX=00000010  ECX=00130001  EDX=000003f2
00002404408i[CPU  ] | ESP=00001000  EBP=00000000  ESI=00000000  EDI=0000ffe4
00002404408i[CPU  ] | IOPL=0 NV UP DI PL NZ NA PE NC
00002404408i[CPU  ] | SEG selector     base    limit G D
00002404408i[CPU  ] | SEG sltr(index|ti|rpl)     base    limit G D
00002404408i[CPU  ] |  DS:0010( 0002| 0|  0) 00000000 000fffff 1 1
00002404408i[CPU  ] |  ES:0010( 0002| 0|  0) 00000000 000fffff 1 1
00002404408i[CPU  ] |  FS:0010( 0002| 0|  0) 00000000 000fffff 1 1
00002404408i[CPU  ] |  GS:0010( 0002| 0|  0) 00000000 000fffff 1 1
00002404408i[CPU  ] |  SS:0010( 0002| 0|  0) 00000000 000fffff 1 1
00002404408i[CPU  ] |  CS:0008( 0001| 0|  0) 00000000 000fffff 1 1
00002404408i[CPU  ] | EIP=88100006 (88100006)
00002404408i[CPU  ] | CR0=0x60000011 CR1=0x00000000 CR2=0x00000000
00002404408i[CPU  ] | CR3=0x00000000 CR4=0x00000000
00002404408i[     ] restoring default signal behavior
Slasher

Re:how to debug using bochs

Post by Slasher »

In your code somewhere you have jumped to an undefined or unmapped region of memory.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:how to debug using bochs

Post by Pype.Clicker »

if you have the internal bochs debugger enabled, the best thing to do is probably to type "trace-on" on the debugger console before "c"ontinuing your program .. this way, you'll know where your program was *before* it jumped/called the bad address ... and you'll be able to find out why it did so (probably a misinitialized pointer to function somewhere ?)
Ozguxxx

Re:how to debug using bochs

Post by Ozguxxx »

Im just speculating: I think eip's bad value might come from popping eip in an interrupt handler, you are by mistake popping eip and when you do iret, you return to this bad eip value. But just speculating, this is the first thing I can think of. Good luck.
Post Reply