Any way to support custom exception handler? #369
Replies: 5 comments 12 replies
-
I made the |
Beta Was this translation helpful? Give feedback.
-
Oh, of course. Silly me. Apologies for that. It's been a while since I've used C++ There's another suggestion I'd like to implement -- I'd like to return from an exception handler, but the code in exceptionstub64.S and exceptionstub.S currently does not allow that as it does not correctly preserve registers and it messes up the stack a little I want to return from the exception handler so I can handle SWI/SVC exceptions to implement kernel function calls. (And maybe paging support) |
Beta Was this translation helpful? Give feedback.
-
This is what I had to do to get exception returning working (for 64 bit) This allows me to implement a custom exception handler that can return from SWI and SVC calls. As the Panic log level already pauses execution, there doesn't seem to be any downside to allowing exception handlers to return normally. In kernel.cpp:
In my custom exception handler:
|
Beta Was this translation helpful? Give feedback.
-
With deep respect for the work done here, wouldn’t it make more sense to port an existing RTOS (like FreeRTOS) to this platform using circle that already supports user processes than to write an entire new OS from scratch? Maybe I missed the point, for which I appologise, I’m just a simple developer who writes firmware for various MCUs most of the time for robots and stuff like that. |
Beta Was this translation helpful? Give feedback.
-
@dlbogdan I guess this post is going to get moved by the moderator as per the topic title. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to implement a custom exception handler? I couldn't see any way of doing this..
One way of implementing this is by slightly modifying CExceptionHandler to allow inheritance:
You can then create your own class inheriting from CExceptionHandler and replacing s_pThis with your own
Beta Was this translation helpful? Give feedback.
All reactions