What kind of data is stored in the Kernel mode stack of a process ? Is a processes “user mode” call chain stored in the kernel stack ?
Thanks,
vIjay
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your kernel call chain, and “no”
The linux kernel is itself a threaded program which works by switching stacks.
So, let’s say you do
read(0, space, 100);, or perhaps justc = getchar();, which will eventually turn into aread().When linux gets control it will start making function calls, naturally using the kernel stack. It will make calls lower and lower in the kernel until it finally gets to a tty or network layer.
But you haven’t typed anything yet!
So it simply switches to another process, one that really is runnable, and it leaves all those function call activation frames on the stack. Eventually you type something and the kernel figures out that your process is now runnable, and when it switches back, again switching stacks, all of those function calls implementing your
read(2)can now unwind and eventually return to user mode.