David Whysong wrote:
>
> Can someone point me in the right direction? I'm looking through the code
> for a place where (for example) p->priority is set for a new task.
For 386?
As soon as the kernel starts, right in arch/i386/kernel/head.S, the
stack pointer is initialised to point 8k beyond the start of 'union
task_union', which is defined in init_task.c
So at this point in time, the stack looks like this:
SP -> ---------------- 8k
| |
| |
...
|--------------|
| task_union |
current ---------------- 0k
So the initial kernel thread's task_struct is defined by the INIT_TASK
macro in include/linux/sched.h. The declaration in init_task.c does the
RAM initialisation. union task_union provides the stack for the kernel
during booting.
The initial kernel task is started at the end of
init/main.c:start_kernel(), still using this initial task_struct.
>From this point on, all new tasks/threads inherit a copy of their
parent's task_struct in kernel/fork.c:do_fork():
*p = *current;
-- -akpm-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:09 EST