lkml.org 
[lkml]   [2004]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel stack challenge
On Sun, Apr 04, 2004 at 11:24:38AM -0700, Sergiy Lozovsky wrote:

> I wonder how it is possible to access task struct
> having current stack pointer. %esp points at the
> middle of the stack (when we are in the kernel) when
> interrupt occures.

Look at the curren()t and get_current() macros. Basically, the stack
is page aligned, so with the proper masking of %esp you can get to the
bottom of the stack.

See http://www.kernelnewbies.org/faq/, "how does get_current work?".

Cheers,
Muli
--
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.050 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site