lkml.org 
[lkml]   [1999]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Kernel Stack
Richard B. Johnson wrote:
>
> On Fri, 9 Apr 1999, Brian Gerst wrote:
>
> > Livia Catarina Soares wrote:
> > > 1- Where is the kernel stack ??
> > > Is it above the address "0xC0000000" in the kernel memory ??
> >
> > There is one kernel stack for every user process, and it is mapped in
> > kernel memory (above PAGE_OFFSET). Note that even in an interrupt
> > context, the kernel stack of whatever user process was running is used.
> > ^^^^^^^^^^^^
>
> The kernel stack is a kernel stack. It is not associated with a
> user process. If this was not true, a user could crash the system.

You didn't read my post very carefully. Every process has 8k (2
consectutive pages on i386) of kernel memory allocated to it. This is
where the task struct resides, and what is left over is used for the
stack while the processor is in kernel mode. This has nothing to do
with the user mode stack, as the int $0x80 call (or any other interrupt)
switches %esp to the value that is saved in the TSS (which is part of
the task struct).

--

Brian Gerst

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.052 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site