General Protection Fault Question

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
beyondsociety

General Protection Fault Question

Post by beyondsociety »

I was looking at Tom's link on how to use and enter v86 mode and it talks about the General Protection Fault. I know what that is. The Big Blue Screen of Death in Windows!.

How would I go about creating my own General Protection fault. I hate having to see my computer reboot because I didn't set up the Pmode entry right. I would like to have a screen pop up and display the errors.
beyondsociety

Re:General Protection Fault Question

Post by beyondsociety »

I was looking at the Art of Assembly Language Programming website for anything on General Protection Fault and I stubbled onto traps and exception handling. Could I use this as my GPL since it sort of acts like it but instead of a pretty screen it just displays a exception error in dos.

ex:

DOS invokes the critical error handler by executing an int 24h instruction whenever some sort of I/O error occurs. The default handler prints the familiar message:

I/O Device Specific Error Message
Abort, Retry, Ignore, Fail?
Warmaster199

Re:General Protection Fault Question

Post by Warmaster199 »

The general protection fault occurs when you write to an area you weren't supposed to. You need to install an interrupt handler for interrupt 0x0D (I guess they made it 0D for "Oh dear"). It's not that hard to do, I have sucessfully implemented it in my OS, CTOS. And now, that interrupt handler for those "exceptions" is about to help me with debugging my code(somewhere I passed the wrong argument type). Be sure to display register information as well(I need to add this).
Post Reply