3 ms·
> Likewise x86 interrupts are handled on the stack and so you need to keep the stack pointer initialized for them (modern CPUs will automatically switch the st
by toast0 6y ago
> Likewise x86 interrupts are handled on the stack and so you need to keep the stack pointer initialized for them (modern CPUs will automatically switch the stack for you from whatever user code is running, but they still need to switch it to a grows-down area you initialized for them).
If your kernel is re-entrant, you need to keep platform stack conventions in the kernel, or an interrupt (or exception) during the kernel will overwrite your backwards stack.
I don't know for sure, but I think aignal handing in user processes runs on the user stack too (but I could easily be wrong).
If you really wanted, you could use the platform stack for call/ret only and have a separate data stack with whatever conventions you like.