Re: linux process stack
|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
On Sat, 15 May 2010 11:11:09 +0200, ratheesh k <ratheesh.ksz@xxxxxxxxx> wrote:
1. All process and kenel thread has their own task_struct structure and kernel mode stack . Kernel itself maintain its own stack .
I'm not sure about kernel's own stack but otherwise it's correct.
2. Whenever a process, say A, switch to kernel (on system call), registers will be stored in its own kernel mode stack ?
3. On interrupt, process A's process context will be saved on process A's own kernel mode stack?
No. On interrupt context is not switched. Interrupt is run in a context of a task that was running so only registers are saved same as with system call.
4. Kernel thread will also use its own kenel mode stack on interrupt?
As far as I know, kernel threads are in no way special from user tasks in this regard.
5. Where is the SP (stack pointer) is saved? How it it retrieved back?
It is saved on the kernel mode stack and is retrieved from there. Note also that this may vary from architecture to architecture and I'm not an expert. -- Best regards, _ _ | Humble Liege of Serenely Enlightened Majesty of o' \,=./ `o | Computer Science, Michał "mina86" Nazarewicz (o o) +----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo-- -- To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs