Self-modifying exception handlers.
Posted: Fri Oct 24, 2008 7:50 pm
Hey,
I've been working on some exception handlers for my OS (as an experiment) and plan to use these to catch exceptions before the computer reboots in order to hopefully correct the issue. I was wondering if anyone has worked on exception handlers that actually 'correct' the exception.
eg:
say exception 0 fires (divide by zero). Is the 'norm' to just notify the user/OS that this has happened and then halt or reboot? or do some of you actually go back and correct the error?
I've been working on (and for the most part finished) an exception 0 handler (div by zero) that goes back through to the interrupted RIP and either A: fixes the 'zero' variable/memory reference, or B: jumps over that particular code and continues as if that divide never happened. If the jump occurs, it leaves both variables/memory locations alone and will result in some wrong math (maybe), but no rebooting or halting.
Is this a good idea, or are there some extreme pitfalls that I am yet to run into.
I've been working on some exception handlers for my OS (as an experiment) and plan to use these to catch exceptions before the computer reboots in order to hopefully correct the issue. I was wondering if anyone has worked on exception handlers that actually 'correct' the exception.
eg:
say exception 0 fires (divide by zero). Is the 'norm' to just notify the user/OS that this has happened and then halt or reboot? or do some of you actually go back and correct the error?
I've been working on (and for the most part finished) an exception 0 handler (div by zero) that goes back through to the interrupted RIP and either A: fixes the 'zero' variable/memory reference, or B: jumps over that particular code and continues as if that divide never happened. If the jump occurs, it leaves both variables/memory locations alone and will result in some wrong math (maybe), but no rebooting or halting.
Is this a good idea, or are there some extreme pitfalls that I am yet to run into.