Troubleshooting: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
m (adding link)
No edit summary
Line 2:
===Exception Handlers===
 
The first thing ever to do is to implement a reliable 'exception handler' that will tell you what was wrong. Under an emulator like BOCHS, the absence of such a handler will lead to a '3rd Exception without resolution' panic message, if the emulator is configured to do so... on bare hardware, it will simply reset your computer. If the CPU cannot execute some exception handler, it tries to execute the Double Fault exception handler. If it's unable to execute it either, a Triple Fault is caused. Also keep in mind that exceptions cannot be masked so either your code is perfect or you need exception handlers.
 
It's quite convenient to have the exception handler showing what kind of exception occurred before anything 'hazardous' is attempted. Displaying (as hex) the exception number in a corner of the screen, for instance can save you hours of debugging :)
Anonymous user