Page 2 of 2
Re: Problem with 32 bit interrupt handling in C.
Posted: Thu Dec 03, 2020 4:03 pm
by psimonson1988
It results in a triple fault because ebp is pushed but never popped... CPU pops important registers back from the stack and since the stack is corrupted it faults.
Where did you see that I'm pushing ebp and never popping it back from the stack? I cannot seem to find it.
Re: Problem with 32 bit interrupt handling in C.
Posted: Thu Dec 03, 2020 4:05 pm
by austanss
you don't in particular, it is automatically generated by the compiler for normal functions like the one you have defined.
Re: Problem with 32 bit interrupt handling in C.
Posted: Thu Dec 03, 2020 4:07 pm
by psimonson1988
So is there a way to stop this from happening or how do I fix it?
Re: Problem with 32 bit interrupt handling in C.
Posted: Thu Dec 03, 2020 4:09 pm
by austanss
__attribute__(interrupt)
Re: [Sovled] Problem with 32 bit interrupt handling in C.
Posted: Fri Dec 04, 2020 12:45 pm
by nexos
I write my handlers in seperate ASM files. Thats the cleanest way to do it.