4 ms·
The 8086 didn't have a separate stack for interrupts. So, as I understand it, the problem isn't that code running in the interrupt handler might push data to a
by mjw1007 4y ago
The 8086 didn't have a separate stack for interrupts.
So, as I understand it, the problem isn't that code running in the interrupt handler might push data to a bad place; the problem is that the the processor itself would do so when pushing the return address before branching to the interrupt handler.
- cesarb 4y ago> the problem is that the the processor itself would do so when pushing the return address before branching to the interrupt handler. I want to emphasize this point: when handling an interrupt, the x86 processor itself pushes the return address and the flags into the stack. Other processor architectures store the return address and the processor state word into dedicated registers instead, and it's code running in the interrupt handler which saves the state in the stack; that would easily allow fixing the problem in software, instead of requiring it to be fixed in hardware (a simple software fix would be to use a dedicated save area or interrupt stack, separate from the normal stack; IIRC, it's that approach which later x86 processors followed, with a separate interrupt stack).
- robocat 4y ago> with a separate interrupt stack Some detail here: https://www.kernel.org/doc/html/latest/x86/kernel-stacks.html https://www.kernel.org/doc/html/latest/x86/kernel-stacks.htm...