I know kernel space is the memory section where the core of operating system executes and provides its services, and the user space is one where user programs run. Also I know that a process has its own stack, heap, data, and text section in its address space. But I'm confused with the concepts of user stack and kernel stack. My question is :
- Does the process stack I mentioned before consist of user stack and kernel stack?
- Is kernel stack part of the kernel space?
- Are the two stacks separated in a processes' virtual memory address?
- In the code segment:
void main(){user_mode_call(); system_call()}
do the stack frames of the two calls reside in user stack and kernel stack respectively?
Thanks for your time, any related literature and links would also be helpful!
(My questions may be naive but I'll keep updating them as soon as I know how put them in a more professional way)