Page 2 of 2
Re: ISR not catching divide by 0 error
Posted: Sun Jul 19, 2009 9:56 am
by brentS
Unfortunately I tried that and still no luck.
Re: ISR not catching divide by 0 error
Posted: Sun Jul 19, 2009 11:21 am
by Zenith
Okay, time for debugging 101 instead of the continuous shots in the dark. Put a halt before the divide by zero. Also, dump the value of &idt to output or a register beforehand.
Once it halts, get the the value for idtr in the graphical debugger (Options > Show System Registers). The value in the parentheses indicates the limit. The value outside the parentheses indicates the virtual address.
What is the value of &idt? Is it exactly the same as the value in idtr? And does the limit in the parentheses equal 8*256-1?
Re: ISR not catching divide by 0 error
Posted: Wed Jul 22, 2009 2:31 pm
by brentS
Guys thanks for your advice I fixed the bug. My friend suggested I ditch D and rewrite it in C. I did and gcc gave me a funny warning. Trying to cast a long to an int.*duh* Bochs wasnt receiving my idt starting address correctly because it was being cast down. Thanks for all your tips.