Re: Kernel stack

From: aq
Date: Tue Oct 12 2004 - 05:07:54 EST


> There is no SS entry, because SS does not specify the stack. It is siply
> a segment in which the stack lives. Any segment, that covers all address
> space will do! IIRC in kernel SS == DS.
yes, if I am right, in Linux SS, DS and CS all point to the same base
address ( = 0 ?). To be exact, SS !=DS, since the segment registers in
protected mode point to segment selectors (in GDT ?), and we should
compare the value stored GDT entries, not the value of SS and DS in
this case.

> The kernel stack is allocated together with the task_struct. Two pages
> are allocated and task_struct is placed at the start while the stack is
> placed at the end and grows down towards the task_struct.
2 pages of kernel stack or not is optional. Recently version of kernel
allow you to choose to use 4K or 8K size for kernel stack.

>From what you all discuss, I can say: kernel memory is devided into 2
part, and the upper part are shared between processes. The below part
(the kernel stack, or 8K traditionally) is specifict for each process.

Is that right?

Regards,
AQ
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/