Click to See Complete Forum and Search --> : Some questions about kernel compiling


zhiyung
07-17-2004, 12:42 AM
1. What does kernel snapshot mean? Is it some kind of patch? I need to use 2.6.7 for its support for via velocity ethernet controller. But if i use the plain 2.6.7 source, it doesn't have. I need to patch it with a snapshot. I see for 2.6.7, there're dozens of snapshots, from bk1 to bk20 :eek: , so i should use the latest, which is bk20?

2. If i somehow can find a rpm of 2.6.7 kernel, will it automatically enable the via velocity support when installing?

3. What is the correct command to patch? I use:
patch -p1 < [patch file name]
Is this correct?

4. When i compile kernel, at the end, it asks if i wanna use 4k stack instead of 8k stack, um, what is that?

I'm using:
Fedora Core 2
Athlon 64 2800+
Abit KV8Pro (K8T800, VT8237)
HIS 9600XT 256MB
WD SATA 200GB

fatTrav
07-17-2004, 03:54 AM
1. What does kernel snapshot mean? Is it some kind of patch?

From the horse's mouth: http://kernel.org/patchtypes/snapshot.html

3. What is the correct command to patch? I use:
patch -p1 < [patch file name] Is this correct?

That looks ok to me, but read the README (hence the name) that is in the tarball of the kernel patch or kernel source. It will tell you exactly what to do.

4. When i compile kernel, at the end, it asks if i wanna use 4k stack instead of 8k stack, um, what is that?

I honestly don't feel like explaining what kernel stacks are. Partly because I'm not _quite_ sure how to explain. BUT a stack is an ordered set of elements, only one of which can be accessed at a time--aka a pushdown or LIFO list. It is used for procedure control. [Hopefully someone on this board knows more than I do and can clear this def. up some.]


However, traditionally the kernel stacks used were 8k. The 2.6 series is hoping to move to 4k stacks. I don't think it matters one hill of beans personall which you use, however Nvidia drivers will only work with 8k stacks unless you modify them. .... So just use the 8k stacks if you use an Nvidia graphics card.

More on stacks... (http://lwn.net/Articles/84583/)

bwkaz
07-17-2004, 08:11 AM
Originally posted by fatTrav
however Nvidia drivers will only work with 8k stacks unless you modify them. Not anymore. 1.0-6106 works with either stack size:

http://www.nvidia.com/object/linux_display_ia32_1.0-6106.html

;)

As for what a stack is, in this case, it's the place where each function that gets called stores its local variables. The return address (which points at the instruction after the one that called the current function, so that return instructions know where to resume execution) is also stored in the stack.

It's organized as a stack because when function A calls function B, and function B finishes, function B's local variables (and the address in A where B will return to) need to be destroyed, and the easiest way is to pop them off the top of the stack.

From that lwn.net article that fatTrav linked to, the reason that 4K stacks are better is that it's easy to allocate 4K of kernel memory (and each process needs one kernel stack). It's a bit harder to allocate 8K, especially since the 2 pages required have to be next to each other. After the system has been running a while, memory is probably pretty fragmented, and finding 2 adjacent free pages may not be easy.

fatTrav
07-17-2004, 02:13 PM
thanks for clearing that up bwkaz. it's been over a year since my operating systems courses and i'm a little rusty ;)