Messages in this thread | | | Date | Sun, 4 Apr 2004 20:38:25 +0200 | From | Muli Ben-Yehuda <> | Subject | Re: 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] | |