Hi, how can i write my own exception handler ??
I preput that in my bootloader i create a GDT...
now i have a kernel, with my own cout....and now i want to implement a Exception handler before continuing to write my kernel...
sorry for my english ;D
Exception Handler
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re:Exception Handler
Basically, all you need to do is:
- create and IDT
- point it to your handler function (ints 0-31)
- make sure your exception handler pops any error code
- write the rest of the handler
- have it return (if the thread is not being terminated) using IRET
- create and IDT
- point it to your handler function (ints 0-31)
- make sure your exception handler pops any error code
- write the rest of the handler
- have it return (if the thread is not being terminated) using IRET
Re:Exception Handler
i found this http://www.eastcoastgames.com/articles/cppexception.html, the article doesn't say anything about IDT, pointer and IRET....
is another thing ?
is another thing ?
Re:Exception Handler
Yup, C++ exceptions are different to machine exceptions. The first deal with the C++ code messing up, are usually entirely a software construction, and handle the exception within the program code (unless it's not caught), while the latter deal with things like protection faults and suchlike and usually involve a hardware mechanism and are usually handled by the OS.
Re:Exception Handler
ok....i make the IDT, and now how can i make handler ?
any guide ?
i also read the third manual, chapter 5 (intel manual)...
any guide ?
i also read the third manual, chapter 5 (intel manual)...
Re:Exception Handler
Check out the OSFAQ (click the banner at the top of any forum page) for more info, including info on the various different ways to do it and why they should be avoided