Re: Re: Kernel Stack and User Stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 


On Fri, 19 May 2006 Manjunath Naik wrote :
>each process has an associated task_struct, which is used for process
>managament. to allocate this struct, the kernel allocates 2 pages (normally,
>but as mentioned, it can be only 1 page), which amounts to 8k, and places
>the task_struct at the bottom.

This is the Kernel Mode stack, which you are talking about. The kernel mode stack is represented by the union thread_union. this union contains the tHRead_info structure which contains a pointer to the task_struct.

This is how the process descriptor and the kernel mode stack are related.

Refer Chapter 3 of the book UTLK-3 by By Daniel P. Bovet, Marco Cesati

>each time the host goes from user space to kernel space (interrupt, system
>call , etc...), these 2 pages are used for the kernel stack.
>so, your module does not have a stack of it's own, but rather uses whats
>available at the time of it's execution - either the 2 pages as i mentioned,
>or the stack of a kernel thread which called it.
>
>Source : http://kerneltrap.org/node/5416
>
>On 5/18/06, abum@xxxxxxxxx <abum@xxxxxxxxx> wrote:
>>
>>Yes. There is also a per process kernel stack maintained by ernel.
>>
>>~Abu
>>
>> > HI,
>> > I am a newbie to linux kernel. I wanted to know that for every process
>> > created in User Space
>> > there is a separate stack created .Wat about the kernel stack , is it
>> > separate for every process
>> >
>> > Thanks in advance,
>> > Zaheer
>> >

Hope it helps
- Rohit

>>
>>
>>
>>**************************Disclaimer************************************
>>Information contained in this E-MAIL being proprietary to Aftek Infosys
>>Limited
>>is 'privileged' and 'confidential' and intended for use only by the
>>individual
>>or entity to which it is addressed. You are notified that any use, copying
>>or dissemination of the information contained in the E-MAIL in any manner
>>whatsoever is strictly prohibited.
>>
>>***************************************************************************
>>http://www.aftek.com/
>>
>>
>>--
>>Kernelnewbies: Help each other learn about the Linux kernel.
>>Archive:      http://mail.nl.linux.org/kernelnewbies/
>>FAQ:          http://kernelnewbies.org/faq/
>>
>>




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux