something about the process stack!

jincuteguy

Distinguished
Aug 28, 2002
160
0
18,680
You know when a process executes a TRAP or is interrupted, the operating system uses a separate stack to execute any operating system code rather than the stack of the current process. Anyone know why the operating systems designers select this type of implementation?
 

goloap

Distinguished
Sep 9, 2001
293
1
18,795
Based on what I know, there are two main reasons to do this:

1) It is safer, the OS stack is protected such that other process can't corrupt it. Which is easily done with bad programming.

2) The OS has access directly to kernel functions, which are not available to other process. It can't thus put them on the stack or else there would be some access violation.

In ancient times they had no statistics so they had to fall back on lies
 

mito

Distinguished
Jan 15, 2002
259
0
18,780
Can an ordinary process halt the system? If it accesses the hardware so much and directly, there's a risk.

/\/\ito