Joseph A Knapka wrote: > > Anumula Venkat wrote: > > > > U are talking about stack used by kernel when a > > context switch takes place in a process. I am talking > > about Kernel Modules which completely runs in > > KERNEL MODE. If u have answer to this question please > > write to me. > > I answered it. Every time code in your kernel module > executes, it is doing so on behalf of some process. > Whether that process is a user-mode process that > has entered kernel mode for some reason, or is a > kernel thread, it is still a process in kernel mode > that executes on the current kernel stack. ALL CODE > in the Linux kernel, other than the boot code that > runs before init starts, is running in the context > of some process. The only difference between kernel > threads and user processes is that a kernel thread > -always- executes in kernel mode, using its kernel > stack and the kernel's pagetables. Well, I'm not sure that's accurate... what about interrupt handlers? There is something called "interrupt context" where kernel code is executed, but _not_ on behalf of some process (think receive of a packet for instance). There may be some random process that has been interrupted, but you don't know what process it is. When something like read() or open() is called, then you are in a process context. HTH, Eli --------------------. Real Users find the one combination of bizarre Eli Carter \ input values that shuts down the system for days. eli.carter(a)inet.com `------------------------------------------------- -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/