Implementation of SEH in your Kernel

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
puneet
Posts: 7
Joined: Thu Jan 07, 2010 7:29 am

Implementation of SEH in your Kernel

Post by puneet »

Hi,

Has anyone implemented SEH in their OS? I am not very sure what to do about it. Probable ways would be to use TRY and CATCH as macros to push exception handler in exception handler stack. There has to be one exception Handler stack per thread??

Or I can leverage some compiler try {} catch {} implementation. I am using gcc. Please let me know if any one has any pointers or suggestions on this.

Thanks,
Puneet
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Implementation of SEH in your Kernel

Post by Gigasoft »

Yes, each thread should have it's own exception handler list.

In my OS, there's a preliminary version of SEH. Processor exception handlers build an exception frame and pass it to the exception dispatcher, which calls every exception handler until one of them handles the exception. If the exception isn't handled, the debugger is invoked.
puneet
Posts: 7
Joined: Thu Jan 07, 2010 7:29 am

Re: Implementation of SEH in your Kernel

Post by puneet »

Thanks for your reply Gigasoft!!

What compiler are you using?? Have you created try { } Catch { } definitions in OS or are you using it what compiler defines?

Thanks,
Puneet
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Implementation of SEH in your Kernel

Post by Gigasoft »

My OS is written in assembly. Drivers call InstallEH and RemoveEH functions to install and remove exception handlers at the beginning and end of functions. I may also add support for C++ exceptions and other types of exception constructs that are implemented in various compilers later.
Post Reply