ISR not catching divide by 0 error*FIXED*

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.
brentS
Posts: 16
Joined: Sat Jun 27, 2009 5:41 pm

Re: ISR not catching divide by 0 error

Post by brentS »

Unfortunately I tried that and still no luck.
User avatar
Zenith
Member
Member
Posts: 224
Joined: Tue Apr 10, 2007 4:42 pm

Re: ISR not catching divide by 0 error

Post 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?
"Sufficiently advanced stupidity is indistinguishable from malice."
brentS
Posts: 16
Joined: Sat Jun 27, 2009 5:41 pm

Re: ISR not catching divide by 0 error

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