Re: Kernel stack....

Erik Mouw (J.A.K.Mouw@ITS.TUDelft.NL)
Mon, 10 Sep 2001 23:57:25 +0200


On Mon, Sep 10, 2001 at 02:47:41PM -0700, Raghava Raju wrote:
> 1) I want to know what exactly is the structure
> of kernel stack. Is it some thing like bss,data,text?
>
> 2) I want to access kernel stack(in kernel
> mode). So I am using kernel stack pointer provided in
> thread_struct. So how to access different areas(.i.e
> data,text) in kernel stack.

I think you got a wrong understanding of the stack. The stack has no
separate bss, data, and text sections, it's just a stack of function
arguments, local variables, and return addresses.

Accessing the stack works automatically: call a function, and the
function paramaters and the return address are pushed on the stack.
Unless you have a *very* good reason, there is no need to manipulate
the stack directly in kernel mode.

Erik

PS: Please don't cross post between the kernelniewbes and linux-kernel
lists, use only one of them next time (kernelnewbies is good for this
kind of questions).

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/