Home Ask Login Register

Developers Planet

Your answer is one click away!

Tyler February 2016

OS routine on an interrupt

I'm reading on how a mode switch is performed in a process image and I'm confused on why a process image has a kernel stack and not just a user stack? This is done when an interrupt has a occurred. Doesn't the user stack and kernel stack do the same things?


user3344003 February 2016

It's for security. A process usually has one stack for each processor mode. There is often either a system-wide or process interrupt stack that is an additional kernel mode stack.

The kernel stack is restricted to kernel mode access. This prevents user mode code from mucking with the kernel stack that would case bad things to happen in kernel mode (e.g., changing the return address from a procedure).

Post Status

Asked in February 2016
Viewed 2,906 times
Voted 9
Answered 1 times


Leave an answer

Quote of the day: live life