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.

On systems without any kind of protected memory it keeps the user level tasks from accessing system task memory.  On these systems, once the OS enters "protected mode" only an interrupt (or trapped instruction) can cause a switch to the system stack.

These statements are very high level and do not discuss the complexity of operating systems that use system memory and user memory.


Reply via email to