> On Feb 20, 2025, at 5:04 PM, Mike Katz via cctalk <cctalk@classiccmp.org> 
> wrote:
> 
> The advantage of multiple stacks is that the system stack runs ring 0 
> protected tasks (main operating system tasks).  The user stack runs the 
> user(s) tasks.
> 
> On systems with some kind of memory protection this keeps any non system task 
> from accessing any other non-system tasks memory and possibly keeps any 
> individual system task from accessing any other system (or non-system) tasks 
> memory.  On these systems, usually an MMU is involved and an interrupt or 
> trap instruction will cause the MMU to switch its memory map to the system 
> stack.  Usually all interrupts go through the OS even if the eventually 
> interrupts handler code is in user memory.

That reminds me that the PDP-11 has the ability to send interrupts to modes 
other than kernel mode, because the new processor status (which includes the 
mode) is part of the interrupt vector.  I doubt that has ever been done, 
though.  One complication is that an interrupt into user mode that interrupts 
kernel mode code would be a dead end, because the RTI instruction can't restore 
the state then: in user mode it can't restore a PSW value that says kernel 
mode.  So a user mode vector would work only if the kernel is not interruptible 
at all.

        paul


Reply via email to