Process is a construct in linux kernel. A process defines the granularity at which the kernel can allocate resources (e.g. memory, processor time etc).
Each process in linux has a unique Process Identifier (PID). The PID is allocated to the process at the time of the creation and is never changed. This allows the kernel and the user to control the process using the PID. For e.g., the command for terminating the process takes PID as the input.
Each process has 2 data structures which are allocated. They are: thread_info and task_struct. The thread_info contains a pointer to the task_struct data structure. Also, the thread_info is allocated at the bottom of the Kernel Stack which is pointed to by the register (esp). This arrangement of thread_info and task_struct makes it easy for the kernel to refer to the task_struct of the current process very easily. This is defined by the macro Current.
The thread_info is part of the union containing the kernel stack and the thread_info structure. Thus the kernel stack and the thread info can share the same memory pages.
The task_struct contains the data related to this process. This structure is called Process Descriptor. The information stored in this structure helps the kernel access correct memory, files, scheduling information etc.
Thursday, March 20, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment